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
    Aug 29 '15 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$ Sep 2 '15 at 12:58

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


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.