Difference between revisions of "IC Python API:RLPy RFloatControl"
From Reallusion Wiki!
Chuck (RL) (Talk | contribs) (Created page with "{{TOC}} {{Parent|IC_Python_API:RL_Python_Modules|Modules}} ==Inheritance== This class inherits public member functions from: *RLPy.RControl ==D...") |
Chuck (RL) (Talk | contribs) m |
||
Line 1: | Line 1: | ||
{{TOC}} | {{TOC}} | ||
{{Parent|IC_Python_API:RL_Python_Modules|Modules}} | {{Parent|IC_Python_API:RL_Python_Modules|Modules}} | ||
− | == | + | {{last_modified}} |
− | This class | + | |
− | + | == 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. | |
− | <syntaxhighlight lang=" | + | |
+ | See Also: [[IC_Python_API:RLPy_RKey|RKey]], [[IC_Python_API:RLPy_RFloatkey|RFloatkey]] | ||
+ | |||
+ | === Inheritance === | ||
+ | |||
+ | [[IC_Python_API:RLPy_RControl|RControl]] > [[IC_Python_API:RLPy_RFloatControl|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 ( self, kTime, fValue )|SetValue]] | ||
+ | |||
+ | ==== Parameters ==== | ||
+ | |||
+ | :'''kTime''' [IN] The specified time - [[IC_Python_API:RLPy_RTime|RTime]] | ||
+ | :'''fValue''' [OUT] The float key value - float. | ||
+ | |||
+ | ==== Return ==== | ||
+ | |||
+ | :Success - RLPy.RStatus.Success | ||
+ | :Failure - RLPy.RStatus.Failure | ||
+ | |||
+ | <syntaxhighlight lang="python" line='line'> | ||
avatar_list = RLPy.RScene.GetAvatars() | avatar_list = RLPy.RScene.GetAvatars() | ||
avatar = avatar_list[0] | avatar = avatar_list[0] | ||
− | + | ||
− | # | + | # get value |
float_control = avatar.GetControl("PathPosition") | float_control = avatar.GetControl("PathPosition") | ||
− | |||
− | |||
print(float_control.GetValue(time,value)) | print(float_control.GetValue(time,value)) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | === SetValue ( self, kTime, fValue ) === | |
− | + | Set the float key value for the requested time. | |
− | + | ||
− | + | ||
− | + | ||
− | + | See Also: [[#GetValue ( self, kTime, fValue )|GetValue]] | |
− | + | ==== Parameters ==== | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | ====Parameters==== | + | |
− | + | ||
− | '''kTime''' [IN] | + | :'''kTime''' [IN] The specified time- [[IC_Python_API:RLPy_RTime|RTime]] |
+ | :'''fValue''' [IN] The Key value - float | ||
− | + | ==== Return ==== | |
− | + | ||
− | ====Return | + | |
− | + | ||
− | + | :Success - RLPy.RStatus.Success | |
+ | :Failure - RLPy.RStatus.Failure | ||
− | '' | + | <syntaxhighlight lang="python" line='line'> |
− | </ | + | avatar_list = RLPy.RScene.GetAvatars() |
+ | avatar = avatar_list[0] | ||
+ | |||
+ | # set value | ||
+ | float_control = avatar.GetControl("PathPosition") | ||
+ | value = 1 | ||
+ | float_control.SetValue(RLPy.RTime(100),value) | ||
+ | </syntaxhighlight> |
Revision as of 19:14, 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.
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)