Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expression linked to a layer that needs to independent from which comp he’s at

Tagged: 

  • Expression linked to a layer that needs to independent from which comp he’s at

    Posted by Nader Douik on September 29, 2020 at 4:17 am

    Hello everyone,

    So to make it simple, let’s say I have a main comp, MAIN
    and a comp that contains a template to use for pictures, called PICTURE CENTER, let’s call it P-C for easier reference.
    in the P-C there will be layers named “picture1”, “picture2”, and so on.
    Inside “picture1”, I put an expression on layer(x) to make the opacity either 0 or 100, depending on the checkbox that exist on top of the layer “picture1”. In this case, the expression has to reference the layer “picture1” through the comp P-C to work.
    When I move my layer, “picture1”, to my MAIN comp, obviously, the expression breaks.

    Is there a way to make like an absolute reference directly to the layer “picture1” no matter where is sits in the project? or is there a better way to approach this?
    Thanks in advance for any ideas or suggestions! BlushHeart

    Nader Douik replied 5 years, 7 months ago 2 Members · 4 Replies
  • 4 Replies
  • Robert Müller

    September 30, 2020 at 8:56 am

    Inside “picture1”, I put an expression on layer(x) to make the opacity either 0 or 100 (…)

    So just that I understand, “picture1” is ALSO a composition and not just a layer like a picture or a solid? You should clarify that if you are already listing your compositions.

    If thats the case and your working with essential graphics and master properties you are out of luck, in this case you need to specify the composition in which your other comp is nested.

    If “picture1” however is just a layer you could just reference it in your expression using “thisLayer” instead of “comp(“compname”).layer(“layername”)”

  • Nader Douik

    October 1, 2020 at 7:22 am

    Thanks for taking the time Robert!
    You’re right I forgot to clarify that! “Picture1” is a comp and not a layer.

    I am not working with essential graphics or master properties, I just duplicate the comps once and then use them as they are each time I start working on a new video.

    I don’t recognize the authority of luck.
    I have made a system that works already, an expression that checks if my comp “picture1” is located in P-C or in the MAIN comp, and update the other expression so that it references the comp correctly. It works. But out of curiosity, I will keep looking if there is another way to do this.
    Also found another very simple way to do this which is to just leave the comp “picture1” in P-C, and make a copy of it in the MAIN comp. That way, you will get the contents of “picture1” in the main comp, and you can control the expressions, checkboxes or whatever you have on “picture1” from the copy that exist in the P-C comp without needing to reference it again.

  • Robert Müller

    October 1, 2020 at 3:38 pm

    I don’t recognize the authority of luck.
    I have made a system that works already, an expression that checks if my comp “picture1” is located in P-C or in the MAIN comp, and update the other expression so that it references the comp correctly. It works. But out of curiosity, I will keep looking if there is another way to do this.

    I would like to see your set up so far because what you are describing is not possible to my knowledge using just expressions. If you have to composition containing the same nested composition, how would an expression even be able to tell in which comp it resides, since it is actually in 2 at the same time? If you remove the precomp from one of the compositions, then you might be able to check – if you state the names of all the possible comps in which the precomp could be in to check against. And what do you men by copying, copying the whole composition or just duplicating it, eg referencing the same composition just twice?

  • Nader Douik

    October 9, 2020 at 5:25 pm

    how would an expression even be able to tell in which comp it resides, since it is actually in 2 at the same time?

    It is not in 2 at the same time.

    Method 1: There is only one copy of the precomp and the expression will check where it resides from the list of comps you give it to check against.
    Method 2: Making a duplicate, like you said, that references the same composition just twice. That way you don’t need to check where the precomp resides. But with this method you can’t change the checkboxes from the duplicate on the main comp, but rather from the main copy in the P-C precomp. Being able to control the checkboxes from the main comp would be more convenient, for that method 1 is better.

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