Difference between revisions of "IC Python API:RLPy RTime"
From Reallusion Wiki!
Chuck (RL) (Talk | contribs) (Created page with "{{TOC}} {{Parent|IC_Python_API:RL_Python_Modules#System|System Module}} Class in RLPy / Inherits from:_object == Description == This class is used to hold and manipulate ti...") |
Chuck (RL) (Talk | contribs) m (→GetFrameIndex) |
||
Line 20: | Line 20: | ||
{{Code| <nowiki> | {{Code| <nowiki> | ||
import RLPy | import RLPy | ||
+ | |||
#create a time object of 3 seconds | #create a time object of 3 seconds | ||
time = RLPy.RTime(3000) | time = RLPy.RTime(3000) | ||
+ | |||
+ | #print the frame index at the 3 second mark: 180 | ||
print(RLPy.RTime.GetFrameIndex(time, RLPy.RGlobal.GetFps())) | print(RLPy.RTime.GetFrameIndex(time, RLPy.RGlobal.GetFps())) | ||
</nowiki> | </nowiki> |
Revision as of 20:50, 13 January 2019
- Main article: System Module.
Class in RLPy / Inherits from:_object
Description
This class is used to hold and manipulate timing information.
Time is stored internally in system as milliseconds. Most API methods that require or return timing information do so through variables of this type. This class also provide methods to convert between Frame and RTime, such as GetFrameIndex() and IndexedFrameTime(). Use of GetFrameTime() can ensure that RTime is on the correct frame.
Member Functions
GetFrameIndex
def RLPy.RTime.GetFrameIndex(kTime, nFps)
Convert the current time to frame index.
Code:import RLPy #create a time object of 3 seconds time = RLPy.RTime(3000) #print the frame index at the 3 second mark: 180 print(RLPy.RTime.GetFrameIndex(time, RLPy.RGlobal.GetFps()))
GetStatusCode
def RLPY.RStatus.GetStatusCode(self)
IsError
def RLPY.RStatus.IsError(self)