I basically have a two-part hinged lever. One arm is fixed, and the other arm can rotate in Y 0 to -45 degrees (X and Z are constrained to 0). So it's rigid body active -> hinge -> rigid body passive. And I want to put a 'signal light' on the passive arm which will change between two colors when then active arm has been rotated more than x degrees. It's like a "Warning, arm is out of rest position" signal.

So I made a material, colored it with a color ramp with my two colors. And it takes a value set by a driver that watches rotation_euler[1] on the active arm. There are also some math nodes in there to get things into the range I want. And this works fine in the 3d viewport when I manually rotate the active arm - the color changes when the active arm has rotated to the range I'm watching for.

But it doesn't work in the animation, or when rendered. The active arm moves when it's pushed by the thing that's supposed to push it (just a falling object, for now), but the color of the indicator never changes. It looks like the rotation_euler[1] value doesn't change.

If I look at the value in the Python console:

>>>bpy.data.objects['Lower Arm'].rotation_euler

Euler((0.0, 0.0, 3.1415927410125732), 'XYZ')

But that output never changes, regardless of which frame I stop the animation on. (The 180d rotation in Z is expected).

Any ideas? Is this not a valid way to watch rotation?

(2.93.5, Win10)

  • 1
    $\begingroup$ Might not be it, but I noticed that if the object's angle display mode in its transform properties is set to Quaternion or Axis Angle, the euler angle never gets updated with changes. And conversely $\endgroup$
    – Gorgious
    Nov 2, 2021 at 14:37
  • $\begingroup$ i think one sketch would help here much more than 1000 words ... ;) $\endgroup$
    – Chris
    Nov 2, 2021 at 14:37
  • $\begingroup$ so you can use rotation_axis_angle or rotation_quaternion instead of rotation_euler $\endgroup$
    – Gorgious
    Nov 2, 2021 at 14:39
  • $\begingroup$ The object's transform properties show "XYZ Euler" mode. $\endgroup$
    – cleek
    Nov 2, 2021 at 14:52
  • $\begingroup$ Here's the .blend: ok-cleek.com/stuff/newarm.blend !https://ok-cleek.com/stuff/newarm.png. $\endgroup$
    – cleek
    Nov 2, 2021 at 15:00


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.