I’m working on a script that needs to rotate a posed bone over its length, in the modeling window this is done easily by selecting the transform orientation to “normal” or “gimbal” and rotate away!
However, how do I add that kind of rotation in a script ?
Well, I think you are missing either “update()” of the armature, Window Redraw() and/or “inserting a key” in the respective IPO. Sorry that can’t tell you it is exactly in 2.5 but in 2.4x the latter goes like this:
posebone.insertKey(ob,frm,Object.Pose.ROT)
where ob is your armature object, frm is the frame number.
Thnks for the reply Adibos, but I am not looking to animate the bone, but position and orienting it.
Maybe it’s better to not think of this as bones, but of Empties, my workflow needs to be like this:
-move empty to new position (easy)
-rotate_euler to align Z-axis with a vector (took some time to figure out euler rotations, but, done)
Now my problem is:
-rotate empty (over its own Z-axis) to align the X-axis to another vector…