Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

scripted IFL file

scripted IFL file

Anonymous
Not applicable
809 Views
8 Replies
Message 1 of 9

scripted IFL file

Anonymous
Not applicable
I'm having trouble using an image sequence of about 20000 tiff files as a bitmap. Max seems to be choking when creating the IFL file. It either returns to the Material Editor without the IFL, or just crashes. So I'm trying to script the IFL file.

 f = createfile "C:\\file.txt"
txt = ""
for i = 1 to 20000 do
(
txt = ("image_" + i as string + ".tif")
format txt to: f
format "\n" to: f
i += 1
)
close f


My problem is that I need five digits at the end of all file names. For example, image_00002.tif and image_00456.tif. How can I script this?

Thanks
Mark
0 Likes
810 Views
8 Replies
Replies (8)
Message 2 of 9

Steve_Curley
Mentor
Mentor
See this thread. For 5 digits you'll want "5.5d" instead of the "2.2d" in the FormattedPrint statement.

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes
Message 3 of 9

Anonymous
Not applicable
Wow. How did you work that on out from the Help file?

Works great. Thanks!
0 Likes
Message 4 of 9

Steve_Curley
Mentor
Mentor
With difficulty, as I recall. Back in 2008 sometime, according to what the search finds 😉

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes
Message 5 of 9

PiXeL_MoNKeY
Collaborator
Collaborator
It has also been posted numerous times, across numerous forums. I think that is where I first learned about formattedprint.

-Eric
0 Likes
Message 6 of 9

Anonymous
Not applicable
maybe too late but here is some tips to create .ifl for existing files.

1. via MaxScript:
dir = GetDir #renderoutput + "\\mySubDir"
files = getFiles (dir + "\\*.tiff")
theIFL = createFile (dir + "\\myList.ifl")
for f in files do format "%\n" (filenameFromPath f) to:theIFL
close theIFL

2. or with dos command:
dir *.tiff /b > FileList.ifl

- save above line to text file with extension .bat (e.g. "CreateIFL.bat")
- move the file to your img's folder and just run it.
0 Likes
Message 7 of 9

Anonymous
Not applicable
Never too late. That's very useful.
Thank you!
0 Likes
Message 8 of 9

Anonymous
Not applicable
That's very nice, but is there a way of doing it so that it doesn't run through all the images in a folder, just the ones with the same name, and a different number.
e.g. if you have file01.png and file02.png and tree01.png in the same folder, can you put only the ones with the same name into an ifl using maxscript?
Thanks a lot
0 Likes
Message 9 of 9

Steve_Curley
Mentor
Mentor
Either change the line to include the filename (without the trailing numerics), or use the method linked to earlier in the thread.
files = getFiles (dir + "\\SomeFileNameHere*.tiff")

or the other option mentioned above
 dir SomeFileNameHere*.tiff /b > FileList.ifl

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes