ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Change position property of an object with a check box

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Marcelo Cabral
Change position property of an object with a check box
on Sep 28, 2017 at 9:27:09 pm

Hi. 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


Return to posts index

Leopoldo Perizzolo
Re: Change position property of an object with a check box
on Sep 28, 2017 at 10:26:06 pm

Something 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" position

try{
if(effect("ADBE Checkbox Control-0001")(1) == true) posA;
else posB;
}
catch(e){
value;
}


Leopy


Return to posts index

Leopoldo Perizzolo
Re: Change position property of an object with a check box
on Sep 29, 2017 at 10:40:06 am

Sorry, I meant:
posA = [200, 400]; // "checkbox enabled" position
posB = [600, 100]; // "checkbox disabled" position

try{
if(effect("ADBE Checkbox Control")("Casella") == true) posA;
else posB;
}
catch(e){
value;
}


Leopy


Return to posts index


Leopoldo Perizzolo
Re: Change position property of an object with a check box
on Sep 29, 2017 at 10:42:22 am

Testing.... 😅

posA = [200, 400]; // "checkbox enabled" position
posB = [600, 100]; // "checkbox disabled" position

try{
if(effect("ADBE Checkbox Control")(1) == true) posA;
else posB;
}
catch(e){
value;
}

I didn't make it universal.

Leopy


Return to posts index

Marcelo Cabral
Re: Change position property of an object with a check box
on Sep 29, 2017 at 1:11:24 pm

Hi 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.
Cheers

Marcelo


Return to posts index

Marcelo Cabral
Re: Change position property of an object with a check box
on Sep 29, 2017 at 1:19:37 pm

Hi Leopy
It doesn´t work. Maybe I am doing something wrong. I have attached an image to show you how I am using it in AE.
Cheers.



Return to posts index


Dan Ebberts
Re: Change position property of an object with a check box
on Sep 29, 2017 at 5:16:27 pm

Try it this way:


posA = [200, 400]; // "checkbox enabled" position
posB = [600, 100]; // "checkbox disabled" position

if(thisComp.layer("CONTROL").effect("POSITION")(1).value)
posA
else
posB;



Dan



Return to posts index

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