Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions relative reference of nodes or objects

  • relative reference of nodes or objects

    Posted by Christian Kim on September 29, 2010 at 4:29 am

    Good afternoon community!

    i was wondering if after effects expression supports relative referencing of nodes or objects.

    I will eleborate the question with simple usage / explanation.

    1. say i have a composition, called [TEXT]. inside the comp, i have a text object, with arial font, size 20, blue.

    2. using expressions, i can change the string value inside the text object to display what i want. i could pickwhip value in other objects to get the text object to display them.

    3. say i have a composition called [LOTS OF TEXT], inside i have 3 copies of [TEXT] composition.

    4. what i am hoping is possible, is to add markers on each [TEXT] composition, and label them RED, BLUE, GREEN. and have the text object inside the [TEXT] composition to be able to read the marker label and display them as text.

    5. i thougth easiest way to achieve this was to get the text object inside [TEXT] compostion to be able to relatively reference itself. thus it can read read 3 difference marker values per instance.

    so i am hoping, in [LOTS OF TEXT], i will have 3 [TEXT] composition displaying RED, BLUE, GREEN. however, since they are all same instances, if i were to change the font size of the textobject inside [TEXT] composition, all 3 will reflect those changes.

    i am thinking if i could write expression that can “relatively” reference itself.

    along the line of [root.thisComp] where previous line could mean the instance itself everytime its created?

    i might of lost few of readers with perhaps complicated example, but i really do hope some users have the patience to read through the example and could let me know if it is even possible.

    thank you so much in advance! any comments, suggestions, tips are welcomed!

    Christian Kim replied 15 years, 7 months ago 2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    September 29, 2010 at 1:05 pm

    Sorry, there’s no way to do that. An expression can only reference another comp by name. A precomp can have any number of parent comps, but it has to render the same in all of them. You’d have to have unique copies of the precomp (in the project panel), each referencing a different comp by name.

    Dan

  • Christian Kim

    September 29, 2010 at 8:42 pm

    Thank you very much for your response Dan.

    I figured this was the case, but just wanted to make sure i hear from the “cows mouth” (pun intended).

    if i may ask you, or who ever reading for some suggestions then.

    are there really no way of making somewhat of “smart comp” where i can have the look and feel set up in the “smart comp”, however the single instance can be modified by expression or use of XML.

    example of usage could be that i have an animation with 100000 text flying around. however, i wanted to make sure that when the client asks for the font to change, i won’t have to literally manually edit 100000 “precomps” to change the font. i was hoping there was a way of making a “smart comp”, where i could just swop out the [text string] in and out using expression or XML sheets etc etc.

    i am guessing no, as it seems in after effects, [comps] are literally handled as “baked” instances?

    thank you Dan and the community in advance for any help : )

  • Dan Ebberts

    September 29, 2010 at 9:20 pm

    You’re right about the baked part.

    You’re not going to be able to change font attributes with an expression anyway. You could have a master template comp though, make your changes there, then create a script that will go through and make all the copies match the master. It would be kind of a pain though and it wouldn’t be a live connection.

    Dan

  • Christian Kim

    September 29, 2010 at 9:32 pm

    i see, thank you for your confirmation Dan.

    i was very impressed with the expressions, and guess i was asking for too much. on one hand i understand why it can’t be done, though on the other, i don’t think it will be technically impossible (as other script languages support relative referencing, even flash actions script can also if i remember correctly, though action script is in a different league from expressions)

    thank you for your input Dan!

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