ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Global Object usage ($.var), thoughts?

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Will Poillion
Global Object usage ($.var), thoughts?
on Sep 11, 2019 at 9:52:56 pm

Someone in another group posted this article to me today:
https://blob.pureandapplied.com.au/the-global-object-in-after-effects/

I'm intrigued as memory storage has historically been nonexistent in AE. This opens up a world of possibilities for storing reusable functions, global variables, etc. But the author mentions being wary of relying on it as access to it could go away in the future. Also the issue about not freeing up the memory when the variable is deleted can be an issue if you're not careful with how you use it.

I'd like to know what you guys think on the issue. I know Essential Graphics is supposed to be AE's solution to global variables, but that's not nearly as flexible as being able to store any javascript object for later retrieval.

Have you guys known about this in the past and decided not to use it? Or is this something new? What are your thoughts on using it to hold common variables you regularly use in new comps?


Return to posts index

Graham Quince
Re: Global Object usage ($.var), thoughts?
on Sep 15, 2019 at 11:16:00 am

This is new to me and it' a hard read. I must admit I turn to expressions to solve problems, rather than as an exercise in programing. As a result, I've only wished I had global variables on a couple of occassions and been able to circumvent that most of the time using the pickwhip or copying keyframes.

http://www.YouTube.com/ShiveringCactus - Free FX for amateur films
http://shiveringcactus.wordpress.com/ - FX blog


Return to posts index

Walter Soyka
Re: Global Object usage ($.var), thoughts?
on Sep 17, 2019 at 10:44:09 am

[Will Poillion] "What are your thoughts on using it to hold common variables you regularly use in new comps?"

I wouldn't recommend using the global object this way. If you want to stuff a value in there, the expression that creates the value has to be evaluated BEFORE any other frames that rely on it are, and there is no way to ensure that will be the case automatically.

I'd suggest instead creating a comp, null layer, and some expression control effects to hold your "global variables." You can ensure they evaluate simply by referring to them from elsewhere.

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]