Activity › Forums › Adobe After Effects Expressions › After Effects Scripting/ How to crate a new comp with a comp in it
-
After Effects Scripting/ How to crate a new comp with a comp in it
Posted by Karen Harutyunyan on August 29, 2016 at 7:15 pmHi!! I’m very new at scripting. Want to know how to write a code that creates a comp with a comp in it !!!
Karen Harutyunyan replied 9 years, 8 months ago 2 Members · 2 Replies -
2 Replies
-
David Conklin
August 29, 2016 at 7:36 pmHere’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 -
Karen Harutyunyan
August 30, 2016 at 12:12 pmThank you very much !!! this was exactly what I was looking for !!!
Reply to this Discussion! Login or Sign Up