Trying to create a material with a jpg sequence bitmap in diffuse

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Display Modes
  01 January 2009
Trying to create a material with a jpg sequence bitmap in diffuse

Hi all!

I'm writing a script and got stuck trying to create a material with an image sequence.

When I create one manually, when I select the JPG it gives me a checkbox to determine if it's going to be a sequence or not, and then the following pop-up asks me start and end frame information. However when it's done the only code it spits out is for assigning the bitmap, but it doesn't setup the sequence. If I run the script, it simply assigns it as a regular bitmap material and doesn't change when you change the frame.

 meditMaterials[1].diffuseMap = Bitmaptexture fileName:jpgPath

The first time I create an image sequence manually it creates an IFL file in the same folder. If I load that file with my script instead of the JPG, the sequence works and the material image changes with each frame. But I can't get an IFL until I create a sequence initially. So, I either need a way to create the IFL, or find a work-around to get the sequence to work through the script. Any ideas?

  01 January 2009
Definitly easier to create the .ifl file.
If you open an .ifl in note pad, you'll see it's just a list of files...

In MaxScript you can get all the files in a directory, open a file to write text and write the array of filenames, one at a time to the file and close...

 tnFiles= getfiles <your directory>
 FileStrm = createfile <filename.ifl>
 for F in tnFiles do
 	format "%\n" F to:FileStrm
 close FileStrm

something like this...

Then assign the filename in the bitmap to the ifl and it "should" work...

good luck
Keith R Morrison

XP Pro x64, Win 7 - Max 2009, Max 2013 - Vray 2.30.01 - Backburner (uhg)
  01 January 2009
make sure you call sort() on tnFiles, just so the files are in the correct order (presuming they're zero-padded), as sometimes files get collected out of order when using getFiles()
  01 January 2009
Great, that worked, thanks a lot guys.

Would anyone mind helping me format the path into just the directory?

I'm getting "C:\path\file_0000.jpg" from my input, and when I run getFiles it's only giving me that one, so I assume I have to change this into just the containing directory in order to get the full list of files. Not sure how to do that though..

edit: getFilenamePath, figured it out, thanks!

Last edited by JayG : 01 January 2009 at 07:27 PM.
  01 January 2009
You can also use wildcards.

GetFiles = "C:\test\*.png"
Maxscript Made Easy...
  01 January 2009
Cool, good to know! This ended up working out perfectly. Thanks again for the help.
  01 January 2009
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 06:57 PM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.