FORUMS: list search recent posts

After Effects Scripting/ How to crate a new comp with a comp in it

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Karen Harutyunyan
After Effects Scripting/ How to crate a new comp with a comp in it
on Aug 29, 2016 at 7:15:17 pm

Hi!! I'm very new at scripting. Want to know how to write a code that creates a comp with a comp in it !!!


Return to posts index

David Conklin
Re: After Effects Scripting/ How to crate a new comp with a comp in it
on Aug 29, 2016 at 7:36:48 pm

Here's the most bare bone code. You could (should), of course, do things like checking that the project exists before making comps inside of it, as well as move a lot of the composition properites (size, name, etc) into variables. Hopefully this is enough to get you going.


(function nestedComp(){

var proj = app.project;

// make a new comp and save it in a variable.
// the arguments to 'addComp()' are name, width, height, par, dur, frame rate.
var preComp = proj.items.addComp("Precomp", 1920, 1080, 1, 1, 30);

// make the main comp.
var mainComp = proj.items.addComp("Main Comp", 1920, 1080, 1, 1, 30);

// add pre-comp to main comp.
mainComp.layers.add(preComp);

})();


David Conklin
mographcode.tumblr.com


Return to posts index

Karen Harutyunyan
Re: After Effects Scripting/ How to crate a new comp with a comp in it
on Aug 30, 2016 at 12:12:55 pm

Thank you very much !!! this was exactly what I was looking for !!!


Return to posts index

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