IC Python API:RLPy RFloatControl

From Reallusion Wiki!
Jump to: navigation, search
Main article: Modules.
Last modified: 04/15/2020

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 neartes float key value.

See Also: RKey, RFloatKey

Inheritance

RControl > RFloatControl

Member Functions

GetValue ( self, kTime, fValue )

Get the float key value, if the key does not exist for the requested time then extract an interpolated value.

See Also: SetValue

Parameters

kTime [IN] The specified time - RTime
fValue [OUT] The float key value - float.

Return

Success - RLPy.RStatus.Success
Failure - RLPy.RStatus.Failure
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))

SetValue ( self, kTime, fValue )

Set the float key value for the requested time.

See Also: GetValue

Parameters

kTime [IN] The specified time- RTime
fValue [IN] The Key value - float

Return

Success - RLPy.RStatus.Success
Failure - RLPy.RStatus.Failure
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)