Help : Is there any timer function at the api ?

Forum for OctaneRender Lua scripting examples, discussion and support.
Post Reply
gmillas
Licensed Customer
Posts: 45
Joined: Fri Jun 25, 2010 6:15 am
Location: Greece
Contact:

i am trying to get the progress of the frame rendering.
While i am firing a render i want to update a progress bar for the gurrent sample progress


Help please ...
User avatar
stratified
OctaneRender Team
Posts: 945
Joined: Wed Aug 15, 2012 6:32 am
Location: Auckland, New Zealand

Hi,

No there isn't any timer functionality but it wouldn't help you in this case because you don't know in advance how long your render would take anyway.

If you track progress while rendering you have register a render callback. This callback will be called by the render engine to inform on intermediate results. Here's a small snippet that shows you how it works:

Code: Select all

-- select a render target node and render it
local renderTargetNode = octane.project.getSelection()[1]

local function renderCallback(result) 
    print("-- intermediate result was reported back from the render engine")
    -- print out what's in result
    for k,v in pairs(result) do
        print(k, v)
    end
end

-- start rendering
octane.render.start
{
    renderTargetNode = renderTargetNode,
    maxSamples       = 1000,
    callback         = renderCallback,
}
cheers,
Thomas
gmillas
Licensed Customer
Posts: 45
Joined: Fri Jun 25, 2010 6:15 am
Location: Greece
Contact:

How often this callback function is been called ?

Cause i did that and it was called at the end..
gmillas
Licensed Customer
Posts: 45
Joined: Fri Jun 25, 2010 6:15 am
Location: Greece
Contact:

ok i got it
i havent seen the result parameter in callback function

SOLVED

thanks
User avatar
stratified
OctaneRender Team
Posts: 945
Joined: Wed Aug 15, 2012 6:32 am
Location: Auckland, New Zealand

gmillas wrote:How often this callback function is been called ?

Cause i did that and it was called at the end..
Hi,

It's called every time Octane tonemaps the render result (and the standalone refreshes it's viewport). In the beginning this is very often but if you don't modify the scene anymore it will converge. Then it's called roughly every 5 seconds.

But you shouldn't rely on how often this is called, we have a result when we have a result ;)

cheers,
Thomas
Post Reply

Return to “Lua Scripting”