Batch Render

Batch Render

hanselmoniz
Enthusiast Enthusiast
905 Views
4 Replies
Message 1 of 5

Batch Render

hanselmoniz
Enthusiast
Enthusiast
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
0 Likes
906 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
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> <height> filename:img_out.tga gamma:(1.0/2.2)

render camera:<your cam> to:r_bitmap outputwidth:<width> outputheight:<height> \
frame:<frm> outputfile: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
0 Likes
Message 3 of 5

hanselmoniz
Enthusiast
Enthusiast
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 &#40;from the given folder of max files&#41; 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
3dmaxdesign 2011 64-bit
i7 2600 windows 7 64-bit
quadro 600
0 Likes
Message 4 of 5

Steve_Curley
Mentor
Mentor
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 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes
Message 5 of 5

hanselmoniz
Enthusiast
Enthusiast
--- thanks for this



----sorted it out




rollout myRoll "Render multiple files"
(
local number_of_files = 0
local ListOfMaxFiles = #()

button btnBrowseFile "Browse for files" width: 370
multilistbox mlbMaxFiles
label lbNumberOfFiles " No files selected"
button btnRender "Render all files" width: 370 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 = 1 --set the filter drop-down list to All Files
result = theDialog.showDialog() --display the dialog, get result into variable
result.ToString() --when closed, convert the result to string
result.Equals result.OK --returns TRUE if OK was pressed, FALSE otherwise
result.Equals result.Cancel --returns TRUE if Cancel was pressed, FALSE 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 i = 1 to (mlbMaxFiles.items.count) do
(
loadMaxFile &#40;mlbMaxFiles.items as string&#41; 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" height: 150 width:370
label lblinfo "Important : \n each file must be ready to render. (complete render setup) \n beware of fileoverriding!" height:100 width: 300 pos:



)

createdialog myRoll width:400 height:390
3dmaxdesign 2011 64-bit
i7 2600 windows 7 64-bit
quadro 600
0 Likes