Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions thisComp “display name” possible?

  • thisComp “display name” possible?

    Posted by Paul Stevenson on May 19, 2015 at 4:53 pm

    Hello,

    I testing out a theory for later use and I have hit a small snag.

    In my proposed setup I have my parent comp with many (duplicated) comps inside it. The child comp, in this instance, is a shape layer.

    Added to the sub comps within the parent are controls, these are to adjust variables within the child sub comps, for instance stroke width etc.

    In the sub child comps I am using expressions like this one:

    comp(“Parent”).layer(thisComp.name).effect(“Stroke Width”)(“Slider”)

    Now all this works perfectly on a single comp, however I want a setup where I can duplicate the child comp many times and then adjust the variables per instance.

    The problem is the above expression reads the name of the comp, not the “displayed” name. So if you duplicate a sub comp and rename it within the parent comp (note not renaming it in the Project window), then the name is still the same and only one takes precedence and all the sub comps take their values from it and not it’s own controls.

    The reason for the pre-comps is that I want to be able to tweak and change the contents without having to re-do it x number of times, but yet I want to be able to change certain values per instance it’s used, but yet I don’t want to have to keep tweaking the expressions/values within the child comp.

    So, is it either possible to pull the “display” name of the comp, or target it directly without a name from the expression? For instance something like:

    Pseudo:

    thisComp.parent.effect(“Stroke Width”)(“Slider”)

    I know I can work around the problem, it’s just the amount of extra work involved and the time it would take to tweak/change the contents would be annoying.

    Any help would be greatly appreciated.

    Paul Stevenson replied 10 years, 11 months ago 2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    May 19, 2015 at 7:25 pm

    You’re not really duplicating the sub comp, you’re duplicating a layer in the main comp (which happens to have the sub comp as its source), correct?

    If so, I don’t think you can do it the way you want. You would have to duplicate the sub comp itself, in the project panel, and give each copy a unique name.

    Dan

  • Paul Stevenson

    May 20, 2015 at 8:40 am

    Sort of.

    I have the main comp, which has a completely different comp inside it (sub comp). That sub comp in turn has a shape layer inside it.

    It is the sub comp that I am duplicating. But yes you are correct, it’s not actually duplicating the sub comp, but more duplicating the instance on the sub comp on the timeline. However the controls that are on the sub comp (at the main comp level) are then independent as they are in the main comp and sub comp merely references them.

    This image probably explains it better than words:

    And then the shape comp:

  • Dan Ebberts

    May 20, 2015 at 3:48 pm

    I think the key thing to remember is that if you only have one precomp, it can only render one way. If you want the “instances” to behave differently, they have to be sourced from separate comps in the project panel.

    Dan

  • Paul Stevenson

    May 20, 2015 at 4:12 pm

    Yes, sadly I have come to that conclusion.

    I can see why it works the way it does, but I see how it could work the other way. Never mind, I shall just have to do it by duplicating the comp in the project window.

    Thank you.

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