FORUMS: list search recent posts

Change comp duration

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Stanislaff Fabiyanskiy
Change comp duration
on Aug 10, 2011 at 4:45:39 pm

How i can change composition duration with a script?

like this
var change = app.project.activeitem.duration
make change + 500 frames

thanks


Return to posts index

Dan Ebberts
Re: Change comp duration
on Aug 10, 2011 at 5:46:48 pm

I'm not at a compute with AE installed right now, but this should work:

var myComp = app.project.activeItem;
myComp.duration += 500*myComp.frameDuration;

Dan



Return to posts index

Stanislaff Fabiyanskiy
Re: Change comp duration
on Aug 11, 2011 at 1:36:05 pm

thanks thanks thanks!


Return to posts index


luis palencia
Re: Change comp duration
on Sep 13, 2017 at 1:40:40 pm

Where do you write this expression? in a layer? can you send a screenshot plis? thank you very much!


Return to posts index

Dan Ebberts
Re: Change comp duration
on Sep 13, 2017 at 5:10:00 pm

It's not an expression, it's a script. So you would run it either in the ExtendScript editor, or as a stand-alone .jsx file using AE's File>Scritps>Run Script File... menu item.

Dan



Return to posts index

luis palencia
Re: Change comp duration
on Sep 13, 2017 at 6:51:52 pm

Oh thank you very much.

Is there any expression that allows adjust the duration of a composition?

What I want to do is change the duration of many composition, each composition has a layer text, I want to change the duration of composition as long as the length of the text.

For example:

Composition1
Text: "Hello, Word"
Duration of Composition1 = 5 seconds (for example)

Composition2
Text: "Hello, Word. The sky is blue and the children play in the park"
Duration of Composition2 = 15 seconds (for example)

I want to calculate the length of the text with "text.sourcetext.length" and that multiplicate for 1 second and the result apply to the duration of that composition.

Can you help me t_t ???


Return to posts index


Dan Ebberts
Re: Change comp duration
on Sep 13, 2017 at 6:59:52 pm

An expression can't do that. You could do it with a script, but you'd have to run the script each time you wanted to update the comp durations.

Dan



Return to posts index

luis palencia
Re: Change comp duration
on Sep 13, 2017 at 8:02:55 pm

And an expression to modify the duration of a text layer?


Return to posts index

Dan Ebberts
Re: Change comp duration
on Sep 13, 2017 at 8:09:48 pm

Expressions can't modify the duration of anything. The best you could do is an expression to control the opacity. Otherwise, it would have to be a script.

Dan



Return to posts index

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