Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions toWorld – different resolution layer for corner pin

  • toWorld – different resolution layer for corner pin

    Posted by Andy Engelkemier on November 29, 2012 at 2:18 pm

    I have a layer with a different resolution and aspect ration than the comp and I need to corner pin the layer to the layer below it using an expression.

    The comp is 1280×720 but the layer I need corner pinned is 2200×3797

    The layer I want to corner pin has been scaled from a few different parents so I want to capture the location of it using “toWorld”.

    The problem is I don’t know what to do with those numbers because the corner pin works on the layer’s resolution.

    So for the left corner I have a Null in the position I want. If I corner pin a solid then the expression works:
    c = layer;
    c.toWorld(layer’s anchor);

    What I can’t seem to wrap my head around is how to convert the comp space numbers back to layer space so the corner pin will work.
    I gave an attempt at it, but can’t make sense of any of the numbers that are coming back.

    Dan Ebberts replied 13 years, 5 months ago 2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    November 29, 2012 at 2:40 pm

    Try these:

    // upper left
    L = thisComp.layer(“target”);
    fromComp(L.toComp([0,0]));

    // upper right
    L = thisComp.layer(“target”);
    fromComp(L.toComp([L.width,0]));

    // lower left
    L = thisComp.layer(“target”);
    fromComp(L.toComp([0,L.height]));

    // lower right
    L = thisComp.layer(“target”);
    fromComp(L.toComp([L.width,L.height]));

    Dan

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