get framerate/FPS value via lua

Forums: get framerate/FPS value via lua
Forum for OctaneRender Lua scripting examples, discussion and support.

get framerate/FPS value via lua

Postby PolderAnimation » Tue Sep 06, 2016 9:38 am

PolderAnimation Tue Sep 06, 2016 9:38 am
I searched the api-browser and the forum but could not find an answer, so hopefully anyone here knows.

For a custom script I need to set the time value of the sceneGraph via updateTime(). But this needs a time value and we work with frameNumbers. So i need to devide my framenumber bij the framerate.
The Gui shows me the framerate/FPS slider, but how do i query this framerate value in lua?

Thanks in advance!

Jean-Paul
Win 10 64bit | 5 x 1080ti | i7 4770 | 32GB
User avatar
PolderAnimation
Licensed Customer
Licensed Customer
 
Posts: 260
Joined: Mon Oct 10, 2011 10:23 am
Location: Netherlands

Re: get framerate/FPS value via lua

Postby bepeg4d » Tue Sep 06, 2016 9:55 am

bepeg4d Tue Sep 06, 2016 9:55 am
Hi Jean-Paul,
here is the code:
local fps = octane.project.getProjectSettings():getAttribute(octane.A_FRAMES_PER_SECOND)
print(fps)

ciao beppe
User avatar
bepeg4d
Octane Guru
Octane Guru
 
Posts: 6514
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy

Re: get framerate/FPS value via lua

Postby PolderAnimation » Tue Sep 06, 2016 2:49 pm

PolderAnimation Tue Sep 06, 2016 2:49 pm
Thanks,

you're a life saver ;)
Win 10 64bit | 5 x 1080ti | i7 4770 | 32GB
User avatar
PolderAnimation
Licensed Customer
Licensed Customer
 
Posts: 260
Joined: Mon Oct 10, 2011 10:23 am
Location: Netherlands

Return to Lua Scripting


Who is online

Users browsing this forum: No registered users and 1 guest

Wed Jul 24, 2019 2:11 am [ UTC ]