max quick render VS render()

Heya,
I am trying to batch render some max files using the camera inside the file, if there is one. Thats why I use

render camera:theCam outputFile:outFile

to start the rendering (if previously a camera has been found) and

 rendOutputFileName = outFile; max quick render

if no camera has been found.
"outFile" is a pathname like this:
"C:/Users/br0t/Desktop/test.jpg"

Both render an image, which looks correct in the Frame Buffer, but the first method will save a plain black image. max quick render works correctly, but I dont know how to set a camera as the active viewport. Any ideas why render() fails?

Cheers

Comments

Comment viewing options

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

Its a Vray Frame buffer problem.

To stop from getting a black image all you have to do is turn on the split channels checkbox in the vray frame buffer section. I just finished writing a script that does exactly what you mentioned above. If you need some more information on it let me know and I can show you the code.

John Martini
Digital Artist
http://www.JokerMartini.com (new site)

br0t's picture

gimme da code :D

gimme da code :D

Never get low & slow & out of ideas

Anubis's picture

hi br0t

No visible reason, render() with camera argument works fine. You can try also render to:bitmap but here is as well a snippet code to set a camera to the active viewport.

theCam = cameras[1]
if isValidNode theCam and \
getActiveCamera() != theCam do (
	if viewport.CanSetToViewport theCam do
		viewport.setCamera theCam
)
if getActiveCamera() == undefined then (
	rendOutputFileName = outFile
	rendSaveFile = on
	max quick render
)
else (
	render camera:theCam outputFile:outFile
)

p.s. - if you render to bitmap...

bm = bitmap renderWidth renderHeight fileName:outFile
render camera:theCam to:bm
save bm ; free bm

my recent MAXScripts RSS (archive here)

br0t's picture

thanks Anubis, that is

thanks Anubis, that is helpful!

I think my black image is a Vray problem, or more a problem with the vray frame buffer. If I turn it off, everything renders fine. Unfortunately I cannot do that by script, so I am now loading a renderpreset each time, that thas the vfb disabled.

Cheers

Never get low & slow & out of ideas

Comment viewing options

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