View Full Version : CMD Line render - change materials before render

02 February 2012, 02:37 PM
I'm trying to do a command line render for some max files and I'm not finding it possibly to change materials on any of the objects no matter what I do. And one thing I can't use is Material override because I only need the new material applied to a group of objects which I'm collecting via the root.children.

this is the preRenderScript getting passed with the maxfile.

tmp = loadTempMaterialLibrary "Q:\ASSETS\MATERIALS\_VRay\CheckerBoard.mat"
MtlObjs = $MtlPreviewObjects.children
for obj in MtlObjs do obj.material = tmp[1]
--//Render Settings
rendSaveFile = true
renderWidth = 600
renderHeight = 600
rendOutputFilename = "Q:\ASSETS\MATERIALS\_VRay\CheckerBoard.jpg"

lastly here is the command line I'm passing.

"C:\Program Files\Autodesk\3ds Max 2012\3dsmaxcmd.exe" "Q:\ASSETS\Tools\Max\scenes\previewScene\PreviewMtl.max" -preRenderScript "C:\Users\IEVFX\Desktop\trash\1_PreviewTest\"

Does anyone have any ideas or solutions to this? I even tried changing the materials of the objects in the scene by doing "scene object 1's material" = "another scene objects material."

CGTalk Moderation
02 February 2012, 02:37 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.