Chaos Corona for 3ds Max > [Max] General Discussion

maxscript set bitmap output path in render batch

(1/2) > >>

bertv:
Hi,

I had a problem with setting an output batch via code in Maxscript 3D studio max.
When creating the batch and output to a png file, the render crashes using the backburner system via netrendering.

--- Code: ---batchRenderMgr.netRender = true
nameFile = getFilenameFile(maxfilename)

perspCamObj = getnodebyname "PERSP_CAM"
perspCamBatch = batchRenderMgr.CreateView perspCamObj
perspNameCam = nameFile + "_" + perspCamObj.name
perspCamBatch.name = perspNameCam
perspCamBatch.outputFilename = maxFilePath + perspNameCam + ".png"

--- End code ---

When setting the output manual (via the max batch dialog), the system renders fine via netrendering.

I found someone with a simular problem, but he uses Vray.
https://forums.autodesk.com/t5/3ds-max-forum/maxscript-batchrendermgr-outputfilename-causing-backburner/td-p/4265968

I can't find a way to bypass the problem using the Corona Render Engine the same way described in the link above.
Here they suggest the following for Vray render engine =>

Found a solution via another scripted file name attribute problem.
You have to create a bitmap and then parse the filename property of the bitmap instance to the intended attribute.
Here is an example with a similar problem when scripting the filename output property of vray render elements:

--- Code: ---vr = renderers.current
vr.output_on = true
vr.output_splitgbuffer = true
/*here is where the joy starts, setting the name of the path and filename*/
fileName = outputFilename + "." + extension
/*now we create a temporary bitmap in that location*/
screwedBitmapCreation = Bitmap 10 10 fileName:fileName
/*save it and close it*/
save screwedBitmapCreation
close screwedBitmapCreation
/*now using the bitmap instance we parse the filename of
the bitmap to the render attribute .......LAME!!*/
vr.output_splitfilename = screwedBitmapCreation.filename

--- End code ---


Any help would be appreciated to do this in Corona:
corona = renderers.current    --This works
corona.output_on = true        --No idea how to do this
corona.output_splitgbuffer = true        --No idea how to do this
corona.output_splitfilename = filenameForBitmap       --No idea how to do this

Regards,
Bert

Frood:
Hi,

the example in your code section #1 works here. Do you really get a crash or just a frame error? If crash: check Max.log on the render node and/or see if there is a minidump created.

Backburner submission via UI works for you?


God Luck



bertv:

--- Quote from: Frood on 2022-09-22, 10:18:59 ---Hi,

the example in your code section #1 works here. Do you really get a crash or just a frame error? If crash: check Max.log on the render node and/or see if there is a minidump created.

Backburner submission via UI works for you?


God Luck

--- End quote ---

Hi Frood,
This code is indeed working but only when running the render batch local. It crashes in the backburner render farm using batch rendering.

--- Code: ---batchRenderMgr.netRender = true
nameFile = getFilenameFile(maxfilename)

perspCamObj = getnodebyname "PERSP_CAM"
perspCamBatch = batchRenderMgr.CreateView perspCamObj
perspNameCam = nameFile + "_" + perspCamObj.name
perspCamBatch.name = perspNameCam
perspCamBatch.outputFilename = maxFilePath + perspNameCam + ".png"
--- End code ---

There seems to be a fix/workaround for the Vray render engine with splitbuffering (See the 2nd part code),
And was wondering if something simular could be done for the Corona render engine?

Regards
Bertv

Frood:

--- Quote from: bertv on 2022-12-14, 13:48:53 ---This code is indeed working but only when running the render batch local. It crashes in the backburner render farm using batch rendering.

--- End quote ---

Not sure if I get that correctly. To my understanding, you run the script to set up the batchRenderMgr locally. And by setting netRender to true, you create a BB job. So: script executes locally, rendering happens on BB, right? Or do you use 3dsmaxcmd at some point?

I did fire up my startup scene (it is located on a network share), saved it as "test.max" (also on a network share), renamed the cam to "PERSP_CAM", added "batchRenderMgr.render()" to the script and executed it. Then I got the Network Job Assignment window, connected to BB manager and submitted the job which came out as expected, no crash.

As far as I understand, the vray "fix" (your link) is just a matter of data types and affects the (custom) vray output. You cannot translate any of those properties to Corona.


Good Luck





bertv:
Hi Frood,

Correct,
The code works, the jobs in the batch gets created by the script.
The problem is the save to png, jpg, etc... causing a crash when rendering in Backburner.
When rendering the batch locally, no problem.

Parentally this is common and the link below was an approach to solve this in Vray using the split buffer:
https://forums.autodesk.com/t5/3ds-max-forum/maxscript-batchrendermgr-outputfilename-causing-backburner/td-p/4265968

I have no clue how to start solving this in Corona render engine?

Regards,
Bert

Navigation

[0] Message Index

[#] Next page

Go to full version