Activity › Forums › Adobe After Effects Expressions › How do you see expressions different from scripts?
-
How do you see expressions different from scripts?
Posted by Syed Iqbal on December 17, 2005 at 7:29 amSo I am trying to understand the basic difference between expressions and scripts that you use by selecting “Run Script: from the file menu.
What I understand so far is that Expression is something that you can evaluate only by moving/playing back the timeline/time pointer. Whereas script is something that you use as soon as you open or create a project without having to hit the ram preview button for that matter.
Mylenium replied 20 years, 8 months ago 2 Members · 3 Replies -
3 Replies
-
Mylenium
December 17, 2005 at 10:12 am[TweenGuy] “So I am trying to understand the basic difference between expressions and scripts that you use by selecting “Run Script: from the file menu.
What I understand so far is that Expression is something that you can evaluate only by moving/playing back the timeline/time pointer. Whereas script is something that you use as soon as you open or create a project without having to hit the ram preview button for that matter.”
Apart from some variations in the syntax, there are a few things that differentiate scripts from expressions.
a) Expressions largely run in the local context of the parameter. This has an impact on their functionality in the way that their are no global variables and everything happening outside a parameter has to be explicitely referenced.
b) Scripts have accesss to several functions that are unavailable as expressions. You can create things suchg as projects, layers, compositions etc. and reference external data which expressions can’t.
c) Scripts are not really aware of the concept of “time”. You have all logic that potentially could drive things based on time to code yourself in a way whereas referencing time in expressions would automatically drive things without needing to have other trigger events. This is especially useful for loops or incrementing/ decrementing values in formulas. You are however wrong in assuming that expressions are dependent on time. They will always evaluate as soon as they are applied to the layer. There are lots of expressions that do not even bother to reference time and only calculate positions or strings for text layers based on other criteria.
d) Scripts aren’t interactive. They are mere “creation expressions”.
Mylenium
[Pour Myl
-
Syed Iqbal
December 17, 2005 at 11:48 amThanks a lot my friend. It has answered all and even something more that I did n’t ask.
Just need your confirmation, on point B) of your reply. Is it possible to create a layer, making it as 3d type, and then re-position a lot of layers in depth, all of this using the script? Any brief example of this.
I personnaly do VBA scripting to customize tasks in Excel but this AE scripting which resembles with Java scripting is actually very new to me and it will take time to have a good grasp of it.
-
Mylenium
December 17, 2005 at 11:58 am[TweenGuy] ”
Just need your confirmation, on point B) of your reply. Is it possible to create a layer, making it as 3d type, and then re-position a lot of layers in depth, all of this using the script? Any brief example of this.”Yepp, you could. Check out the ShapeTimeInsanity script, it contains enough info for this. Also check AEnhancers.com for more inspiration. Another way would be to approach this with a simple expression and then clone the layer a bunch of times.
Mylenium
[Pour Myl
Reply to this Discussion! Login or Sign Up