0
$\begingroup$

GIF of the problem. The empty copies the rotation of the head bone through a Child Of constraint

I have a shader that uses the Z rotation of an empty (called Sara_Origin) through drivers to calculate the shadows on the face. The empty's rotation is constrained to the head bone of the character using a Child Of constraint.

The problem is when rotating the head bone, the empty's rotation doesn't update since it's using a Child Of constraint. Rotating the empty itself works fine.

Is there a way to find the Z Euler rotation value of the empty after it has been rotated through the constraint?

Blend file

Here's my Driver setup

$\endgroup$
1
  • $\begingroup$ Would be nice if you could link the blend file with materials again, so that others can better understand the scene and learn from it... $\endgroup$
    – quellenform
    Commented May 10, 2022 at 8:37

2 Answers 2

1
$\begingroup$

Is there a way to find the Z Euler rotation value of the empty after it has been rotated through the constraint?

Yes.

There are two different ways to get an object's transform into a driver:

enter image description here

One way gets the raw f-curve data, by driving from a "single property", set to the appropriate path. This gets the number that you see in your transform fields when selecting the object. It takes into account f-curves, f-curve modifiers, and drivers. It does not take constraints into account. It is always in the local space of the target.

The second way is to drive from a "transform channel" in the driver. This is the value after any constraints have been applied. It is also remapped from what you might expect your raw values to be: rotations will be remapped to the -180, 180 range and Euler angles will be anti-aliased into whatever method Blender uses (like a 180,0,180 XYZ is going to be read as a 0,180,0 Euler.)

Both methods are useful. For people making rotating gear ratios, they need raw values. For you, you need the values after constraints, so use the second kind.

$\endgroup$
1
  • $\begingroup$ Thanks! This and the other answer work perfectly, thank you so much ^^ $\endgroup$
    – No_Tables
    Commented May 11, 2022 at 8:12
0
$\begingroup$

I think I understand what you mean now:

You want to influence the light/shadows with the angle of the sun and additionally with a gizmo, but at the same time include the rotation of the head, right?

enter image description here

If I'm right, then you would actually only have to additionally capture the rotation of the head.

You can solve it this way or something similar:

enter image description here

I just created an additional driver here that captures the rotation of the head.

But since the orientation is different here, you use the X-axis instead of the Z-axis.

$\endgroup$
2
  • $\begingroup$ Sorry, I forgot to pack the files. Updated the link, should have the materials now. And the method above doesn't work, I need the rotation value of the constrained empty, any ideas? $\endgroup$
    – No_Tables
    Commented May 10, 2022 at 10:44
  • $\begingroup$ Thanks so much! Your answer and the other one here both work perfectly ^^ $\endgroup$
    – No_Tables
    Commented May 11, 2022 at 8:13

You must log in to answer this question.

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