ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

extendscript to pre-compose selected layers, moving all attributes and adjust composition to the time span of the selected layers

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Chris Orcfilm
extendscript to pre-compose selected layers, moving all attributes and adjust composition to the time span of the selected layers
on Sep 17, 2019 at 3:59:22 am

So, I'm surprised I can't find this on the web, but I'm trying to write a script to essentially precompose selected layers like you would manually by Ctrl/cmd+Shift+C, selecting to move all attributes and adjust the composition to the time span of the selected layers.

I've found a great case study tweaked by Dan Ebberts from an idea by Brian Maffitt and coded by Keiko Yamada here:
https://www.motionscript.com/ae-scripting/pre-comp-to-layer-dur.html

But alas, it doesn't seem to behave like the manual steps in AE.

It takes layer(s), Pre-composes them and sets the in/out point of the layer in the original comp, but does not trim the content of the resulting comp to the in/out points of the layer(s). Instead it retains the full length of the parent comp unlike when you Ctrl/cmd+Shift+C, selecting to move all attributes and adjust the composition to the time span of the selected layers.

What would be the best way to go into the resulting pre-comp, and making the work area (trimmed) to the in and out points of the layers so it behaves more like the manual process?

New to extendscript so please forgive me if I'm overlooking the obvious.

BC Canada


Return to posts index

Tomas Bumbulevičius
Re: extendscript to pre-compose selected layers, moving all attributes and adjust composition to the time span of the selected layers
on Sep 22, 2019 at 10:08:18 am

Hey Chris, I just checked that script, and my questions are, assuming that pre-comp is built, and is auto-added in the main comp, and with these sample conditions:

Main comp length: - 60s long;
1st layer in point - starts at 10s;
xth layer out point - ends and 40s;

Now when script executed:

1. Would you prefer that 'pre-comp' actually would have its start point at the area where current in point belongs? Because now, pre-comp turns out to be the same length as main comp, but in/out points are trimmed to 1st and xth layers times.
2. Accordingly, in this sample above, pre-comp shall turn out to be 30s long instead, or not necessarily this way?

From what I see, and how I like things to be pre-composed, is that every pre-comps starting layer, would begin at 0s, instead of matching main-comp length. Is this is the same behaviour you are after?

Find out more:
After Effects Tutorials: motion design, expressions, scripting.
Boxer - Dynamic Text Boxes Template with a Live Preview


Return to posts index

Chris Orcfilm
Re: extendscript to pre-compose selected layers, moving all attributes and adjust composition to the time span of the selected layers
on Sep 22, 2019 at 11:28:31 pm

Thanks Tomas, yes, I wanted the generated precomp to be trimmed to the length of the layer(s) chosen, much like the behaviour if you Ctrl/cmd+Shift+C, selecting to "move all attributes..." AND select to "adjust the composition to the time span of the selected layers".

That said, in lieu of any feedback I managed to figure it out. There are still a couple of bugs, but I will post the solution here once it's cleaned up.

Cheers,

Chris

BC Canada


Return to posts index

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