FORUMS: list search recent posts

Adding folder items to a comp

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Michael Gaynor
Adding folder items to a comp
on Aug 13, 2015 at 9:27:38 pm

Hi,

I have a folder in my project with some footage imported by my script, and I would like to add that footage to a comp that has already been created called "myComp". Trying to loop through the folder items as an array and add them to the comp that way, but my code doesn't seem to be working. Can someone point out what I am doing wrong? Thanks in advance!!

var folderItems = targetFolder.getFiles();
for (var i = 0; i <folderItems.length; i++) {
myComp.layers.add(folderItems[i]);
}


Return to posts index

Dan Ebberts
Re: Adding folder items to a comp
on Aug 14, 2015 at 3:12:30 am

getFiles() works with disk-based folders, not project bin folders. I think you'll need to go through all the items, collecting any FootageItem where theItem.parentFolder.id == targetFolder.id .

There may be other ways to do it, but I think that's how I'd do it.

Dan



Return to posts index

Michael Gaynor
Re: Adding folder items to a comp
on Aug 14, 2015 at 11:01:16 pm

Awesome, I'll give that a shot.

Thanks Dan you're the man.

-Mike


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]