• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

[Expressions] How to refer to a comp one level above.

Participant ,
Aug 04, 2024 Aug 04, 2024

Copy link to clipboard

Copied

Can I reference a composition one level up in Expression?
Main > Level 1 > Level 2.
Is there a way to access a "Level 1" composition from a "Level 2" layer in a flowchart like this?
I would like to specify a composition as "one above" instead of specifying it by name.

TOPICS
Expressions , How to

Views

187

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Participant , Dec 03, 2024 Dec 03, 2024

Essential Properties (Essential Graphics) did what I wanted to do.
What I wanted to do by referencing the hierarchy above Comp was to switch what was displayed in Comp.
This was accomplished by adding arbitrary Expression controls to the Essential Properties and applying the appropriate Expression to the layer I wanted to switch the display to.
Since the Essential Properties can be set for each placed layer, this demand was met perfectly.

Votes

Translate

Translate
Community Expert ,
Aug 04, 2024 Aug 04, 2024

Copy link to clipboard

Copied

There's no mechanism to reference another comp, other than by name.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 03, 2024 Dec 03, 2024

Copy link to clipboard

Copied

I need this too. Would be nice. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 03, 2024 Dec 03, 2024

Copy link to clipboard

Copied

The problem, of course, is that a comp can be nested inside any number of other comps. So what would be the expected result for "parentComp" when that could be anywhere from zero to "n" other comps?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 03, 2024 Dec 03, 2024

Copy link to clipboard

Copied

Essential Properties (Essential Graphics) did what I wanted to do.
What I wanted to do by referencing the hierarchy above Comp was to switch what was displayed in Comp.
This was accomplished by adding arbitrary Expression controls to the Essential Properties and applying the appropriate Expression to the layer I wanted to switch the display to.
Since the Essential Properties can be set for each placed layer, this demand was met perfectly.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 03, 2024 Dec 03, 2024

Copy link to clipboard

Copied

LATEST

An example of doing that:
Add a Dropdown menu control to the Null layer and add the option to toggle the display to the menu.
Add like the following expression to the Opacity of the layer you want to switch the visibility of.

let f = thisComp.layer("Null").effect("Dropdown menu control")(Menu);
// This number ties the choice to the layer.
// Change it appropriately.
let n = 1;
f == n ? 100 : 0;

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines