Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expressions Proportional Pantograph expression

  • Proportional Pantograph expression

  • Pete Burges

    September 21, 2022 at 12:51 am

    I haven’t found this in any searches so apologies if it’s been covered in another thread.

    I was trying to come up with a way to replicate the animation of a layer in one comp to a layer in a larger comp- but proportional to the size of each comp. So for example, if Comp 1 (little) is 800×800 and shows a 50×50 red square moving from corner to corner in a clockwise direction, I can have a 100×100 green square in Comp 2 (big) which is 1600×1600 appear to do the exact same thing. Kind of a Pantograph expression, if you will.

    I got as far as making this expression for the position of the green square (more by luck than judgement, I might add):

    L1 = comp 1(“little”).layer(“red square”);
    P1 = L1.toWorld(L1.anchorPoint);
    L2 = thisLayer;
    P2 = L2.toWorld(L2.anchorPoint);

    This seems to work fine but only because I know that Comp 2 is double the size of Comp 1, hence the *2 in the last line. I then tried pickwhipping the rotation and scale to my target layer, figuring that degrees are degrees and scale is a percentage regardless of comp size, but because the layer sizes and therefore the anchor points are different I got strange results. I got around this by adding a second null and using one for the position, and using the second for scale and rotation, parenting it to the first and then finally parenting my green square to the second null.
    That all works fine, but I am wondering if cleverer expressioneers than me could come up with a more elegant solution..? I thought perhaps there might be a way to calculate the differences in the anchor points and auto adjust that so you could then just pickwhip the rotation and scale and not have to use an extra Null. Perhaps even adding a function to calculate the size of Comp 2 as a percentage of Comp 1 for those times when it isn’t a neat factor of two or four. I don’t even really know where to begin with those.

    Any insights would be much appreciated!

Viewing 1 of 1 posts

Log in to reply.

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