# Set the world_matrix of a bone

I need to copy the world matrix of a bone and assign it to another bone. Both have different parents. Pretty much what the copy transforms constraint does, but for a single frame without dependencies, because I need it to be set in a certain frame and then put a loc/rot keyframe there. I am fine with either a script or manual solution (like cursor to selected -> selection to cursor, but for rotations as well)

I found this: Global Pose/Rotation of a bone But that script gives me an error, that the expected matrix would need to be 3x3, if I put mat.to_3x3() behind it, nothing happens at all. Also since both bones in that script share a branch in the hierarchy I'm not sure if it would suit me in the first place. I don't care about scale at all. Thanks

• Related – batFINGER Jun 13 '18 at 14:42
• perfect, exactly what I need, I don't know why I didn't find that myself. Thank you. – Frederik Steinmetz Jun 15 '18 at 10:36

bone = C.active_bone

bone = my_armature.pose.bones['my_bone']

• Perhaps C.active_pose_bone whist in pose mode, may have been Ok. – batFINGER Jun 15 '18 at 15:46