Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Mirroning position

  • Mirroning position

    Posted by Fabio Santos on April 4, 2016 at 2:44 pm

    Hello everyone!

    I have a square in a comp and a circle in other comp. In Main comp, I have a null object to control the position of square and I using the cod bellow, inside the square’s comp.

    L=comp(“man”).layer(“C_feet_rgt”);
    P=value+L.toWorld(L.anchorPoint);
    parent.fromWorld(P);

    When I change the position of square working with the null object in the Main comp, I’d like to circle moves to oposite position of the square.

    How can I mirror the position of a circle?

    Thanks

    Miguel De mendoza replied 10 years, 5 months ago 2 Members · 1 Reply
  • 1 Reply
  • Miguel De mendoza

    April 4, 2016 at 3:03 pm

    You have to set a reference point on the axis you want to be the center of the mirror. I.E if you want to mirror this objects arround the middle of the comp in the x axis you can write something like this:

    //in the square
    L=comp("man").layer("C_feet_rgt");
    center = [comp("man").width /2, 0]
    P= center + value+L.toWorld(L.anchorPoint) ;
    parent.fromWorld(P);

    //In the circle
    L=comp("man").layer("C_feet_rgt");
    center = [comp("man").width /2, 0];
    squarePos = comp("squareComp").layer("squareLayer").position
    P= center - squarePos ;
    parent.fromWorld(P);

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