.renderState - simpliest possilbe question... please help

Forums: .renderState - simpliest possilbe question... please help
Forum for OctaneRender Lua scripting examples, discussion and support.

.renderState - simpliest possilbe question... please help

Postby tomsawyer » Fri Jun 30, 2017 12:34 pm

tomsawyer Fri Jun 30, 2017 12:34 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
tomsawyer
 
Posts: 11
Joined: Thu Jun 22, 2017 2:13 pm

Re: .renderState - simpliest possilbe question... please help

Postby bepeg4d » Tue Jul 04, 2017 9:40 am

bepeg4d Tue Jul 04, 2017 9:40 am
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
bepeg4d
Octane Guru
Octane Guru
 
Posts: 6764
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy

Re: .renderState - simpliest possilbe question... please help

Postby roeland » Mon Jul 24, 2017 5:21 am

roeland Mon Jul 24, 2017 5:21 am
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).
User avatar
roeland
OctaneRender Team
OctaneRender Team
 
Posts: 1741
Joined: Wed Mar 09, 2011 10:09 pm

Re: .renderState - simpliest possilbe question... please help

Postby tomsawyer » Thu Aug 31, 2017 12:27 pm

tomsawyer Thu Aug 31, 2017 12:27 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
tomsawyer
 
Posts: 11
Joined: Thu Jun 22, 2017 2:13 pm

Re: .renderState - simpliest possilbe question... please help

Postby roeland » Sun Sep 17, 2017 9:12 pm

roeland Sun Sep 17, 2017 9:12 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
User avatar
roeland
OctaneRender Team
OctaneRender Team
 
Posts: 1741
Joined: Wed Mar 09, 2011 10:09 pm

Return to Lua Scripting


Who is online

Users browsing this forum: No registered users and 1 guest

Thu Dec 12, 2019 10:52 am [ UTC ]