Let's say I have a armature bone with x position 0.

Let's also say I have three cubes, coloured red, blue, and green.

How can I make it so that:

  • When x is between 0 and 1, the only red cube is visible.
  • When x is between 1 and 2, the only blue cube is visible.
  • When x is between 2 and 3, the only green cube is visible.
  • etc.

To explain how I'll apply it:

I've imported a model from a video game, and the lip-sync system involves 10+ separate objects which I'd toggle on and off by using a single slider.


1 Answer 1

  • Below are three spheres with drivers indicated in the properties panel. Please notice the selected object named RenderMaster. It is used in the drivers.

enter image description here

  • Below is a simple driver. Please use copy driver, paste driver then modify for each object to which it is applied. Not the most compact or elegant, and it will suffice for only 10 objects. Please notice which sphere is selected so that the driver makes sense as you note the driver adjustments. Please notice the numbers getting bigger in the Scripted Expression. Modify and Improve to suit your tastes.

enter image description here

enter image description here

enter image description here

  • 10 different Scripting Expressions. These are intended for driver expressions in the image above one for each object.

Please test and verify

not((xloc <= 1) and (xloc > 0))

not((xloc <= 2) and (xloc > 1))

not((xloc <= 3) and (xloc > 2))

not((xloc <= 4) and (xloc > 3))

not((xloc <= 5) and (xloc > 4))

not((xloc <= 6) and (xloc > 5))

not((xloc <= 7) and (xloc > 6))

not((xloc <= 8) and (xloc > 7))

not((xloc <= 9) and (xloc > 8))

not((xloc <= 10) and (xloc > 9))

  • $\begingroup$ That's pretty clever, but like I said in the OP, I need something that will work for 10+ objects. $\endgroup$
    – Poyo
    Jun 5, 2015 at 17:18
  • $\begingroup$ It will work for 10+ objects IMHOIIHO. I have attempted to list 10 scripting expression above as an edit. My intention was to write a recognizable pattern which the reader could extrapolate . Exploration and thinking for the reader can be enriching. My apologies. Please comment if other concerns or critiques arise. $\endgroup$ Jun 5, 2015 at 17:49
  • $\begingroup$ Oh, the only reason I thought I couldn't use this is because you said in your post "and it will suffice for only 10 objects." If that's not the case, then it works perfectly! $\endgroup$
    – Poyo
    Jun 5, 2015 at 19:03

You must log in to answer this question.

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