Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Match position but not scale

  • Match position but not scale

    Posted by Joseph Pole on November 13, 2008 at 4:05 pm

    I’m sure this is an easy one for many of you out there

    I have a composition that has a map layer (solid with a mask defining landmass) and text layers that indicate the location of cities. I’d like to be able to scale the map layer up or down and have the place names continue to accurately represent the position of the city without changing size.

    If there’s a way to parent one layer to another so that the child’s position in relation to the parent remains constant without changing scale that would do it. However, I’m guessing this requires an expression rather than parenting?

    Thanks

    Joseph

    Nathan Dies replied 14 years, 4 months ago 4 Members · 4 Replies
  • 4 Replies
  • Darby Edelen

    November 13, 2008 at 5:27 pm

    You should be able to use an expression like this:

    l = thisComp.layer("MapLayer");
    l.toWorld(value);

    on the position property of the text layers.

    Darby Edelen

  • Dan Ebberts

    November 13, 2008 at 6:26 pm

    If you parent the text layers to the map, you can add a scale expression like this to the text layers:

    parentNormalScale = 100;
    value * parentNormalScale/parent.transform.scale[0]

    You would want to adjust the first parameter to be whatever your map scale starts at.

    Dan

  • Joseph Pole

    November 13, 2008 at 11:09 pm

    That works perfectly thanks Dan.

    Kind Regards

    Joseph

  • Nathan Dies

    January 18, 2012 at 4:29 pm

    Thanks for this resource. I’ve been working on some HUD elements to composite into sports footage and I was able to work “.toFixed(0)” into different script lines to eliminate these ridiculous decimals.

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