Creative Communities of the World Forums

The peer to peer support community for media production professionals.

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

    Dan Ebberts replied 8 years, 7 months ago 3 Members · 6 Replies
  • 6 Replies
  • Leopoldo Perizzolo

    September 28, 2017 at 10:26 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

  • Leopoldo Perizzolo

    September 29, 2017 at 10:40 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

  • Leopoldo Perizzolo

    September 29, 2017 at 10:42 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

  • Marcelo Cabral

    September 29, 2017 at 1:11 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

  • Marcelo Cabral

    September 29, 2017 at 1:19 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.

  • Dan Ebberts

    September 29, 2017 at 5:16 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

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