I've been hammering away on my keyboard for the last few hours to get something seemingly simple done. What I want to do is further rotate an object's world matrix. So I'm grabbing the world matrix like:
x = bpy.context.object.matrix_world
Now I'd like to rotate that by an Euler angle
eAngle = Euler((0.0, 0.2, 0.0)) # rotate 0.2 radians on the Y axis
What I've tried is:
bpy.context.object.matrix_world.rotate(eAngle) # yields a ValueError, 'must have 3x3 dimensions', even though the function description states I could use an Euler as input
bpy.context.object.matrix_world.to_3x3().rotate(eAngle) # does nothing
x = bpy.context.object.matrix_world.to_3x3().rotate(eAngle) # x is none, so I also cannot set that resulting value somewhere else
hammering_hard_on_the_keyboard # feels nice, but only yields keys on the table and floor
Can someone please give me a hint on how to achieve such a rotation?
x = Euler((x,y,z)).to_matrix().to_4x4()
and useobj.matrix_world = x * obj.matrix_world
. $\endgroup$