Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions – Can I use relative links instead of hard-wired ones?

  • Expressions – Can I use relative links instead of hard-wired ones?

    Posted by Greg Neumayer on March 16, 2006 at 5:27 pm

    I’ve got a master comp that I’d like to duplicate numerous times, increment the file name, make one source replacement (headshot), and add the whole lot to my render queue, so that I have the same animation with a different headshot each time. My problem is that I’ve used a bunch of expressions that point to my master comp. An expression slider in my master comp dictates which headshot to use.** So, when I duplicate my master comp, all the expressions point only to that first master, and understandably, after dropping them all into my render queue, I’d just end up with the same animation 40 times, because they all look to the same expression for the information about which headshot I’m using.

    So, my working solution is to create a new project and import my previous project into it 40 times, then modify the top-level expression of each master comp that dictates which headshot to use.

    Is there a better way? It seems like if I could use a command like ._parent when referencing for expressions, it would solve this, because then I could get each sub-expression to link to it’s own top level, instead of the original comp I make the dups from. Are there relative links?

    Thanks,
    Greg.

    **Headshots are all on one layer, stacked vertically, separated by 500 px. Master slider is a range 1-40. Headshot layer position is [0,y] where y=slider value*500. I’ve also linked to this same slider to change a couple other things throughout the animation, specific to the person shown. Mr. Smarty-pants thought he was so cool, because when he changes the slider, the whole animation changes to reflect the characteristics and data of the new person, but now he can’t seem to render more than one at a time, because he can’t get them duplicated and isolated from each other.

    Antifreeze Design
    https://www.antifreezemotiongraphics.com

    Greg Neumayer replied 20 years, 5 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    March 16, 2006 at 5:49 pm

    No, unfortunately there’s no way for a precomp to find out what comp it’s nested in. It makes sense if you think about it – since a pre-comp can be dropped into any number of comps the concept of a “parent” doesn’t really work.

    I’m not sure if this would work in your situation, but you could have the precomp build the name of its parent comp based on its own name like this:

    myParentCompName = “Master” + thisComp.name.substr(-2);

    So if you had Subcomp01 nested in Master01, it would calculate the name of the master. Then when you duplicate the master and the subcomp, AE will name them Subcomp02 and Master02 and the expression should still work. Something like that is probably the best you can do unless you write a script to do the whole thing for you.

    Dan

  • Greg Neumayer

    March 16, 2006 at 6:16 pm

    Very cool. I’ll give that a try.
    Thanks!
    -Greg

    Antifreeze Design
    https://www.antifreezemotiongraphics.com

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