1
$\begingroup$

I'm trying to figure out how to use Child of constraints to swap a bone's parents when pulling a bone switch. This is a simple enough task when done manually, as shown below:

enter image description here

But I run into problems when trying to set up the drivers to have the switch swap them. Setting up the constraint for Parent 1 is easy:

enter image description here

This makes it so that the when pulled, the Switch bone controls the influence of the Child of_1 constraint from 0-1 when moved in the positive Y direction. But to pull off what I want done, I need the Child of_2 constraint to start at 1 influence, and move to 0 when the switch is moved. How can this be done?

$\endgroup$
1
$\begingroup$

Use Python expression to do that :

Let's say the switch bone change the influence when its Y location is more or less than zero.

Add a variable to the driver which is based on this location, then use its value in a scripted expression, here "var > 0" which returns the value "True" (equal to 1) if var is positive and returns "False" (equal to 0) if var is negative.

enter image description here

For the second driver, do the same, but with an expression "var <= 0" to have the opposite values in return. You can also choose to say "var < 0" if you want that none of the parent influences the child when exactly 0.

enter image description here

In result :

enter image description here

Note : when you validate something in the second driver, Blender switch back the selection to the first driver... a little bug maybe. So beware at which one is selected in the drivers panel, all the time.

$\endgroup$
  • $\begingroup$ This is exactly what I was looking for, thank you! $\endgroup$ – stashy Aug 26 '16 at 5:28

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.