.renderState - simpliest possilbe question... please help

Forum for OctaneRender Lua scripting examples, discussion and support.
Post Reply
tomsawyer
Posts: 11
Joined: Thu Jun 22, 2017 2:13 pm

Could someone help me out with a very basic task:

using LUA, I want to know if the current render target has finished rendering (had reached the samples/pixel)

if I do in Script window: print (octane.renderState), it will return "table".

I am new to LUA/octane - forgive my blindness on the subject: is this octane.renderState just a variable/holder for different states? or is this a function that can be called to find the state of current rendering?

I have also tried: octane.renderJobStatus

Sorry again for the very basic level, I have only used maxscript and MEL, I didn't expect to take me so long to retrieve some simple system variables using LUA.

(What I need is a very basic .lua that will be called from a batch line. All this .lua has to do is to check if samples are reached and save the render passes as layered exr.... )

ANY feedback greatly appreciated !
THANKS
User avatar
bepeg4d
Octane Guru
Posts: 10321
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy
Contact:

Hi tomsawyer,
if I have understood correctly your question, I would go in another direction:

Code: Select all

stats = octane.render.getRenderResultStatistics()
print(stats.renderTime, stats.estimatedRenderTime, "\n")

if stats.renderTime ~= stats.estimatedRenderTime then
    print("Rendering")
else
    print("FINISHED")
end
If you search "octane.render.PROPS_RENDER_RESULT_STATISTICS", you can find all the info about the RenderResultStatistics table.
Let me know if this solution works for you.
ciao beppe
User avatar
roeland
OctaneRender Team
Posts: 1822
Joined: Wed Mar 09, 2011 10:09 pm

If the render was started using octane.render.start, then it is finished when that function call returns.

If you have indeed a script which is called from a batch file, you would have a call to octane.render.start, followed by a call to octane.render.saveRenderPasses (or saveRenderPassesMultiExr).
tomsawyer
Posts: 11
Joined: Thu Jun 22, 2017 2:13 pm

Thanks for the hints!

@ Beppe: i have used something similar - I check if the renderState is 4 (rendering)

Code: Select all

local function isDone()
    renderIsDone = false
    stats = octane.render.getRenderResultStatistics()
    if (stats.renderState == 4) then renderIsDone = true end
    return renderIsDone 

@roeland - thanks: the render is started by a batch file indeed. It worked with the above function, but using octane.render.start makes more sense - I will use this.

I am using octane.render.saveRenderPassesMultiExr
Any idea how to enable tonemapping?

Thanks for help!
Tom
User avatar
roeland
OctaneRender Team
Posts: 1822
Joined: Wed Mar 09, 2011 10:09 pm

The values of .renderState are constants in the octane.renderState enumeration, and 4 is the value of octane.renderState.FINISHED.

Saving HDR images with tonemapping is a bit unusual, but it can be done by setting the last parameter of that function to true. But if you want to do any meaningful post-processing with the render passes you'll probably need the images without tonemapping applied.

-Roeland
Post Reply

Return to “Lua Scripting”