FIGURED IT OUT MYSELF: (it looks like 0,1 don't need to be modified to T/F and I can just use var and 1-var to get the effect I want)

I'm in the process of creating my first semi-complex rig and I want to be able to be able to toggle the visibility of my FK and IK bones depending on whether they're driving my deformation bones.

I'm using five integers with [0,1] values to drive the bone constraint influence driving the deform bones. I want to use these same integers to show/hide my layers so I only see relevant bones.

Blender gives me an "ERROR: Invalid Python Expression" message when I put 'True' if var == 0 else 'False' in the scripted expression box in the Drivers Properties side-bar. How should I format this? Or is it not possible?

(Blender Ver 2.75a)

  • $\begingroup$ False if some_test else True (or vicee versee), no quotes on the booleans. $\endgroup$
    – batFINGER
    Commented Aug 29, 2015 at 20:06
  • $\begingroup$ If you want to answer your own question you should use the answer box below your question instead of adding the answer into the body of the question. $\endgroup$ Commented Sep 2, 2015 at 12:58

1 Answer 1


Blender evaluates 1 and 0 as True and False without any extra coding needed. I was overthinking it.


You must log in to answer this question.

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