[Closed] Render and Save Command
Dear all, i’m currently working on a project that requires me to repeat these following task
- Show and Hide certain object in a scene
- Assign specific color onto the object
- Render the file from a camera from a view port
- Save the rendered file into a unique .jpeg name in an allocated folder
Above 1,2,3 can be done using the listener but i encounter problem with the script of saving the quick render file, please advice, thanks!
for i = 1 to 10 do
(
f_name = “C:\ est\image” + i as string + “.png”
Render outputfile:f_name
)
Hi DaveWortley, thanks for your reply and help but i’m actually looking for something way simpler instead of a sequence render command. What i need is more of a Render a still frame from my scene camera and Save File (jpg) in allocated folder command followed by close if necessary. Really thankful and hope you can help me.
To save a single rendering:
pnRenderDest = "C:\" -- output directory
pnRenderImage = pnRenderDest + (getFilenameFile maxFilename) + ".jpg"
cRenderCam = $Camera01 -- name of your camera
undisplay (render [b][b]camera:cRenderCam [/b][/b]outputfile:pnRenderImage)
If the name of your camera alters, you can replace the 3rd line with:
cRenderCam = cameras[1]
to use the first camera in scene.
You will however get a maxScript error if no camera is in your scene.
Hi zortech, thanks for your reply here, the codes are right but somehow i get an error when running the script Image I/O Error with >> MAXScript FileIn Exception: – Unable to convert: undefined to type: String << please advice, thanks! Sorry but i’ve never use maxscript extensively in my work, hope you can advice me.