Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions duplicate a comp that contains two text layers and have the text layers number up in name

  • duplicate a comp that contains two text layers and have the text layers number up in name

    Posted by Nate Mulliken on April 2, 2014 at 5:47 am

    I have a comp called Name01.
    Inside this comp there are two layers. Text1 and Text2.

    I would like to duplicate Name01 comp to change to Name02 (done automatically) but have the containing text layers number up.
    So inside the Name02 comp there would be are two new layers. Text3 and Text4.

    and so on for hundreds of comps.

    Thank you to anyone who may know, I feel like it should be so simple.
    -Nate

    Nate Mulliken replied 12 years, 1 month ago 2 Members · 3 Replies
  • 3 Replies
  • Nate Mulliken

    April 2, 2014 at 11:20 am

    I may change my approach to use:

    var comp1 = [“text1”, “text2”];
    var comp2 = [“text3”, “text4”];
    var comp3 = [“text5”, “text6”];

    this way it’s doing what I need when I duplicate the comps, but I’ll have to figure out how to re-configure my excel data.

    Still interested in original solve if possible.

  • Jason Jantzen

    April 2, 2014 at 5:43 pm

    You could precomp the text layers and then try a script like True Comp Duplicator. The script only increments comps, so you’d have to precomp your text if you want incremented text layers. That doesn’t seem to solve the problem of accessing the text data on the new layers in the new comps. Maybe contact the author of the script and see if he can’t tweak it to address your problem.

    https://aescripts.com/true-comp-duplicator/

    Jason Jantzen
    vimeo.com/jasonj

  • Nate Mulliken

    April 2, 2014 at 6:17 pm

    Thanks Jason, I did try that earlier but although it’s great for keeping layers and expressions in order it does not suit my needs. What I did was call an external .txt file with this inside:

    var comp1 = [“text1”, “text2”];
    var comp2 = [“text3”, “text4”];
    var comp3 = [“text5”, “text6”];

    and so on.

    on each text layer there is this expression:

    //For text1 this is on the source

    try {
    $.evalFile(comp(“Globals”).layer
    (“fileToLoad”).text.sourceText);
    eval(thisComp.name)[0];
    }
    catch(err){err.toString()};

    //For text2 this is on the source

    try {
    $.evalFile(comp(“Globals”).layer
    (“fileToLoad”).text.sourceText);
    eval(thisComp.name)[1];
    }
    catch(err){err.toString()};

    In the Globals comp there is the instructions to call up the array.

    Windows Path:ile://c:\\\\Expressions\\
    Data File: arrayList.txt

    This way every time I duplicated the first comp i set up with the two text layers and the first comp, it would duplicate and auto populate the next comp with the new set of text.
    Getting the excel spreadsheet to cooperate was a whole other issue which is why I was looking for my initial solve. BUt I reformatted the info fairly easily through the help of friends to get it to work within the syntax of the program.

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