2

This question was asked almost a year ago, and no solutions were offered at that time. The original poster described exactly what was needed in a follow-up comment which can't be linked to directly, so I'm pasting here for reference:

Imagine a comp called 'Red," within which is nested a comp called 'Circle.' Red has a color picker set to red, and Circle takes its color from Red. Now I want to duplicate Red, call it Blue, and have Circle -- the same Circle precomp, not a copy of it -- become blue when it's nested within 'Blue.' Does that make sense? Apparently it's not possible. Blue would have to be duplicated in order to reference the new parent comp. There is no way for a comp to discover which comp it is nested in. – Ze'ev Aug 20 '14 at 15:41

I've found myself needing to do exactly the same thing. Was hoping with a year having passed new SE users might know a way to do this, or AE CC 2015 has added a slick way to do this. My research efforts including combing through SE, reading several Q&As and articles on Adobe's site, Google searches of course, no dice across the board. Grateful for assistance.

Thanks, - DK

1

The layers in a pre-comp don't have access to information about the comp(s) they're nested in AFAIK, but I can think of a workaround in this case: apply a fill effect to the nested layer and drive its colour value using the name of the parent comp, e.g.

if (thisComp.name == "Blue"){[0,0,255]}
else if (thisComp.name == "Red"){[255,0,0]}…

and so on. Or you could name the comps by their colour values— something like 255-123-001—and use js string methods to extract the colours from the comp name.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.