Skip to main content
CLWill
Inspiring
September 16, 2021
Question

Accessing the essentialProperty() function for a Comp

  • September 16, 2021
  • 1 reply
  • 1433 views

I'm having fun with the Essential Graphics panel, and the ability to create reusable components. Coupled with power in expressions, this stuff is amazing.

 

I've run into an issue, though. With the Essential Graphics panel you create "Essential Properties" for a comp. You can reference these with the powerful .essentialProperty() function. Great!

 

The problem becomes that you can only use .essentialProperty() on a layer, not on a comp. But the Essential Properties are a feature of a comp, not a layer. So now I have to somehow reference the parent where the comp is used, then the layer that is the comp I'm in, then the properties. So you end up with:

 

    comp("parentComp").layer(thisComp.name).essentialProperty("whatever");

 

But... there is no parentComp() function. So at run time who knows what the containing Comp is called? And any attempt to reference the .essentialProperty() function on a Comp fails, such as thisComp.essentialProperty() or comp("whatever").essentialProperty(). It has to be a layer, for some reason. Even though essential properties are an element of the comp.

 

Does anyone know a workaround for this? This seems like a huge oversight in the creation of Essential Properties.

This topic has been closed for replies.

1 reply

Mylenium
Legend
September 17, 2021

You have a misunderstanding. Why should/ could there even be such a thing as parentComp(), given that any comp can be used a million times as a sub-comp across different comps and different nesting levels?! See the problem? This would simply cause a logic paradox and that pretty much is a clear reason why there can never be such a function unless they completely change that stuff and e.g. expose the internal IDs/ magic numbers AE uses to check dependencies. So no, there is no way to do any of that, at least at the moment.

 

Mylenium

CLWill
CLWillAuthor
Inspiring
September 17, 2021

Also, I note you've made this very comment a number of times, going back several years.

 

Virtually every object oriented piece of software faces this same issue: class vs an instance of a class. They all have functional capability to resolve this, class code that has the capability to refer to either all instances, or this specific instance of the class. This is not a new problem, either for software or for AE.

ShiveringCactus
Community Expert
Community Expert
September 18, 2021

Using a Null Object, you could "store" the properties of a comp for use with Essential Graphics, but all that would do is report them to the essential properties.  You wouldn't be able to alter them.  However, if you were to take your Comp and place it into another comp and use that second comp with Essential Graphics, then all the first comp's properties might be open to you.  I say might as I'm not sure what you'd hoping to adapt.  And with the method I describe, you'll be doing a lot of pickwhiping of properties so that the second comp can update the layers but that would get you the end result (I think), even if it feels convoluted.