How to rig a switch to swap a bone's parents? 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:



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:



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?
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.



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



In result :



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.