ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Get property type?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Alex Printz
Get property type?
on Feb 11, 2020 at 9:12:27 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


Return to posts index

David Cabestany
Re: Get property type?
on Feb 11, 2020 at 11:23:33 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


Return to posts index

Robin de Man
Re: Get property type?
on Feb 12, 2020 at 10:13:03 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
}



Return to posts index

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