Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Taking variables from a parent comp

  • Taking variables from a parent comp

    Posted by Arvin Bautista on May 12, 2011 at 10:39 pm

    I have 32 lower thirds that all animate the same way but have different text and color combinations depending on which of 8 categories it fits in.

    The client is picky about how the lower thirds animate in, so currently I have all the animation linked to animation in a “control comp.”

    Meanwhile I have the lower third colors picked based on its comp name (if the comp name is name__position1, I have an expression that says “if the second field is position1, change the fill to the color assigned in the control comp’s layer named position1).

    Anyway, long story short I want to just create one precomp of the lower third animating in, but having the text source and colors change based on the name of its parent comp. That way I only ever need to play around with one precomp to alter the animation.

    Any thoughts? I’d love to be able to set an expression within the precomp to reference variables in the parent, but I can also go with an expression in the parent that assigns values to the precomp (as long as they don’t alter the values in the other comps using that precomp).

    Arvin Bautista
    Greasy Pig Studios
    Los Angeles, CA
    https://www.greasypigstudios.com

    Dan Ebberts replied 15 years ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    May 12, 2011 at 11:43 pm

    If only you could do that.

    There’s no way to reference a parent comp, other than by name. That means you can can’t have a pre-comp that sets its internal parameters differently based on which comp it’s nested inside.

    Dan

  • Arvin Bautista

    May 13, 2011 at 6:12 pm

    Figured out a solution for myself, though it’s not the proper solution to this issue.

    What I needed to do was change the two colors that make up the graphic part of the lower3rds, the ones that I wanted to use just one precomp for so I would only have to change one comp if the client wanted to alter the animation. And I wanted the colors changed to something based on variables from its parent comp (which would tell it what color it needed to be).

    I did this by creating a master precomp where the two colors are set to unused colors, then within the main comp add 2 “change to color” effect, which would change each color to the proper color.

    The Change to Color effect was dynamically driven, where depending on variables taken from the comp name, it would take color information from yet another comp, which served as the master color comp, where all the different color combinations.

    Anyway, almost certainly a one-off solution. I still say Aftereffects should allow you to push expressions into instances of the precomp!

    Arvin Bautista
    Greasy Pig Studios
    Los Angeles, CA
    https://www.greasypigstudios.com

  • Dan Ebberts

    May 13, 2011 at 6:18 pm

    Yup, that’s generally the best work around–getting the expressions to use some aspect of the comp’s name to drive the variables, but it does mean that you need a separate instance of the comp for each variation.

    Dan

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