Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Create Negative Value.

  • Create Negative Value.

    Posted by Allen Joaquin on March 7, 2013 at 9:53 pm

    Hi, well basicly here’s what i have:

    I’ve got 2 solids with optical flares applied an i have 2 diff flares on each solid one on the left and one on the right.

    Screenshot:(https://gyazo.com/d5f817001702bc2e52d1a7fe7389de98.png?1362693010)

    Now i’d like to link the position XY of my left or right flare to be the exact negative of my other flare, because when i move the position XY from one flare it will go to one side.

    Let’s say if i move the flare #1 to the left the Flare #2 will go to the Right.

    I’ve come up with this expresion:

    A = thisComp.layer("Optical Flares 2").effect("Optical Flares")("Position XY")
    B = value
    C = B -A/2;

    But the problem is it is affecting Y and i only want it to be affected by “X”,

    Hence to take the value “x” from Flare #1 and affect the “X” position of flare #2.

    Is there any way i could do that?

    Allen Joaquin replied 13 years, 1 month ago 3 Members · 3 Replies
  • 3 Replies
  • Kevin Camp

    March 7, 2013 at 10:16 pm

    since the value of position is multidimensional, you need to single out the dimension by using it’s index — x = [0], y = [1], z = [2].

    if you want to keep y separate (so it can be different than the other flare’s y) then this could work:

    p = thisComp.layer(“Optical Flares 2”).effect(“Optical Flares”)(“Position XY”);
    x = value[0] – p[0]/2;
    [x,value[1]]

    Kevin Camp
    Senior Designer
    KCPQ, KMYQ & KRCW

  • Dan Ebberts

    March 7, 2013 at 10:29 pm

    I would think you’d be looking for something like this:

    otherFlare = thisComp.layer(“Optical Flares 2”).effect(“Optical Flares”)(“Position XY”);
    [width-otherFlare[0],otherFlare[1]]

    or this:

    otherFlare = thisComp.layer(“Optical Flares 2”).effect(“Optical Flares”)(“Position XY”);
    [width-otherFlare[0],value[1]]

    Dan

  • Allen Joaquin

    March 8, 2013 at 2:43 pm

    great they helped greatly! Thanks a lot!

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