IC Python API:RLPy RTransformControl
From Reallusion Wiki!
Revision as of 02:22, 15 April 2020 by Chuck (RL) (Talk | contribs)
Contents
- Main article: Modules.
- Last modified: 04/15/2020
Description
This class manages RTransformkey on the RTransform. RTransformControl can use GetValue, SetValue, GetTransformKey, and GetTransformKeyAt to access Transform Key values at a given point in time. It can also extrapolate the proper value between two keys.
See Also: RControl, RFloatControl, RTransformkey, RTransform.
Inheritance
RControl > RTransformControl
1 avatar_list = RLPy.RScene.GetAvatars()
2 avatar = avatar_list[0]
3
4 # set transform value
5 control = avatar.GetControl("Transform")
6 scale = RLPy.RVector3()
7 rot = RLPy.RQuaternion.IDENTITY
8 pos = RLPy.RVector3.UNIT_XYZ
9 pos.x = 2
10 pos.y = 2.5
11 pos.z = 4
12 transform = RLPy.RTransform(scale, rot, pos)
13 control.SetValue(RLPy.RTime(1000), transform)
14
15 # get transform value
16 transform1 = RLPy.RTransform()
17 control.GetValue(RLPy.RTime(1000), transform1)
18 print(transform1.T().x) #2.0
19 print(transform1.T().y) #2.5
20 print(transform1.T().z) #4.0
Member Functions
GetTransformKey ( self, kTime, pKey )
Get the Transform Key at a given point in time in this Transform Control.
See Also: GetTransformKeyAt, RTransformkey.
Parameters
- kTime [IN] Set the time for retrieving the Transform key - RTime
- pKey [OUT] Set the object for getting the Transform key - RTransformkey
Return
- Success - RLPy.RStatus.Success
- Failure - RLPy.RStatus.Failure
1 # Get Transform Key
2 transform_key = RLPy.RTransformKey()
3 transform_control.GetTransformKey(RLPy.RTime(0), transform_key)
GetTransformKeyAt ( self, uIndex, pKey )
Get the Transform Key at a given index in this Transform Control.
See Also: GetTransformKey, RTransformkey.
Parameters
- uIndex [IN] Specify the index value to get the transform key (starting from zero) - int
- pKey [OUT] Entity variable for writing the retrieved Transform key - RTransformkey
Return
- Success - RLPy.RStatus.Success
- Failure - RLPy.RStatus.Failure
1 # Get Transform Key At
2 transform_key = RLPy.RTransformKey()
3 transform_control.GetTransformKeyAt(5, transform_key)
GetValue ( self, kTime, kValue )
Get the value of a Transform Key in this Transform Control at a given point in time.
See Also: SetValue
Parameters
- kTime [IN] Select the Transform key on a given time - RTime
- kValue [OUT] Entity variable for writing the Transform key value - RTransform
Return
- Success - RLPy.RStatus.Success
- Failure - RLPy.RStatus.Failure
1 # Get Value
2 transform = RLPy.RTransform.IDENTITY
3 transform_control.GetValue(RLPy.RTime(0), transform)
4 transform.T().x = 1.5
SetValue ( self, kTime, kValue )
Set the value of a Transform Key in this Transform Control at a given point in time.
See Also: GetValue
Parameters
- kTime [IN] Select a Transform key on a given time - RTime
- kValue [OUT] Entity variable for writing the Transform key value - RTransform
Return
- Success - RLPy.RStatus.Success
- Failure - RLPy.RStatus.Failure
1 # Set Value
2 transform = RLPy.RTransform.IDENTITY
3 transform.T().x = 1.5
4 transform_control.SetValue(RLPy.RTime(0), transform)