Difference between revisions of "IC Python API:RLPy RTransformKey"
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.RKey ==Detailed...") |
Chuck (RL) (Talk | contribs) 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}} | ||
− | == | + | {{last_modified}} |
− | This class | + | |
− | + | == 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]] . | |
− | + | ||
− | == | + | === Inheritance === |
− | == | + | |
− | + | [[IC_Python_API:RLPy_RKey|RKey]] > [[IC_Python_API:RLPy_RTransformKey|RTransformKey]] | |
− | RLPy.RTransformKey. | + | |
+ | 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> | ||
− | + | ||
− | + | ||
− | ====Parameters==== | + | == Constructor == |
− | + | ||
− | '''kRhs''' [IN] | + | === __init__( self, args ) === |
− | + | ||
− | + | Create a new transform key object with an existing [[IC_Python_API:RLPy_RTransformKey|RTransformKey]] object. | |
− | + | ||
− | <syntaxhighlight lang=" | + | ==== Parameters ==== |
− | RLPy.RTransformKey | + | '''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> | ||
− | + | ||
− | ==== | + | == Member Functions == |
− | + | ||
− | + | === Clone ( self ) === | |
− | + | ||
− | === | + | Copy this transform key and return a new [[IC_Python_API:RLPy_RTransformKey|RTransformKey]] object. |
− | <syntaxhighlight lang=" | + | |
− | + | 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 | + | |
− | ====Returns==== | + | === GetTransform ( self ) === |
− | < | + | |
− | </ | + | Get the transform value for this transform key - [[IC_Python_API:RLPy_RTransform|RTransform]] |
− | + | ||
− | ===SetTransform=== | + | ==== Returns ==== |
− | <syntaxhighlight lang=" | + | The transform value - [[IC_Python_API:RLPy_RTransform|RTransform]] |
− | + | ||
+ | <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> | ||
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 22: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)