Difference between revisions of "IC Python API:RLPy RTransformControl"
From Reallusion Wiki!
Chuck (RL) (Talk | contribs) m |
Chuck (RL) (Talk | contribs) m |
||
Line 5: | Line 5: | ||
== Description == | == Description == | ||
− | This class manages [[IC_Python_API: | + | This class manages [[IC_Python_API:RLPy_RTransformKey|RTransformKey]] on the [[IC_Python_API:RLPy_RTransform|RTransform]]. [[IC_Python_API:RLPy_RTransformControl|RTransformControl]] can use [[#GetValue ( self, kTime, kValue )|GetValue]], [[#SetValue ( self, kTime, kValue )|SetValue]], [[#GetTransformKey ( self, kTime, pKey )|GetTransformKey]], and [[#GetTransformKeyAt ( self, uIndex, pKey )|GetTransformKeyAt]] to access Transform Key values at a given point in time. It can also extrapolate the proper value between two keys. |
− | See Also: [[IC_Python_API:RLPy_RControl|RControl]], [[IC_Python_API:RLPy_RFloatControl|RFloatControl]], [[IC_Python_API: | + | See Also: [[IC_Python_API:RLPy_RControl|RControl]], [[IC_Python_API:RLPy_RFloatControl|RFloatControl]], [[IC_Python_API:RLPy_RTransformKey|RTransformKey]], [[IC_Python_API:RLPy_RTransform|RTransform]]. |
=== Inheritance === | === Inheritance === | ||
Line 42: | Line 42: | ||
Get the Transform Key at a given point in time in this Transform Control. | Get the Transform Key at a given point in time in this Transform Control. | ||
− | See Also: [[#GetTransformKeyAt ( self, uIndex, pKey )|GetTransformKeyAt]], [[IC_Python_API: | + | See Also: [[#GetTransformKeyAt ( self, uIndex, pKey )|GetTransformKeyAt]], [[IC_Python_API:RLPy_RTransformKey|RTransformKey]]. |
==== Parameters ==== | ==== Parameters ==== | ||
:'''kTime''' [IN] Set the time for retrieving the Transform key - [[IC_Python_API:RLPy_RTime|RTime]] | :'''kTime''' [IN] Set the time for retrieving the Transform key - [[IC_Python_API:RLPy_RTime|RTime]] | ||
− | :'''pKey''' [OUT] Set the object for getting the Transform key - [[IC_Python_API: | + | :'''pKey''' [OUT] Set the object for getting the Transform key - [[IC_Python_API:RLPy_RTransformKey|RTransformKey]] |
==== Return ==== | ==== Return ==== | ||
Line 62: | Line 62: | ||
Get the Transform Key at a given index in this Transform Control. | Get the Transform Key at a given index in this Transform Control. | ||
− | See Also: [[#GetTransformKey ( self, kTime, pKey )|GetTransformKey]], [[IC_Python_API: | + | See Also: [[#GetTransformKey ( self, kTime, pKey )|GetTransformKey]], [[IC_Python_API:RLPy_RTransformKey|RTransformKey]]. |
==== Parameters ==== | ==== Parameters ==== | ||
:'''uIndex''' [IN] Specify the index value to get the transform key (starting from zero) - int | :'''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 - [[IC_Python_API: | + | :'''pKey''' [OUT] Entity variable for writing the retrieved Transform key - [[IC_Python_API:RLPy_RTransformKey|RTransformKey]] |
==== Return ==== | ==== Return ==== |
Latest revision as of 00:31, 16 April 2020
Contents
- Main article: Modules.
- Last modified: 04/16/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)