FORUMS: list search recent posts

Control checkbox status with slider value

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Juan Martín Miranda
Control checkbox status with slider value
on Mar 14, 2014 at 3:19:31 pm

Hey guys! I'm a newbie in the world of expressions and I'm finding them very useful in terms of rigging a 2D character. Basically I've been trying too figure out a way to control the ON/OFF state of a checkbox depending on the value of a slider. For example: if the value is specifically 0, the checkbox state is ON. With every other value, te state is OFF. I've gathered a few codes I found and made this sort of Frankenstein code, but it doesn't work. Can you give me any help?

It's the head of a character, the slider controls 3 different positions and there are 3 different checkboxes that control 3 separate layers of eyebrows. The idea is to link each head position with the matching eyebrow layer visibility.

Thanks!

if effect("HEAD")("Slider") == 0 {effect("EYEBROW ON/OFF")("Checkbox") == 1)} else {effect("EYEBROW ON/OFF")("Checkbox") == 0)}


Return to posts index


Dan Ebberts
Re: Control checkbox status with slider value
on Mar 14, 2014 at 4:19:22 pm

Your checkbox would just need an expression like this:

thisComp.layer("Head").effect("Slider Control")("Slider")==0

Dan



Return to posts index

Juan Martín Miranda
Re: Control checkbox status with slider value
on Mar 14, 2014 at 5:40:59 pm

Thanks a lot Dan! Works perfectly. It's a so much simpler code than I tought.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]