Notifications
Clear all

[Closed] writing .BAT files for rendering

So… this forum is great I’ve learned a lot! And now I am going to try to learn some more!! So here’s what I need to do. I am going to write a BATCH file to render any scenes within a certain folder. The cool thing is, I am also going to call some scripts – and the rendering process is actually executed in the script so basically what I need to do is.

Load the scene from designated folder
run script on the scene
load next scene, repeat…until no more scenes

so here is some line of code I think that will get us started in the right direction. loadscene is the name of the folder I want to access, the —— is the files I want, or the 1st file in order to be rendered.
[b]
“c:\program files\autodesk\3dsmax9\3dsmaxcmd” -submit “c:\program files\autodesk\3dsmax9\scenes\loadscene——-.max”

[/b]-preRenderScript “ADD.ms” is used to call the script, ADD.ms, however, how does this find the script? ADD.ms handles the rendering, but how do we know when it is done rendering and to close the scene and load the next and continue? So maybe there is too much here for a simple BATCH file to handle.

Perhaps I should write a maxscript that loads scene from folder, applys scripts to them and then repeats until no more scenes…would this be easier? I have little experience with BATCH files, or cmd line rendering.

1 Reply

I’m not sure why you wouldn’t do this as a first resort;

dir = getSavePath caption:"Process Queue Directory"
 if dir == undefined do return false
 files = getFiles ((dir as string) + "\\*.MAX" )
 for f in files do
 (
   				
   	resetMaxFile #noPrompt
   	loadMaxFile f
   
   --put your script operations here, or any other max operations you want to perform on each scene
 
 completeRedraw()	
 savemaxfile f   
 
 )