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

From Reallusion Wiki!
Jump to: navigation, search
(Created page with "{{TOC}} {{Parent|IC_Python_API:RL_Python_Modules|Modules}} ==Inheritance== This class inherits public member functions from: *RLPy.RControl ==D...")
 
m
Line 1: Line 1:
 
{{TOC}}
 
{{TOC}}
 
{{Parent|IC_Python_API:RL_Python_Modules|Modules}}
 
{{Parent|IC_Python_API:RL_Python_Modules|Modules}}
==Inheritance==
+
{{last_modified}}
This class inherits public member functions from:
+
 
*[[IC_Python_API:RLPy_RControl|RLPy.RControl]]
+
== Description  ==
==Detailed Description==
+
 
RFloatControl controls simple floating point values.
+
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="Python">
+
 
 +
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]
+
# set value
+
# get value
 
float_control = avatar.GetControl("PathPosition")
 
float_control = avatar.GetControl("PathPosition")
value = 1
 
float_control.SetValue(RLPy.RTime(100),value)
 
 
print(float_control.GetValue(time,value))
 
print(float_control.GetValue(time,value))
 
</syntaxhighlight>
 
</syntaxhighlight>
==Member Functions==
 
===GetValue===
 
<syntaxhighlight lang="Python">
 
RLPy.RFloatControl.GetValue ( self, kTime, fValue )
 
</syntaxhighlight>
 
Get key value by time.
 
====Parameters====
 
<div style="margin-left: 2em;">
 
  
'''kTime''' [IN] Specifies the time to get value - RLPy.RTime
+
===  SetValue ( self, kTime, fValue )  ===
  
'''fValue''' [OUT] Value of the key - float
+
Set the float key value for the requested time.
</div>
+
====Return Values====
+
<div style="margin-left: 2em;">
+
  
'''RLPy.RStatus.Success''' Success
+
See Also: [[#GetValue ( self, kTime, fValue )|GetValue]]
  
'''RLPy.RStatus.Failure''' Fail
+
==== Parameters ====
</div>
+
-----
+
===SetValue===
+
<syntaxhighlight lang="Python">
+
RLPy.RFloatControl.SetValue ( self, kTime, fValue )
+
</syntaxhighlight>
+
Set key value by time.
+
====Parameters====
+
<div style="margin-left: 2em;">
+
  
'''kTime''' [IN] Specifies the time to get value - RLPy.RTime
+
:'''kTime''' [IN] The specified time- [[IC_Python_API:RLPy_RTime|RTime]]
 +
:'''fValue''' [IN] The Key value - float
  
'''fValue''' [IN] Value of the key - float
+
==== Return ====
</div>
+
====Return Values====
+
<div style="margin-left: 2em;">
+
  
'''RLPy.RStatus.Success''' Success
+
:Success - RLPy.RStatus.Success
 +
:Failure - RLPy.RStatus.Failure
  
'''RLPy.RStatus.Failure''' Fail
+
<syntaxhighlight lang="python" line='line'>
</div>
+
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.

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)