Difference between revisions of "IC Python API:RLPy RFloatControl"

From Reallusion Wiki!
Jump to: navigation, search
m
m
 
Line 5: Line 5:
 
==  Description  ==
 
==  Description  ==
  
This class is used to manage float keys ( [[IC_Python_API:RLPy_RFloatkey|RFloatkey]] ). [[IC_Python_API:RLPy_RFloatControl|RFloatControl]] can access [[IC_Python_API:RLPy_RFloatkey|RFloatkey]] via [[#SetValue ( self, kTime, fValue )|SetValue]] and [[#GetValue ( self, kTime, fValue )|GetValue]]. [[#GetValue ( self, kTime, fValue )|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.
+
This class is used to manage float keys ( [[IC_Python_API:RLPy_RFloatKey|RFloatKey]] ). [[IC_Python_API:RLPy_RFloatControl|RFloatControl]] can access [[IC_Python_API:RLPy_RFloatKey|RFloatKey]] via [[#SetValue ( self, kTime, fValue )|SetValue]] and [[#GetValue ( self, kTime, fValue )|GetValue]]. [[#GetValue ( self, kTime, fValue )|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: [[IC_Python_API:RLPy_RKey|RKey]], [[IC_Python_API:RLPy_RFloatkey|RFloatkey]]
+
See Also: [[IC_Python_API:RLPy_RKey|RKey]], [[IC_Python_API:RLPy_RFloatKey|RFloatKey]]
  
 
===  Inheritance  ===
 
===  Inheritance  ===

Latest revision as of 20:15, 15 April 2020

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)