Replacing PSD files to PSD Layered Comps?


so 1 way of doing it:

function replacepsds () {          app.beginundogroup("psds layered comps");                  var selectionarray = app.project.selection;         var curarrayitem;          (var j = 0; j < selectionarray.length; j++) {                 curarrayitem = selectionarray[j].name;                 (var i=1; <=app.project.items.length; i++) {                     if (app.project.item(i) instanceof footageitem) {                         if (app.project.item(i).name == curarrayitem) {                             app.executecommand(2004);   // deselect                             app.project.item(i).selected = true;                             app.executecommand(2237);   // replace footage                             app.executecommand(3070);   // layered comp                             }                         }                 }         }         app.endundogroup(); }  if (app.project.selection.length < 1) {     alert("please select psds", "error", true);     }else{         replacepsds ();         } 
the question is, there faster way?

i work ton of psd files per project (traditional 2d hand drawn animation), , i'm looking way optimize this. biggest "problem" think, in for loop (or getting item's index number). imagine having 200+ items in project , waiting for loops cycle each time. plus it's growing each import. tried using do{ }while() loops instead, nothing faster. think i'm slowing things down because of app.executecommand lines (like javascript has access every time ae's graphical ui - i'm not sure true).

 

there app.project.item(index).replace(file) method, wants file work with, can't import psd layered comp , replace original file, because import composition now...

paul tuersley posted something that, method relays on that, psd belongs composition, since using avlayer replacesource() method.

 

any idea welcome. sdk maybe have more options? (i never worked in that)

thanks



More discussions in After Effects Scripting


adobe

Comments

Popular posts from this blog

Some mp4 files not displaying correctly (CS6)

Thread: Samba is not authenticating with LDAP