Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions After Effects Scripting/ How to crate a new comp with a comp in it

  • David Conklin

    August 29, 2016 at 7:36 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

  • Karen Harutyunyan

    August 30, 2016 at 12:12 pm

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

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy