To accurately align the bone of one armature with the bone of another armature, we need to correlate the global armature matrices and the local pose-bone matrices.
To do this, we need to execute the following:
1 2 3 4 5 6 7 |
import bpy armature_to = bpy.data.objects['Armature'] armature_from = bpy.data.objects['Armature.001'] armature_from.matrix_world = armature_to.matrix_world armature_from.pose.bones[0].matrix = armature_to.pose.bones[0].matrix |
After executing this code, the first bone of the “Armature.001” will be moved to the position of the first bone of the “Armature”.