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

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
 
(2 intermediate revisions by the same user not shown)
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==
+
 
RTransformControl controls transform values.
+
This class manages [[IC_Python_API:RLPy_RTransformKey|RTransformKey]] on the [[IC_Python_API:RLPy_RTransform|RTransform]]. [[IC_Python_API:RLPy_RTransformControl|RTransformControl]] can use [[#GetValue ( self, kTime, kValue )|GetValue]], [[#SetValue ( self, kTime, kValue )|SetValue]], [[#GetTransformKey ( self, kTime, pKey )|GetTransformKey]], and [[#GetTransformKeyAt ( self, uIndex, pKey )|GetTransformKeyAt]] to access Transform Key values at a given point in time. It can also extrapolate the proper value between two keys.
<syntaxhighlight lang="Python">
+
 
 +
See Also: [[IC_Python_API:RLPy_RControl|RControl]], [[IC_Python_API:RLPy_RFloatControl|RFloatControl]], [[IC_Python_API:RLPy_RTransformKey|RTransformKey]], [[IC_Python_API:RLPy_RTransform|RTransform]].
 +
 
 +
=== Inheritance ===
 +
 
 +
[[IC_Python_API:RLPy_RControl|RControl]] > [[IC_Python_API:RLPy_RTransformControl|RTransformControl]]
 +
 
 +
<syntaxhighlight lang="python" line='line'>
 
avatar_list = RLPy.RScene.GetAvatars()
 
avatar_list = RLPy.RScene.GetAvatars()
 
avatar = avatar_list[0]
 
avatar = avatar_list[0]
+
 
# set transform value
 
# set transform value
 
control = avatar.GetControl("Transform")
 
control = avatar.GetControl("Transform")
Line 20: Line 27:
 
transform = RLPy.RTransform(scale, rot, pos)
 
transform = RLPy.RTransform(scale, rot, pos)
 
control.SetValue(RLPy.RTime(1000), transform)
 
control.SetValue(RLPy.RTime(1000), transform)
+
 
# get transform value
 
# get transform value
 
transform1 = RLPy.RTransform()
 
transform1 = RLPy.RTransform()
 
control.GetValue(RLPy.RTime(1000), transform1)
 
control.GetValue(RLPy.RTime(1000), transform1)
print(transform1.T().x) #2.0
+
print(transform1.T().x)   #2.0
print(transform1.T().y) #2.5
+
print(transform1.T().y)   #2.5
print(transform1.T().z) #4.0
+
print(transform1.T().z)   #4.0
 
</syntaxhighlight>
 
</syntaxhighlight>
==Member Functions==
 
===GetTransformKey===
 
<syntaxhighlight lang="Python">
 
RLPy.RTransformControl.GetTransformKey ( self, kTime, pKey )
 
</syntaxhighlight>
 
Get transform key by time.
 
====Parameters====
 
<div style="margin-left: 2em;">
 
  
'''kTime''' [IN] Specifies the time to set value - RLPy.RTime
+
== Member Functions ==
  
'''pKey''' [OUT] Pointer to a transform key whose value will be set - RLPy.RTransformKey
+
=== GetTransformKey ( self, kTime, pKey ) ===
</div>
+
====Return Values====
+
<div style="margin-left: 2em;">
+
  
'''RLPy.RStatus.Success''' Success
+
Get the Transform Key at a given point in time in this Transform Control.
  
'''RLPy.RStatus.Failure''' Fail
+
See Also: [[#GetTransformKeyAt ( self, uIndex, pKey )|GetTransformKeyAt]], [[IC_Python_API:RLPy_RTransformKey|RTransformKey]].
</div>
+
 
-----
+
==== Parameters ====
===GetTransformKeyAt===
+
:'''kTime''' [IN] Set the time for retrieving the Transform key - [[IC_Python_API:RLPy_RTime|RTime]]
<syntaxhighlight lang="Python">
+
:'''pKey''' [OUT] Set the object for getting the Transform key - [[IC_Python_API:RLPy_RTransformKey|RTransformKey]]
RLPy.RTransformControl.GetTransformKeyAt ( self, uIndex, pKey )
+
 
 +
==== Return ====
 +
:Success - RLPy.RStatus.Success
 +
:Failure - RLPy.RStatus.Failure
 +
 
 +
<syntaxhighlight lang="python" line='line'>
 +
# Get Transform Key
 +
transform_key = RLPy.RTransformKey()
 +
transform_control.GetTransformKey(RLPy.RTime(0), transform_key)
 
</syntaxhighlight>
 
</syntaxhighlight>
Get transform key by index.
 
====Parameters====
 
<div style="margin-left: 2em;">
 
  
'''uIndex''' [IN] Index of the key - int
+
=== GetTransformKeyAt ( self, uIndex, pKey ) ===
  
'''pKey''' [OUT] Pointer to a transform key whose value will be set - RLPy.RTransformKey
+
Get the Transform Key at a given index in this Transform Control.
</div>
+
====Return Values====
+
<div style="margin-left: 2em;">
+
  
'''RLPy.RStatus.Success''' Success
+
See Also: [[#GetTransformKey ( self, kTime, pKey )|GetTransformKey]], [[IC_Python_API:RLPy_RTransformKey|RTransformKey]].
  
'''RLPy.RStatus.Failure''' Fail
+
==== Parameters ====
</div>
+
:'''uIndex''' [IN] Specify the index value to get the transform key (starting from zero) - int
-----
+
:'''pKey''' [OUT] Entity variable for writing the retrieved Transform key - [[IC_Python_API:RLPy_RTransformKey|RTransformKey]]
===GetValue===
+
 
<syntaxhighlight lang="Python">
+
==== Return ====
RLPy.RTransformControl.GetValue ( self, kTime, kValue )
+
:Success - RLPy.RStatus.Success
 +
:Failure - RLPy.RStatus.Failure
 +
 
 +
<syntaxhighlight lang="python" line='line'>
 +
# Get Transform Key At
 +
transform_key = RLPy.RTransformKey()
 +
transform_control.GetTransformKeyAt(5, transform_key)
 
</syntaxhighlight>
 
</syntaxhighlight>
Get key value by time.
 
====Parameters====
 
<div style="margin-left: 2em;">
 
  
'''kTime''' [IN] Specifies the time to get value - RLPy.RTime
+
=== GetValue ( self, kTime, kValue ) ===
  
'''kValue''' [OUT] Value of the key - RLPy.RTransformf
+
Get the value of a Transform Key in this Transform Control at a given point in time.
</div>
+
====Return Values====
+
<div style="margin-left: 2em;">
+
  
'''RLPy.RStatus.Success''' Success
+
See Also: [[#SetValue ( self, kTime, kValue )|SetValue]]
  
'''RLPy.RStatus.Failure''' Fail
+
==== Parameters ====
</div>
+
:'''kTime''' [IN] Select the Transform key on a given time - [[IC_Python_API:RLPy_RTime|RTime]]
-----
+
:'''kValue''' [OUT] Entity variable for writing the Transform key value - [[IC_Python_API:RLPy_RTransform|RTransform]]
===SetValue===
+
 
<syntaxhighlight lang="Python">
+
==== Return ====
RLPy.RTransformControl.SetValue ( self, kTime, kValue )
+
:Success - RLPy.RStatus.Success
 +
:Failure - RLPy.RStatus.Failure
 +
 
 +
<syntaxhighlight lang="python" line='line'>
 +
# Get Value
 +
transform = RLPy.RTransform.IDENTITY
 +
transform_control.GetValue(RLPy.RTime(0), transform)  
 +
transform.T().x = 1.5
 
</syntaxhighlight>
 
</syntaxhighlight>
Set key value by time.
 
====Parameters====
 
<div style="margin-left: 2em;">
 
  
'''kTime''' [IN] Specifies the time to set value - RLPy.RTime
+
=== SetValue ( self, kTime, kValue ) ===
  
'''kValue''' [IN] Value of the key - RLPy.RTransformf
+
Set the value of a Transform Key in this Transform Control at a given point in time.
</div>
+
====Return Values====
+
<div style="margin-left: 2em;">
+
  
'''RLPy.RStatus.Success''' Success
+
See Also: [[#GetValue ( self, kTime, kValue )|GetValue]]
  
'''RLPy.RStatus.Failure''' Fail
+
==== Parameters ====
</div>
+
:'''kTime''' [IN] Select a Transform key on a given time - [[IC_Python_API:RLPy_RTime|RTime]]
 +
:'''kValue''' [OUT] Entity variable for writing the Transform key value - [[IC_Python_API:RLPy_RTransform|RTransform]]
 +
 
 +
==== Return ====
 +
:Success - RLPy.RStatus.Success
 +
:Failure - RLPy.RStatus.Failure
 +
 
 +
<syntaxhighlight lang="python" line='line'>
 +
# Set Value
 +
transform = RLPy.RTransform.IDENTITY
 +
transform.T().x = 1.5
 +
transform_control.SetValue(RLPy.RTime(0), transform)
 +
</syntaxhighlight>

Latest revision as of 23:31, 15 April 2020

Main article: Modules.
Last modified: 04/15/2020

Description

This class manages RTransformKey on the RTransform. RTransformControl can use GetValue, SetValue, GetTransformKey, and GetTransformKeyAt to access Transform Key values at a given point in time. It can also extrapolate the proper value between two keys.

See Also: RControl, RFloatControl, RTransformKey, RTransform.

Inheritance

RControl > RTransformControl 
 1 avatar_list = RLPy.RScene.GetAvatars()
 2 avatar = avatar_list[0]
 3  
 4 # set transform value
 5 control = avatar.GetControl("Transform")
 6 scale = RLPy.RVector3()
 7 rot = RLPy.RQuaternion.IDENTITY
 8 pos = RLPy.RVector3.UNIT_XYZ
 9 pos.x = 2
10 pos.y = 2.5
11 pos.z = 4
12 transform = RLPy.RTransform(scale, rot, pos)
13 control.SetValue(RLPy.RTime(1000), transform)
14  
15 # get transform value
16 transform1 = RLPy.RTransform()
17 control.GetValue(RLPy.RTime(1000), transform1)
18 print(transform1.T().x)    #2.0
19 print(transform1.T().y)    #2.5
20 print(transform1.T().z)    #4.0

Member Functions

GetTransformKey ( self, kTime, pKey )

Get the Transform Key at a given point in time in this Transform Control.

See Also: GetTransformKeyAt, RTransformKey.

Parameters

kTime [IN] Set the time for retrieving the Transform key - RTime
pKey [OUT] Set the object for getting the Transform key - RTransformKey

Return

Success - RLPy.RStatus.Success
Failure - RLPy.RStatus.Failure
1 # Get Transform Key
2 transform_key = RLPy.RTransformKey()
3 transform_control.GetTransformKey(RLPy.RTime(0), transform_key)

GetTransformKeyAt ( self, uIndex, pKey )

Get the Transform Key at a given index in this Transform Control.

See Also: GetTransformKey, RTransformKey.

Parameters

uIndex [IN] Specify the index value to get the transform key (starting from zero) - int
pKey [OUT] Entity variable for writing the retrieved Transform key - RTransformKey

Return

Success - RLPy.RStatus.Success
Failure - RLPy.RStatus.Failure
1 # Get Transform Key At
2 transform_key = RLPy.RTransformKey()
3 transform_control.GetTransformKeyAt(5, transform_key)

GetValue ( self, kTime, kValue )

Get the value of a Transform Key in this Transform Control at a given point in time.

See Also: SetValue

Parameters

kTime [IN] Select the Transform key on a given time - RTime
kValue [OUT] Entity variable for writing the Transform key value - RTransform

Return

Success - RLPy.RStatus.Success
Failure - RLPy.RStatus.Failure
1 # Get Value
2 transform = RLPy.RTransform.IDENTITY
3 transform_control.GetValue(RLPy.RTime(0), transform) 
4 transform.T().x = 1.5

SetValue ( self, kTime, kValue )

Set the value of a Transform Key in this Transform Control at a given point in time.

See Also: GetValue

Parameters

kTime [IN] Select a Transform key on a given time - RTime
kValue [OUT] Entity variable for writing the Transform key value - RTransform

Return

Success - RLPy.RStatus.Success
Failure - RLPy.RStatus.Failure
1 # Set Value
2 transform = RLPy.RTransform.IDENTITY
3 transform.T().x = 1.5
4 transform_control.SetValue(RLPy.RTime(0), transform)