I stumbled upon the following problem:
Whenever I parent a mesh to a bone like this:
mesh = bpy.context.active_object mesh.parent = bpy.data.objects['myArmature'] mesh.parent_type = 'BONE' mesh.parent_bone = bpy.data.armatures['myArmature'].bones.active
the mesh’s local transformation matrix is interpreted with respect to the bone’s transformation matrix (in world coordinates) after parenting which leads to the mesh “jumping” to its parent bone’s position and orientation.
However, I just want to link mesh and bone together so that whenever I move the bone, the mesh moves accordingly.
In terms of transformation matrices: At the moment of parenting, I want the tranformation matrix from bone to mesh to be kept and not to be overwritten by the local transformation matrix of the mesh.
Am I missing something here?
Any help would be greatly appreciated!