Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Using text from layer names to populate expressions

  • Using text from layer names to populate expressions

    Posted by Tom Gomez on January 6, 2011 at 12:57 pm

    Howdy Folks,

    Thanks in advance for any help.

    Series of fairly complicated animations where the camera needs to be mapped to the camera in another comp. The position of the camera in the comp “TARGETING B4” needs to mirror camera in comp “B4.”

    Simplest expression in the universe:

    comp(“B4”).layer(“CAM”).transform.position

    BUT, I have a whole bunch of these. The cam in “TARGETING B5” needs to mirror the cam in “B5.” TARGETING B6 matches B6. Etc.

    What I’m wondering is… is there a way to make the expression automatically change to so that the comp it’s referencing changes by me just changing the NAME of the comp. So if I simply named the comp “TARGETING B7,” the expression would automatically know I wanted to reference the camera in “B7” ?

    Thanks much. Cool expressions make low budget sci-fi movies look almost medium budget! 🙂

    -Tom

    ================================================
    YOU can help save TimeSpace. Join the Chronos Protectorate!

    https://www.95ers.com
    https://www.SpaceAceMedia.com

    Tom Gomez replied 15 years, 4 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    January 6, 2011 at 8:20 pm

    If the comp name has a single space in it, like “Targeting B4″, then something like this should work (not tested):

    targetName = thisComp.name.split(” “)[1];
    comp(targetName).layer(“CAM”).transform.position

    Dan

  • Tom Gomez

    January 6, 2011 at 10:40 pm

    Dan you’re amazing. Very much obliged. Your magic has found its way into many of my animations. THANKS!!!

    ================================================
    YOU can help save TimeSpace. Join the Chronos Protectorate!

    https://www.95ers.com
    https://www.SpaceAceMedia.com

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