IC Python API:RLPy RTransformKey
- 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)