Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions multiple parameters per expression from a checkbox

  • multiple parameters per expression from a checkbox

    Posted by Mike Roberts on July 25, 2013 at 11:04 pm

    hey dudes,

    I”m rigging an IK puppet and have the IK direction switches that need to dynamically change based on checkbox controls.

    I have a CheckBox that flops the puppet from side to side by hiding the appropriate artwork. It also inverts the IK chain direction. But I want to be able to flop the chain back if i need the arm direction to invert without turning the whole body.

    Can i call multiple states in a single expression? Here’s what i have…

    if (thisComp.layer(“EffectsLayer01”).effect(“Checkbox”)(“Checkbox”)== 1) 100 else 0

    but I want to make it like this:

    if (thisComp.layer(“EffectsLayer01”).effect(“Checkbox”)(“Checkbox”)== 1) 100 else 0
    or
    if (thisComp.layer(“EffectsLayer02”).effect(“Checkbox”)(“Checkbox”)== 1) 0 else 100

    Hopefully What i’m asking for makes sense….

    Mike Roberts replied 12 years, 9 months ago 2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    July 25, 2013 at 11:28 pm

    It’s hard to tell from the way you’ve described it exactly under which conditions the value would be 100 and when it would be 0. Maybe you can describe it in words rather than code.

    Dan

  • Mike Roberts

    July 25, 2013 at 11:38 pm

    Of course. Sorry Dan.

    Essentially i have 2 IK puppets serving as a single puppet that faces left and right. I’m just turning the opacity on and off to get them face the specified direction.

    That part all works like a charm, but because I’m using a checkbox to invert the IK of the arms (bending at the elbow) I can only have everything ether facing left or right.

    Occasionally i want the arms to bend in opposite directions to get the performance i want.

    So far i have a checkbox that toggles the opacity of the puppets from 0 or 100 –

    that same check box also toggles the IK direction of the arms and legs by triggering the IK checkbox

    But now i need a 3rd checkbox that essentially tells the arms to independently switch their direction again allowing the rest of the body to keep facing the same direction…

    Any more clear? Sorry – it’s super confusing to me as well.

  • Dan Ebberts

    July 25, 2013 at 11:49 pm

    I’m assuming layer02 has the checkbox that filps the result of the layer01 checkbox, but it could be something like this:

    s1 = 100;
    s2 = 0;
    if (thisComp.layer(“EffectsLayer02”).effect(“Checkbox”)(“Checkbox”)== 1){
    s1 = 0;
    s2 = 100;
    }
    if (thisComp.layer(“EffectsLayer01”).effect(“Checkbox”)(“Checkbox”)== 1) s1 else s2

    Dan

  • Mike Roberts

    July 26, 2013 at 12:15 am

    I’m sure you hear this day in and day out – but you’re a certified genius… Thanks Dan.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy