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

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.RKey ==Detailed...")
 
m
 
(3 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_RKey|RLPy.RKey]]
+
== Description  ==
==Detailed Description==
+
 
This class stores a transform key.
+
This class is used to access the transform value for a transform key.  It contains a [[IC_Python_API:RLPy_RTransform|RTransform]] member variable which can be read and written to via [[#GetTransform ( self )|GetTransform]] and [[#SetTransform ( self, kTransform )|SetTransform]]. This class is managed by [[IC_Python_API:RLPy_RTransformControl|RTransformControl]] which has the ability to create and delete [[IC_Python_API:RLPy_RTransformKey|RTransformKey]] .
It also stores animation related information such as transition type, transition strength, tangent type, etc.
+
 
==Constructor & Destructors==
+
=== Inheritance ===
===__init__===
+
 
<syntaxhighlight lang="Python">
+
[[IC_Python_API:RLPy_RKey|RKey]] > [[IC_Python_API:RLPy_RTransformKey|RTransformKey]]
RLPy.RTransformKey.__init__ ( self, args )
+
 
 +
See Also: [[IC_Python_API:RLPy_RKey|RKey]], [[IC_Python_API:RLPy_RFloatKey|RFloatKey]], [[IC_Python_API:RLPy_RFloatControl|RFloatControl]], [[IC_Python_API:RLPy_RTransformControl|RTransformControl]].
 +
 
 +
<syntaxhighlight lang="python" line='line'>
 +
# get avatar
 +
avatar_list = RLPy.RScene.GetAvatars()
 +
avatar = avatar_list[0]
 +
 
 +
# get transform control and transform key
 +
transform_control = avatar.GetControl("Transform")
 +
transform_key = RLPy.RTransformKey()
 +
transform_control.GetTransformKey(RLPy.RTime(0), transform_key)
 +
 
 +
# manipulate transform key
 +
transform = transform_key.GetTransform()
 +
transform.T().x += 1.0
 +
transform_key.SetTransform(transform)
 
</syntaxhighlight>
 
</syntaxhighlight>
The copy constructor of the class.
+
 
Initialize a new RTransformKey object with the values from another RTransformKey object.
+
 
====Parameters====
+
==  Constructor  ==
<div style="margin-left: 2em;">
+
 
'''kRhs''' [IN] The target RTransformKey object - RLPy.RTransformKey
+
===  __init__( self, args )  ===
</div>
+
 
==Member Functions==
+
Create a new transform key object with an existing [[IC_Python_API:RLPy_RTransformKey|RTransformKey]] object.
===Clone===
+
 
<syntaxhighlight lang="Python">
+
==== Parameters ====
RLPy.RTransformKey.Clone ( self )
+
'''kRhs''' [IN] A pre-existing transform key object - [[IC_Python_API:RLPy_RTransformKey|RTransformKey]]
 +
 
 +
<syntaxhighlight lang="python" line='line'>
 +
key = RLPy.RTransformKey(key1)
 
</syntaxhighlight>
 
</syntaxhighlight>
Clone RTransformKey object.
+
 
====Returns====
+
== Member Functions  ==
<div style="margin-left: 2em;">Pointer to the key - RLPy. RKey
+
 
</div>
+
=== Clone ( self )  ===
-----
+
 
===GetTransform===
+
Copy this transform key and return a new [[IC_Python_API:RLPy_RTransformKey|RTransformKey]] object.
<syntaxhighlight lang="Python">
+
 
RLPy.RTransformKey.GetTransform ( self )
+
See Also: [[#GetTransform ( self )|GetTransform]], [[#SetTransform ( self, kTransform )|SetTransform]]
 +
 
 +
====  Returns  ====
 +
New transform key object - [[IC_Python_API:RLPy_RTransformKey|RTransformKey]]
 +
 
 +
<syntaxhighlight lang="python" line='line'>
 +
# Clone RTransformKey
 +
cloned_key = transform_key.Clone()
 
</syntaxhighlight>
 
</syntaxhighlight>
Get transform of the key.
+
 
====Returns====
+
===  GetTransform ( self )  ===
<div style="margin-left: 2em;">The transform of the key - RLPy.RTransformf
+
 
</div>
+
Get the transform value for this transform key - [[IC_Python_API:RLPy_RTransform|RTransform]]
-----
+
 
===SetTransform===
+
==== Returns ====
<syntaxhighlight lang="Python">
+
The transform value - [[IC_Python_API:RLPy_RTransform|RTransform]]
RLPy.RTransformKey.SetTransform ( self, kTransform )
+
 
 +
<syntaxhighlight lang="python" line='line'>
 +
# Get Transform
 +
transform = transform_key.GetTransform()
 +
</syntaxhighlight>
 +
 
 +
=== SetTransform ( self, kTransform )  ===
 +
 
 +
Set the transform value for this transform key.
 +
 
 +
See Also: [[#Clone ( self )|Clone]], [[#GetTransform ( self )|GetTransform]]
 +
 
 +
====  Parameters  ====
 +
:'''kTransform''' [IN] transform - [[IC_Python_API:RLPy_RTransform|RTransform]]
 +
 
 +
<syntaxhighlight lang="python" line='line'>
 +
# Set Transform
 +
transform_key.SetTransform(transform)
 
</syntaxhighlight>
 
</syntaxhighlight>
Set transform of the key.
 
====Parameters====
 
<div style="margin-left: 2em;">
 
'''kTransform''' [IN] The transform of the key - RLPy.RTransformf
 
</div>
 

Latest revision as of 23:57, 6 August 2020

Main article: Modules. Last modified: 08/6/2020

Description

This class is used to access the transform value for a transform key. It contains a RTransform member variable which can be read and written to via GetTransform and SetTransform. This class is managed by RTransformControl which has the ability to create and delete RTransformKey .

Inheritance

RKey > RTransformKey 

See Also: RKey, RFloatKey, RFloatControl, RTransformControl.

 1 # get avatar
 2 avatar_list = RLPy.RScene.GetAvatars()
 3 avatar = avatar_list[0]
 4 
 5 # get transform control and transform key
 6 transform_control = avatar.GetControl("Transform")
 7 transform_key = RLPy.RTransformKey()
 8 transform_control.GetTransformKey(RLPy.RTime(0), transform_key)
 9 
10 # manipulate transform key
11 transform = transform_key.GetTransform()
12 transform.T().x += 1.0
13 transform_key.SetTransform(transform)


Constructor

__init__( self, args )

Create a new transform key object with an existing RTransformKey object.

Parameters

kRhs [IN] A pre-existing transform key object - RTransformKey

1 key = RLPy.RTransformKey(key1)

Member Functions

Clone ( self )

Copy this transform key and return a new RTransformKey object.

See Also: GetTransform, SetTransform

Returns

New transform key object - RTransformKey

1 # Clone RTransformKey
2 cloned_key = transform_key.Clone()

GetTransform ( self )

Get the transform value for this transform key - RTransform

Returns

The transform value - RTransform

1 # Get Transform
2 transform = transform_key.GetTransform()

SetTransform ( self, kTransform )

Set the transform value for this transform key.

See Also: Clone, GetTransform

Parameters

kTransform [IN] transform - RTransform
1 # Set Transform
2 transform_key.SetTransform(transform)