ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Building Expressions Workflow: multiple layers referencing single code?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Brian Nishii
Building Expressions Workflow: multiple layers referencing single code?
on Apr 1, 2019 at 7:44:49 pm

Hello all you smart people!

Here's a workflow question:

I'm building a comp with a 100 layers that contains expressions on various parameters that uses layer index to drive stuff. So far so good and more to build. Great.

I love that you can use a text layer to debug your expression as you build them. Great.

When I build new code for any given parameter for each of those 100 layers, every time I make an adjustment, I have to delete all my layers, change the code for that parameter, and re-duplicate 99 times. Not the end of the world, I know, but it's kinda getting old...

Now I'm curious if there's a way to place expression code for a specific parameter somewhere that can act as a container that multiple layers can read from? That way, when I futz with the expression for that one parameter, all the layers could update automatically?

Call me lazy, but wouldn't it be nice?

Oh wait - I may just have answered my question. Using Layer Control somehow...


Return to posts index

Vera Steinbeck
Re: Building Expressions Workflow: multiple layers referencing single code?
on Apr 1, 2019 at 9:45:53 pm

hey brian
if you can't work with layer control, i tend to copy&paste every time as well..
if you ctrl-select all your propertys on your layer with expressions and then right click to them you can choose "copy only expressions" (may be named differently since my AE is in german).
then you ctrl-select every layer you want the expressions on and paste them..

you just have to write the expressions as open as possible, that you don't have to go inside each layer and correct numbers each time..


Return to posts index

Oleg Pirogov
Re: Building Expressions Workflow: multiple layers referencing single code?
on Apr 1, 2019 at 11:04:35 pm

You may also look into eval() function, which allows you to interpret a string (say, sourceText of a text layer) as a code, so you can keep your code in a text layer an use it for each of 100 layers.


Return to posts index


Brian Nishii
Re: Building Expressions Workflow: multiple layers referencing single code?
on Apr 2, 2019 at 4:18:25 am

Well, I'll be darned!!

eval() seems to work, if you reference a text layer's actual text field, and not the Source Text, per this post answer by Dan the Great here. Kinda wonky you have to deal with formatting to actually see the code, but I guess you can cut and paste from a text document as you work.

Of course, as Vera pointed out, copying just the expression of the parameter and pasting works easily enough without having to trash and re-duplicate all 100 layers.

Thank you all!


Return to posts index

Andrei Popa
Re: Building Expressions Workflow: multiple layers referencing single code?
on Apr 3, 2019 at 10:20:57 am

Eval thing goes even beyond. You can even use evalfile() to get an expression from a text layer. I don't use very complicated expressions, but for those who do, a nice text editor like Atom, Sublime etc. in which to write your expressions could be of use. Here's a link to an youtube tutorial about this thing





My point is, you can paste the eval expression to all the layers and then use the external file to modify it for all at once.

Andrei
My Envato portfolio.


Return to posts index

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