Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions “index” equivalent for parent comps?

  • “index” equivalent for parent comps?

    Posted by Bert Brown on May 8, 2008 at 9:08 pm

    I have a character comp and I’m controlling a variety of elements from outside it as a precomp, in other words, within the scene comp.

    I’m trying to avoid having a copy of each character comp for each scene, so is there a way to have something like this:

    Vel =comp(“SCENE01”).layer(“Character”).effect(“Velocity”)(“Slider”)

    work for whatever the parent comp is? So i wouldnt always have to duplicate the character comp and replace “SCENE01” with “SCENE02” and so on?

    ———————————-

    peep my over-the-interweb band, red abbott.
    “we electro-rock over long distances…”

    Bert Brown replied 18 years ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    May 8, 2008 at 9:44 pm

    An expression can’t determine the parent comp of the comp the expression resides in. The reason has to do with the fact that a sub comp can be used in many “parent comps” and since the same instance of the sub comp is used in each parent comp, its behavior can’t be different depending on attributes of the parent comp.

    An expression can, however, access any comp by name. So I think the best you can do is duplicate your character comp and give it a name with a suffix that will match the suffix of the corresponding scene comp. For example, the expressions in character comp “Mickey 2” would be smart enough to look for parent comp “Scene 2″.

    Then your expressions would start out with something like this:

    myScene = thisComp.name.split(” “)[thisComp.name.split.length-1];
    myParentComp = comp(“Scene ” + myScene);

    That way, at least you shouldn’t have to go in and edit all the comp names in the expressions, because they would be constructed on the fly.

    Dan

  • Bert Brown

    May 8, 2008 at 10:11 pm

    cool, thanks dan. i’ll give this a try tomorrow and see if i can figure it all out. might have a follow up question, but i did not know about this so i will experiment.

    ———————————-

    peep my over-the-interweb band, red abbott.
    “we electro-rock over long distances…”

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