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 |
||
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 | + | 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 === |
− | == | + | |
− | <syntaxhighlight lang=" | + | [[IC_Python_API:RLPy_RKey|RKey]] > [[IC_Python_API:RLPy_RTransformkey|RTransformkey]] |
− | RLPy.RTransformKey. | + | |
+ | <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> | ||
− | + | ||
− | + | 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]]. | |
− | ====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=" | + | |
− | RLPy.RTransformKey | + | ==== Parameters ==== |
+ | '''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> | ||
− | |||
− | |||
− | |||
− | |||
− |
Revision as of 23:06, 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)