Activity › Forums › Adobe After Effects Expressions › Change position property of an object with a check box
-
Change position property of an object with a check box
Posted by Marcelo Cabral on September 28, 2017 at 9:27 pmHi. I wondering if it’s possible to change the position of a 2D object using a checkbox expression effect.
If the checkbox is on the object is in the A position and when the box is unchecked the object change the position to position B.
Thank you.Marcelo
Dan Ebberts replied 8 years, 7 months ago 3 Members · 6 Replies -
6 Replies
-
Leopoldo Perizzolo
September 28, 2017 at 10:26 pmSomething like this should do; apply a Checkbox control on the layer and paste this on the position property:
posA = [200, 400]; // "checkbox enabled" position
posB = [600, 100]; // "checkbox disabled" positiontry{
if(effect("ADBE Checkbox Control-0001")(1) == true) posA;
else posB;
}
catch(e){
value;
}Leopy
-
Leopoldo Perizzolo
September 29, 2017 at 10:40 amSorry, I meant:
posA = [200, 400]; // "checkbox enabled" position
posB = [600, 100]; // "checkbox disabled" positiontry{
if(effect("ADBE Checkbox Control")("Casella") == true) posA;
else posB;
}
catch(e){
value;
}Leopy
-
Leopoldo Perizzolo
September 29, 2017 at 10:42 amTesting…. ????
posA = [200, 400]; // "checkbox enabled" position
posB = [600, 100]; // "checkbox disabled" positiontry{
if(effect("ADBE Checkbox Control")(1) == true) posA;
else posB;
}
catch(e){
value;
}
I didn’t make it universal.Leopy
-
Marcelo Cabral
September 29, 2017 at 1:11 pmHi Leopy
Thank you for your response and support ☺ I’m starting my day right now. I will give it a try, sure it will work fine.
CheersMarcelo
-
Marcelo Cabral
September 29, 2017 at 1:19 pm -
Dan Ebberts
September 29, 2017 at 5:16 pmTry it this way:
posA = [200, 400]; // "checkbox enabled" position
posB = [600, 100]; // "checkbox disabled" positionif(thisComp.layer("CONTROL").effect("POSITION")(1).value)
posA
else
posB;
Dan
Reply to this Discussion! Login or Sign Up
