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.
1 Correct answer
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.
Copy link to clipboard
Copied
There's no mechanism to reference another comp, other than by name.
Copy link to clipboard
Copied
I need this too. Would be nice.
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?
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.
Copy link to clipboard
Copied
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;