IC8 Python API:RLPy RFloatControl
From Reallusion Wiki!
- Main article: iC8 Modules.
- Last modified: 01/4/2023
Description
This class is used to manage float keys ( RFloatKey ). RFloatControl can access RFloatKey via SetValue and GetValue. GetValue can retrieve the key value at a requested time, and if a key does not exist then it will return the nearest float key value.
Class Methods
RLPy.RFloatControl.GetValue(self, kTick, fValue, fDefaultValue = 0.0)
Get key value by time.
Parameters
- kTime[IN] Specifies the time to get value.
fValue[OUT] Value of the key - float
Returns
- RLPy.RStatus.Success - Succeed
- RLPy.RStatus.Failure - Fail
1 avatar_list = RLPy.RScene.GetAvatars()
2 avatar = avatar_list[0]
3
4 # get value
5 float_control = avatar.GetControl("PathPosition")
6 print(float_control.GetValue(time,value))
RLPy.RFloatControl.OptimizeKeys(self, kBeginTime, kEndTime, kFps, fError = 0.5)
Optimize Keys.
Parameters
- kBeginTime[IN] Specifies the time to start - RLPy.RLTime
- kEndTime[IN] Specifies the time to end - RLPy.RLTime
- kFps[IN] Specifies the fps - RLPy.RLFps
- fError[IN] Specifies the error value - float
Returns
- RLPy.RStatus.Success - Succeed
- RLPy.RStatus.Failure - Fail
1 # No example
RLPy.RFloatControl.ReserveKeyCapacity(self, uSize)
reserve key capacity.
Parameters
- uSize[IN] Size - int
Returns
- RLPy.RStatus.Success - Succeed
- RLPy.RStatus.Failure - Fail
1 # No example
RLPy.RFloatControl.SetValue(self, args)
Set key value by time.
Parameters
- kTime[IN] Specifies the time to get value.
- fValue[IN] Value of the key - float
Returns
- RLPy.RStatus.Success - Succeed
- RLPy.RStatus.Failure - Fail
1 avatar_list = RLPy.RScene.GetAvatars()
2 avatar = avatar_list[0]
3
4 # set value
5 float_control = avatar.GetControl("PathPosition")
6 value = 1
7 float_control.SetValue(RLPy.RTime(100),value)