I am exporting meshes attached to bones. For each mesh I have transform matrix that is used to position mesh relative to bone. This relative matrix is calculated using:
obj.parent.data.bones[obj.parent_bone].matrix_local.inverted() * obj.matrix_local
When I export with armature in rest position I get correct results.
If I switch to pose position in blender and export, I get wrong results
I think that problem is obj.matrix_local
which is based on current bone position.
How can I force rest position, or use other method to calculate object's transform
relative to bone.
armature.data.pose_position = 'REST'
doesn't work from script, but looks like
it works from console.