SmartImport - add to comp layers


is possible modify smartimport script in after effects place processed results directly comp? basically, automate grabbing bunch of image sequences , having seqeunces dropped specific comp. 

 

i thought add reference files being found in smartimport function... i'm not sure what/how smartimport variable being used?  appreciated. 

 

//mastercomp variables

var compwidth = 1920;   

var compheight = 1080;   

var comppar = 1;   

var compdur = 60;

var compfps = 24;

 

//create master comp

var mastercomp = app.project.items.addcomp("master", compwidth , compheight, comppar, compdur, compfps);

 

//place smartimport results mastercomp

mastercomp.layers.add(smartimportresults);

if can assume footage items in project bin ones imported smartimport, after create comp:

 

for (var = 1; <= app.project.numitems; i++){

  if (app.project.item(i) instanceof footageitem){

    mastercomp.layers.add(app.project.item(i),mastercomp.duration);

  }

}

 

otherwise you'll need modify smartimport save results goes along. i'd create global array in script

 

var myfootageitems = [];

 

and modify importsafewitherror() function push results array:

 

function importsafewitherror(importoptions)

{

  try {

    var myfootage = app.project.importfile(importoptions);

    myfootageitems.push(myfootage);

  } catch (error) {

    alert(error.tostring() + importoptions.file.fsname, scriptname);

  }

}

 

 

then in code, go through array , add layers:

 

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

  mastercomp.layers.add(myfootageitems[i],mastercomp.duration);

}

 

 

 

i haven't tested code, may not perfect, should close.

 

dan



More discussions in After Effects Scripting


adobe

Comments

Popular posts from this blog

Thread: Firefox print dialog doesn't remember settings

Error 400 - Photoshop services are not available

After Effects error:creating resource file on Windows