1
$\begingroup$

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

$\endgroup$
2
  • 1
    $\begingroup$ Related $\endgroup$
    – batFINGER
    Jun 13, 2018 at 14:42
  • $\begingroup$ perfect, exactly what I need, I don't know why I didn't find that myself. Thank you. $\endgroup$ Jun 15, 2018 at 10:36

1 Answer 1

1
$\begingroup$

The link batFINGER provider is the correct answer, just in case someone is wondering: The reason why my bone was expecting a matrix 3x3 is that I used

bone = C.active_bone

the correct way to get the bone is

bone = my_armature.pose.bones['my_bone']
$\endgroup$
1
  • 1
    $\begingroup$ Perhaps C.active_pose_bone whist in pose mode, may have been Ok. $\endgroup$
    – batFINGER
    Jun 15, 2018 at 15:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .