Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Framing a comp using another comp?

  • Brendon Murphy

    February 3, 2021 at 7:15 pm

    Totally possible:

    1. Put the same background into both comps

    2. inside the smaller “framing” comp, add this expression to the position parameter of the background image

    ogPosX = comp("framing Comp1").layer("background").transform.position[0];

    ogPosY = comp("framing Comp1").layer("background").transform.position[1];

    adjustPosX = comp("framing Comp1").layer("framing").transform.position[0];

    adjustPosY = comp("framing Comp1").layer("framing").transform.position[1];

    adjustWidth = thisComp.width/2;

    adjustHeight = thisComp.height/2;

    [ogPosX-adjustPosX+adjustWidth,ogPosY-adjustPosY+adjustHeight];

    Assuming you haven’t shifted any anchor points, that should do it!

    free tools at https://www.thepixeldump.com/

  • Filip Vandueren

    February 4, 2021 at 10:14 am

    Here’s how I do this:

    • In the “Framing Comp”, where a copy of the footage lives, create a “Framing Solid” that has the same dimensions as your footage
    • Parent it to the footage.
    • In the other comp that you want framed add these expressions to the footage layer.

    anchorPoint:

    L = comp("Framing Comp").layer("Framing Solid");
    L.parent.fromComp(L.toComp([L.width/2, L.height/2]));

    position:

    [thisComp.width/2,thisComp.height/2];

    scale:

    s=comp("Framing Comp").layer("Framing Solid").transform.scale[0];
    value * [100/s];

    rotation:

    comp("Framing Comp").layer("Framing Solid").transform.rotation * -1;

    This way postition, scale, and rotation will be implemented from the framing Solid, and you can freely change the anchorPoint of the framing solid which can help in certain rotation and zoom effects.

    BTW, it is absolutely a practical and more intuitive way to handle these kinds of pan & scan effects.

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