MaxScript to batch render with automatic texture changes

Hi!

I have a scene with a single cube, and I need to render (and save) pictures of this scene hundreds of times, each with a different texture (diffuse bitmap) on the cube. The bitmap textures are numbered from 001.bmp to 699.bmp

So basically I need a script to automatically change the diffuse bitmap texture of a single material (Material 01), then render the scene to an image file, and repeat for all the textures.

Is it possible to write such a script? If yes, would anybody be kind enough to write it, or at least point me to a resource that might help?

Thanks in advance :)

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kishore25kumar's picture

How can I apply it to multiple objects

Hi, your solution works for single object, but I wanted to apply the same texture to multiple objects in the scene

miauu's picture

.

Replace this lines:

on btn_render pressed do
		(
			local curObj = selection[1]

with this:

on btn_render pressed do
		(
			local curObj = selection as array
kishore25kumar's picture

How to add bump maps to it

After some struggle I figured it out that I have to do the way you specified it. How do I add bump maps path also to it.

thanks for your time

miauu's picture

.

replace this:

curObj.material = standardMaterial  diffuseMap: (Bitmaptexture fileName:matFiles[m]) showInViewport:true

with this:

curObj.material = standardMaterial  diffuseMap:(Bitmaptexture fileName:matFiles[m]) bumpMap:(Bitmaptexture fileName:matFiles[m]) showInViewport:true
nvidia2014's picture

miauu

hello sir ,

Can u makes this script working with 2 objects and separate texture folders for 2 objects ...

thanks ...

cool:)

miauu's picture

Hi, Branko! Regards from BG

Hi, Branko!
Regards from BG :)

barigazy's picture

hi Kostadin. In the same time

hi Kostadin.
In the same time we are post comment :)
Regards!

barigazy

barigazy's picture
worwhite's picture

Looks useful

That looks useful. I'm not sure it does what I need in this case (anyway I already got what I needed), but it might come in really handy in future. Thanks!

Edit: Just something funny - I didn't add a subject for the comment at first, and it automatically took the first few words of the comment, which gave:

"That looks useful. I'm not"

LOL

tony07's picture

How did you slove it?

Hello, its been i while but im looking something similar to you, and i would like to know how you face it and the solution to it and if you might be able to share it with me? thanks

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.