Profile Picture

Official wiki page about getting project FPS with Python incorrect (iClone 8 Python API)

Posted By mrtobycook 2 Years Ago
You don't have permission to rate!

Official wiki page about getting project FPS with Python incorrect...

Author
Message
mrtobycook
mrtobycook
Posted 2 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)

Group: Forum Members
Last Active: 9 Months Ago
Posts: 425, Visits: 2.7K
Hi everyone :-)

This page on the wiki unfortunately has code that doesn't work:
https://wiki.reallusion.com/IC_8_Python_API:Dealing_With_Custom_FPS
1 fps = RLPy.RGlobal.GetFps()      # return RFps2 # convert to frame index3 frame_index = RLPy.GetFrameIndex(current_time, fps)             4 # convert to RTime   5 current_time = RLPy.IndexedFrameTime(frame_index, fps)      6 # time on frame7 frame_time = RLPy.RGlobal.GetFps().GetFrameTime( current_time )
The variable "current_time" on line 3 is undefined (at least in iClone 8.3) and I don't believe it's a built-in global variable of any type.

What is the correct way to convert the rFPS to usable integer or float values?

thanks

toby





- - - - - - - - - - - - - - - - - - - - - - - - - - - - 
https://forum.reallusion.com/uploads/images/d11fc97b-7387-4f19-bb1e-0785.png
virtualfilmer.com | youtube

mrtobycook
mrtobycook
Posted 2 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)

Group: Forum Members
Last Active: 9 Months Ago
Posts: 425, Visits: 2.7K
I do know that I'm talking to myself here LOL, but FYI if anyone finds this, the easiest way is actually this:

ic_fps = RLPy.RGlobal.GetFps()

print(ic_fps.ToInt())

That will convert the result of the "GetFps()" to something actually usable.

In the instance above, it returns the integer 60 if your project is 60 fps. Or 24 or 30 or whatever you have it set to.

ARGH. :-)



- - - - - - - - - - - - - - - - - - - - - - - - - - - - 
https://forum.reallusion.com/uploads/images/d11fc97b-7387-4f19-bb1e-0785.png
virtualfilmer.com | youtube




Reading This Topic