Hi,

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 ?

I tried this:

rotq=mathutils.Quaternion()

rotq.w=radians(45) #let’s rotate 45 degrees

rotq.x=0

rotq.y=0

rotq.z=1#over the z-axis

pbone.rotation_mode=“QUATERNION”

pbone.rotation_quaternion+=rotq

Which was obviously wrong,

then I just thought to do this:

pbone.rotation_mode=“QUATERNION”

pbone.rotation_quaternion.w+=radians(45)

nope…

then this:

pbone.rotation_mode=“AXIS_ANGLE”

pbone.rotation_axis_angle[0]+=radians(45)

none of these work, obviously because I do not know what I’m doing…

Any of you know where I went wrong,

Appreciated much…

wzzl