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

From Reallusion Wiki!
Jump to: navigation, search
m
m
Line 5: Line 5:
 
==  Description  ==
 
==  Description  ==
  
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]] .
+
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]] .
  
 
=== Inheritance ===
 
=== Inheritance ===
  
  [[IC_Python_API:RLPy_RKey|RKey]] > [[IC_Python_API:RLPy_RTransformkey|RTransformkey]]  
+
  [[IC_Python_API:RLPy_RKey|RKey]] > [[IC_Python_API:RLPy_RTransformKey|RTransformKey]]  
  
 
<syntaxhighlight lang="python" line='line'>
 
<syntaxhighlight lang="python" line='line'>
Line 33: Line 33:
 
===  __init__( self, args )  ===
 
===  __init__( self, args )  ===
  
Create a new transform key object with an existing [[IC_Python_API:RLPy_RTransformkey|RTransformkey]] object.
+
Create a new transform key object with an existing [[IC_Python_API:RLPy_RTransformKey|RTransformKey]] object.
  
 
====  Parameters  ====
 
====  Parameters  ====
'''kRhs''' [IN] A pre-existing transform key object - [[IC_Python_API:RLPy_RTransformkey|RTransformkey]]  
+
'''kRhs''' [IN] A pre-existing transform key object - [[IC_Python_API:RLPy_RTransformKey|RTransformKey]]  
  
 
<syntaxhighlight lang="python" line='line'>
 
<syntaxhighlight lang="python" line='line'>
Line 46: Line 46:
 
===  Clone ( self )  ===
 
===  Clone ( self )  ===
  
Copy this transform key and return a new [[IC_Python_API:RLPy_RTransformkey|RTransformkey]] object.
+
Copy this transform key and return a new [[IC_Python_API:RLPy_RTransformKey|RTransformKey]] object.
  
 
See Also: [[#GetTransform ( self )|GetTransform]], [[#SetTransform ( self, kTransform )|SetTransform]]
 
See Also: [[#GetTransform ( self )|GetTransform]], [[#SetTransform ( self, kTransform )|SetTransform]]
  
 
====  Returns  ====
 
====  Returns  ====
New transform key object - [[IC_Python_API:RLPy_RTransformkey|RTransformkey]]  
+
New transform key object - [[IC_Python_API:RLPy_RTransformKey|RTransformKey]]  
  
 
<syntaxhighlight lang="python" line='line'>
 
<syntaxhighlight lang="python" line='line'>

Revision as of 23:09, 15 April 2020

Main article: Modules.
Last modified: 04/15/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 
 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)

See Also: RKey, RFloatkey, RFloatControl, RTransformControl.

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)