• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Add a duplicated comp to the render cue.

Community Expert ,
Nov 26, 2011 Nov 26, 2011

Copy link to clipboard

Copied

I've created a script that replaces text in multiplt text layers from a csv text file, creates a new comp from each row in the text file, names the comp from the last field in the row.

At the end of the loop I'd like to add the comp to the render cue. Can't figure out how to get that started. Whatever I put in stops the script and I only end up with one new comp from the text file.

Here's the lines of code that duplicate the comp.

for(x=1; x < elementLength; x++){

     //dupe the comp of interest

       var compElement = selectedItemInfo.source.duplicate();

          var compElementName = '';

Then there are a few lines that generate a name for the comp based on the last field in the csv text file.

Should I be putting  my add to render cue script right after the cupe comp section or should it be after the name is added.

Here's the end of create comp name code.

for(i=1; i <= layers.length; i++){

          for(j=0; j < matchingLayers.length; j++){

 

 

           if(layers.name == matchingLayers.name){

           compElement.layers.sourceText.setValue(data);

           }

                    //add comp to render cue

Any pointers would be appreciated. This scripting thing is not part of my usual workflow.

TOPICS
Scripting

Views

818

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Advocate , Nov 27, 2011 Nov 27, 2011

Adding a single comp to the Render Queue is done...

app.project.renderQueue.items.add(myComp);

For multiple comps, place it in a loop.

for(i=0; i<myComps.length; i++){

     app.project.renderQueue.items.add(myComps);

}

It looks like your loop may work this way if you are processing each completely before moving on to the next one.

for(i=1; i <= layers.length; i++){
          for(j=0; j < matchingLayers.length; j++){
 
 
           if(layers.name == matchingLayers.name){
           compElement.layers.sourc

...

Votes

Translate

Translate
Advocate ,
Nov 27, 2011 Nov 27, 2011

Copy link to clipboard

Copied

Adding a single comp to the Render Queue is done...

app.project.renderQueue.items.add(myComp);

For multiple comps, place it in a loop.

for(i=0; i<myComps.length; i++){

     app.project.renderQueue.items.add(myComps);

}

It looks like your loop may work this way if you are processing each completely before moving on to the next one.

for(i=1; i <= layers.length; i++){
          for(j=0; j < matchingLayers.length; j++){
 
 
           if(layers.name == matchingLayers.name){
           compElement.layers.sourceText.setValue(data);
           }
                    //add comp to render cue

                                        app.project.renderQueue.items.add(compElement);


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 27, 2011 Nov 27, 2011

Copy link to clipboard

Copied

LATEST

Thanks very much. I kind of had that, but there were typo's and it was in the wrong place in the brackets.

Rick

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines