Jump to: Board index » General » Fusion

Iterate over all files within a folder

Learn about 3D compositing, animation, broadcast design and VFX workflows.
  • Author
  • Message
Offline

Marc Schmitt

  • Posts: 4
  • Joined: Thu Jan 08, 2015 11:03 am

Iterate over all files within a folder

PostThu Jan 08, 2015 11:25 am

Hi there,

since the loader's file list feature isn't available anymore, what is a (conveniant) way to load all picture files in a folder (with different filenames - not a sequence), process them and save them out with a new filename (depended on the input filename)?

Any help would be greatly appreciated!

Cheers,
Marc
Offline

Sander de Regt

  • Posts: 4129
  • Joined: Thu Nov 13, 2014 10:09 pm

Re: Iterate over all files within a folder

PostThu Jan 08, 2015 8:02 pm

create an *.ifl and load that in the loader. Do the same with the saver only in a different directory.
Sander de Regt

ShadowMaker SdR
The Netherlands
Offline

Marc Schmitt

  • Posts: 4
  • Joined: Thu Jan 08, 2015 11:03 am

Re: Iterate over all files within a folder

PostFri Jan 09, 2015 12:38 pm

Great! Thanks!

I am trying to set up a workflow for inexperienced users for a very specific task. So, do you have a recommendation for a conveniant/easy/free(?) tool that can generate *.ifl? Maybe this is already possible via command line in windows?
Offline

Jiri Sindelar

  • Posts: 28
  • Joined: Mon Nov 10, 2014 9:53 pm

Re: Iterate over all files within a folder

PostFri Jan 09, 2015 5:31 pm

Hi,
as Sander said, make a list of files. One way to do it is to run command line (cmd.exe), change to drive and path needed and make a list; for example:
Code: Select all
e:
cd e:\temp
dir /b *.jpg > filelist.ifl

to make a list of all jpeg files in e:\temp\

hth
Jirka
Offline

Jiri Sindelar

  • Posts: 28
  • Joined: Mon Nov 10, 2014 9:53 pm

Re: Iterate over all files within a folder

PostFri Jan 09, 2015 5:38 pm

or make a batch file like this:
Code: Select all
cd %1
dir /b *.jpg > mylist.ifl


now you can drag a folder to that batch to create ifl
Offline
User avatar

Blazej Floch

  • Posts: 194
  • Joined: Tue Nov 11, 2014 12:48 am
  • Location: Toronto, ON

Re: Iterate over all files within a folder

PostTue Jan 13, 2015 12:27 am

Nice.
Here a suggestion (untested):

Code: Select all
@echo off
pushd %1

dir /on /b *.jpg *.png *.tga > %1.ifl || pause

popd

1. @echo off - only output sdtout/stderr
2. pushd - better of using this as it basically is a cd /d and makes no assuptions about the current directory.
3. You should be able to use mutiple extension if needed. This probably needs /on for proper sorting.
4. filename is folder name with ifl extension.
5. PAUSE screen in case of trouble.
6. pushd / popd - always go back to the original folder at the end - in case you call from a different batch file for example.
Offline
User avatar

Eric Westphal

  • Posts: 215
  • Joined: Thu Nov 20, 2014 1:59 pm

Re: Iterate over all files within a folder

PostWed Jan 14, 2015 8:22 am

Here's a Tool-Script I came up with some time ago.

Create a new file (say..."MakeIFL.eyeonscript") in [Fusion]\Scripts\Tool\ and paste the code.

Now drag any image-file from your directory onto Fusion's flow.
This will create a Loader, most likely loading only one single file.
(You can hold SHIFT while dragging the file in, to force Fusion to load just that file)

Then RMB on the Loader and select "Script->MakeIFL".

Code: Select all
-- create an IFL from a Loader's Clip, using all files in the directory
-- Must be run on a valid loader

myCompName = comp:GetAttrs().COMPS_FileName

myClip = tool.Clip[1]
myPath = eyeon.parseFilename(myClip).Path
myExt = eyeon.parseFilename(myClip).Extension
myName = eyeon.parseFilename(myClip).Name

print("----")

print(myPath)
print(myExt)
print(myCPath)

-- check if 'comp:' is used
if myCompName ~= "" then
   myCPath = eyeon.parseFilename(myCompName).Path   
   myPath = string.gsub(myPath, [[Comp:\]], myCPath)
end


myIFL = myPath..myName..[[_List.ifl]]

myCommand = [[dir ]]..myPath..[[*]]..myExt..[[ /b >]]..myIFL
print("Executing: "..myCommand)

os.execute(myCommand)

tool.Clip[1] = myIFL


Cheers.

Eric.
my hovercraft is full of eels.

Return to Fusion

Who is online

Users browsing this forum: No registered users and 29 guests