get framerate/FPS value via lua

Forum for OctaneRender Lua scripting examples, discussion and support.
Post Reply
User avatar
PolderAnimation
Licensed Customer
Posts: 373
Joined: Mon Oct 10, 2011 10:23 am
Location: Netherlands
Contact:

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 | RTX 3090 | i9 7960X | 64GB
User avatar
bepeg4d
Octane Guru
Posts: 10340
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy
Contact:

Hi Jean-Paul,
here is the code:
local fps = octane.project.getProjectSettings():getAttribute(octane.A_FRAMES_PER_SECOND)
print(fps)

ciao beppe
User avatar
PolderAnimation
Licensed Customer
Posts: 373
Joined: Mon Oct 10, 2011 10:23 am
Location: Netherlands
Contact:

Thanks,

you're a life saver ;)
Win 10 64bit | RTX 3090 | i9 7960X | 64GB
Post Reply

Return to “Lua Scripting”