Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk 3ds® Max® / MaxScript / Batch Render
  RSS 2.0 ATOM  

Batch Render
Rate this thread
 
63585
 
Permlink of this thread  
avatar
  • Total Posts: 21
  • Joined: 28 March 2007 10:57 AM

i wanted to batch render a file running a maxscript

all i got is

actionMan.executeAction -43434444 “4096” —Render: Batch Render Dialog Toggle

Please could someone help



3dmaxdesign 2011 64-bit
i7 2600 windows 7 64-bit
quadro 600

Replies: 0
avatar
  • amarhys
  • Posted: 16 January 2012 08:14 PM

If you mean by “batch render” :

a) Launching Max without the GUI and providing-it a set of cameras to be rendered, I think you should use backburner (I don’t use it, so I guess other people could help you)

b) Write a set of MaxScript commands to launch the rendering of a scene which is loaded into 3DS Max GUI, you can use these commands :

r_bitmap bitmap <width> <heightfilename:img_out.tga gamma:(1.0/2.2)
 
render camera:<your camto:r_bitmap outputwidth:<widthoutputheight:<height\
frame
:<frmoutputfile:file_out.tga progressbar:true vfb:true

save r_bitmap

Just replace <width>, <height>, <your cam> and <frm> by your own pamameters.

Please note that the image displayed in the VFB is wrong (very dark) but it is correct in the saved image. I never found a way to fix that (due to gamma configuration).

Regards
amarhys



Max 2011, Win7-Pro 64.
NVidia GeForce GTX 460
Core i7 950 3.06Ghz, 24Gb Ram.

Replies: 1
/img/forum/dark/default_avatar.png

Thanks for the suggestion

Actually i have got a number of max files that i want to render....
i dont want to use backburner as all the systems on the network arent fast enough so
im going to use vrays distributed rendering

so the script should run on one instance of max as follows
1.  open the first file (from the given folder of max files) and run the batch render dialog which is already set.
2. open the 2nd file and do the same ............ and so on

Right now i have got a script that will open the max files and render the viewport camera and render as per the rendering dialogue settings… This works for all the files specified…

But i want it to work with the “batch render dialog” so i want the actionMan.actionexe for the batchRender dialogue

Author: hanselmoniz

Replied: 16 January 2012 08:48 PM  
avatar
  • Location: West Midlands, England, UK
  • Total Posts: 14445
  • Joined: 06 August 2007 11:06 PM
  • Permlink of this post

Batch Render is an option on the main Max Rendering menu. The “Interface: batchRenderMgr” topic in the help should provide sufficient information to get started.



Max 4.2 through 2013.
XP-64 (SP2)
NVidia 9800GTX-512 (Driver 266.58).
Core 2 Quad Q6600 2.4GHz, 8Gb Ram, DX9.0c.

Replies: 1
/img/forum/dark/default_avatar.png

--- thanks for this

----sorted it out

rollout myRoll "Render multiple files"
 
(
 
local number_of_files 0
 local ListOfMaxFiles 
#()
 
 
button btnBrowseFile "Browse for files" width370
 multilistbox mlbMaxFiles
 label lbNumberOfFiles 
" No files selected"
 
button btnRender "Render all files" width370 height:30
 
 on btnBrowseFile pressed 
do
 (
 
/* 
 --path = (getSavePath caption:"Select Save File directory")
 path = getMAXOpenFileName()
 if path != undefined then
 (
 append ListOfMaxFiles path
 mlbMaxFiles.items = ListOfMaxFiles
 number_of_files = mlbMaxFiles.items.count
 lbNumberOfFiles.text = number_of_files as string + " files selected"
 )*/
 
 
--NEW CODE
 
/*****************************************/
 
theDialog dotNetObject "System.Windows.Forms.OpenFileDialog" --create a OpenFileDialog 
 theDialog
.title "PLEASE Select One Or More Files" --set the title
 theDialog
.Multiselect true --allow multiple files to be selected
 theDialog
.Filter "MAX Files (*.max)|*.max|All Files (*.*)|*.*" --specify the filter
 theDialog
.FilterIndex --set the filter drop-down list to All Files
 result 
theDialog.showDialog() --display the dialogget result into variable
 result
.ToString() --when closedconvert the result to string
 result
.Equals result.OK --returns TRUE if OK was pressedFALSE otherwise
 result
.Equals result.Cancel --returns TRUE if Cancel was pressedFALSE otherwise
 join ListOfMaxFiles theDialog
.fileNames --the selected filenames will be returned as an array
 
mlbMaxFiles.items ListOfMaxFiles
 number_of_files 
mlbMaxFiles.items.count
 lbNumberOfFiles
.text number_of_files as string " files selected"
 
/*****************************************/
 
)
 
 
on btnRender pressed do
 (
 
starttime timeStamp()
 --NEW 
CODE
 
/*****************************************/
 
theTimer dotNetObject "System.Windows.Forms.Timer" --create a Timer
 fn printTime 
= (print localTime) --define a MAXScript function to be called by the Timer.
 
dotnet.addEventHandler theTimer "tick" printTime --add ON TICK event hander to call the function
 
theTimer.interval 1000 --set the tick interval to 1 second (1000 milliseconds)
 
theTimer.start() --start the Timer
 timerstringstart 
printTime() --NEW CODE
 
--theTimer.stop() --use this method to stop the Timer.
 
/*****************************************/
 
for 1 to (mlbMaxFiles.items.count) do
 (
 
loadMaxFile (mlbMaxFiles.items[i] as string) quiet:true
 batchRenderMgr
.Render()
 )
 
theTimer.stop()--NEW CODE
 printTime
() --NEW CODE
 timerstringend 
printTime() --NEW CODE
 total_time 
theTimer.interval as string
 endtime 
timeStamp()
 
tijdsinterval = ((endtime starttime) / 1000.0)
 
tijdinuur = ((endtime starttime) / 1000.0)/3600
 
--messagebox("succeeded, het renderen duurde \n" +  tijdsinterval as string " seconden \n" tijdinuur as string" uur" )
 
messagebox("succeeded, \n" "start time : " timerstringstart "\n end time : " timerstringend)-- + "\n total time : " total_time)
 )
 
 
 
groupbox boxinfo "Info" height150 width:370
 label lblinfo 
"Important : \n each file must be ready to render. (complete render setup) \n beware of fileoverriding!" height:100 width300 pos:[25,240]
 
 
 
 
)
 
 
createdialog myRoll width:400 height:390
Author: hanselmoniz

Replied: 16 January 2012 08:59 PM