I have a simple scene with a motor and its shaft on which a spool is attached. The animation works, the shaft is rotating and I can control its value from python using :

bpy.data.objects['Constraint.motor'].rigid_body_constraint.motor_ang_target_velocity = 0.5

It must be possible to get the actual rotation (angular position) of the shaft, but when I do :


it only gives me the Euler angles at keyframe 0, but not the actual value as the animation is being played. Is their a way to access this value ?

The final goal is to simulate a motor encoder for a robotics simulation. Thanks !


1 Answer 1


The Object's matrix_world is what you're after. Call to_euler(...) to get the Euler angles.



You must log in to answer this question.

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