1 Reply Latest reply on May 13, 2013 9:13 PM by Mylenium

    Expression: Obj 2 moves right when Obj 1 moves left.???

    Van Garmon Level 1

      Hello.

       

      I having trouble trying to come up with an expression that would allow me to move OBJ 2 to the right when OBJ 1 moves to the left.  Obviously when I parent one of the objects to the other and move to either side the both end up moving in the same direction.  Does anyone have an expression for this or perhaps can lead me to a helpful link that would educate me.

       

      Thanks in advance.

        • 1. Re: Expression: Obj 2 moves right when Obj 1 moves left.???
          Mylenium Most Valuable Participant

          Depends on the setup and what actually the "objects" are. You know, shape layers have different coordinate logic than normal layers for instance... Generally it one would subtract the position of Obj 1 from anchor point or composition center and then adding/subtracting it to/from Obj 2. Something like this for an X axis mirroring across the comp middle:

           

          mHalf=thisComp.width*0.5;

          mRef=thisComp.layer("Obj A");

           

          mDiffX=mRef.position[0]-mHalf;

          mPosX=mHalf-mDiffX;

           

          X=mPosX;

          Y=value[1];

          Z=value[2];

           

          [X,Y,Z]

           

          Also consider that many setups with perfect symmetry could just as well be done by using Effect --> Distort --> Mirror, assuming the shape is in itself symmetrical and the flipping would not show...

           

          Mylenium