Help : Is there any timer function at the api ?

Forums: Help : Is there any timer function at the api ?
Forum for OctaneRender Lua scripting examples, discussion and support.

Help : Is there any timer function at the api ?

Postby gmillas » Mon Apr 07, 2014 3:05 pm

gmillas Mon Apr 07, 2014 3:05 pm
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 ...
gmillas
Licensed Customer
Licensed Customer
 
Posts: 45
Joined: Fri Jun 25, 2010 6:15 am
Location: Greece

Re: Help : Is there any timer function at the api ?

Postby stratified » Mon Apr 07, 2014 8:13 pm

stratified Mon Apr 07, 2014 8:13 pm
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
User avatar
stratified
OctaneRender Team
OctaneRender Team
 
Posts: 945
Joined: Wed Aug 15, 2012 6:32 am
Location: Auckland, New Zealand

Re: Help : Is there any timer function at the api ?

Postby gmillas » Wed Apr 09, 2014 8:09 am

gmillas Wed Apr 09, 2014 8:09 am
How often this callback function is been called ?

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

Re: Help : Is there any timer function at the api ?

Postby gmillas » Wed Apr 09, 2014 8:19 am

gmillas Wed Apr 09, 2014 8:19 am
ok i got it
i havent seen the result parameter in callback function

SOLVED

thanks
gmillas
Licensed Customer
Licensed Customer
 
Posts: 45
Joined: Fri Jun 25, 2010 6:15 am
Location: Greece

Re: Help : Is there any timer function at the api ?

Postby stratified » Wed Apr 09, 2014 6:46 pm

stratified Wed Apr 09, 2014 6:46 pm
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
User avatar
stratified
OctaneRender Team
OctaneRender Team
 
Posts: 945
Joined: Wed Aug 15, 2012 6:32 am
Location: Auckland, New Zealand

Return to Lua Scripting


Who is online

Users browsing this forum: No registered users and 13 guests

Wed Apr 24, 2024 9:59 pm [ UTC ]