Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Get property type?

  • Get property type?

    Posted by Alex Printz on February 11, 2020 at 9:12 pm

    Hey all, does anyone know a way to pull a property type?

    If I’m referencing a property in a sub-group, say, thisComp.layer(L).effect(1)(1) and I don’t know exactly what the property is going to be, is there a way to check what the value of the property is and get an answer?

    Arrays are easy (length > 1), but I’m running into determining if something is a boolean or an integer if it’s equal to 0 (e.g., is it an unchecked checkbox, or is it a slider set to zero?)

    Does anyone have any ideas?

    Alex Printz
    Mograph Designer

    Robin De man replied 6 years, 2 months ago 3 Members · 2 Replies
  • 2 Replies
  • David Cabestany

    February 11, 2020 at 11:23 pm

    Not sure if I’m understanding your post, but checked and unchecked boxes must be written as ==1 or ==0

    so it would be something like

    if (var1==1)
    {var2=whatever you want it to do}
    else
    {var2=the other thing you want it to do}
    var2

    A slider would be useful if you wanted to apply a linear expression to the result of your boolean operation

  • Robin De man

    February 12, 2020 at 10:13 am

    if I understand you correctly if could be something like this:

    if(hisComp.layer(L).effect(1)(1).name == "Checkbox" && hisComp.layer(L).effect(1)(1) == 1)
    {
    do something because the checkbox is true
    }
    else if(hisComp.layer(L).effect(1)(1).name == "Slider" && hisComp.layer(L).effect(1)(1).value >= yourvalue)
    {
    do something because your sliders value is above a certain value
    }

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