Difference between revisions of "IC Python API:RLPy RTransformControl"
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.RControl ==D...") |
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 == | |
− | == | + | |
− | RTransformControl | + | 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 Keys values at a given point in time. It can also extrapolate the proper value between two keys. |
− | <syntaxhighlight lang=" | + | |
+ | 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 === | ||
+ | |||
+ | [[IC_Python_API:RLPy_RControl|RControl]] > [[IC_Python_API:RLPy_RTransformControl|RTransformControl]] | ||
+ | |||
+ | <syntaxhighlight lang="python" line='line'> | ||
avatar_list = RLPy.RScene.GetAvatars() | avatar_list = RLPy.RScene.GetAvatars() | ||
avatar = avatar_list[0] | avatar = avatar_list[0] | ||
− | + | ||
# set transform value | # set transform value | ||
control = avatar.GetControl("Transform") | control = avatar.GetControl("Transform") | ||
Line 20: | Line 27: | ||
transform = RLPy.RTransform(scale, rot, pos) | transform = RLPy.RTransform(scale, rot, pos) | ||
control.SetValue(RLPy.RTime(1000), transform) | control.SetValue(RLPy.RTime(1000), transform) | ||
− | + | ||
# get transform value | # get transform value | ||
transform1 = RLPy.RTransform() | transform1 = RLPy.RTransform() | ||
control.GetValue(RLPy.RTime(1000), transform1) | control.GetValue(RLPy.RTime(1000), transform1) | ||
− | print(transform1.T().x) #2.0 | + | print(transform1.T().x) #2.0 |
− | print(transform1.T().y) #2.5 | + | print(transform1.T().y) #2.5 |
− | print(transform1.T().z) #4.0 | + | print(transform1.T().z) #4.0 |
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | == Member Functions == | |
− | + | === GetTransformKey ( self, kTime, pKey ) === | |
− | + | ||
− | === | + | |
− | + | ||
− | + | Get the Transform Key at a given point in time in this Transform Control. | |
− | ''' | + | See Also: [[#GetTransformKeyAt ( self, uIndex, pKey )|GetTransformKeyAt]], [[IC_Python_API:RLPy_RTransformkey|RTransformkey]]. |
− | + | ||
− | + | ==== Parameters ==== | |
− | === | + | :'''kTime''' [IN] Set the time for retrieving the Transform key - [[IC_Python_API:RLPy_RTime|RTime]] |
− | <syntaxhighlight lang=" | + | :'''pKey''' [OUT] Set the object for getting the Transform key - [[IC_Python_API:RLPy_RTransformkey|RTransformkey]] |
− | RLPy. | + | |
+ | ==== Return ==== | ||
+ | :Success - RLPy.RStatus.Success | ||
+ | :Failure - RLPy.RStatus.Failure | ||
+ | |||
+ | <syntaxhighlight lang="python" line='line'> | ||
+ | # Get Transform Key | ||
+ | transform_key = RLPy.RTransformKey() | ||
+ | transform_control.GetTransformKey(RLPy.RTime(0), transform_key) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
− | |||
− | + | === GetTransformKeyAt ( self, uIndex, pKey ) === | |
− | + | Get the Transform Key at a given index in this Transform Control. | |
− | + | ||
− | + | ||
− | + | ||
− | + | See Also: [[#GetTransformKey ( self, kTime, pKey )|GetTransformKey]], [[IC_Python_API:RLPy_RTransformkey|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 - [[IC_Python_API:RLPy_RTransformkey|RTransformkey]] |
− | === | + | |
− | <syntaxhighlight lang=" | + | ==== Return ==== |
− | RLPy. | + | :Success - RLPy.RStatus.Success |
+ | :Failure - RLPy.RStatus.Failure | ||
+ | |||
+ | <syntaxhighlight lang="python" line='line'> | ||
+ | # Get Transform Key At | ||
+ | transform_key = RLPy.RTransformKey() | ||
+ | transform_control.GetTransformKeyAt(5, transform_key) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
− | |||
− | + | === GetValue ( self, kTime, kValue ) === | |
− | + | Get the value of a Transform Key in this Transform Control at a given point in time. | |
− | + | ||
− | + | ||
− | + | ||
− | + | See Also: [[#SetValue ( self, kTime, kValue )|SetValue]] | |
− | ''' | + | ==== Parameters ==== |
− | + | :'''kTime''' [IN] Select the Transform key on a given time - [[IC_Python_API:RLPy_RTime|RTime]] | |
− | + | :'''kValue''' [OUT] Entity variable for writing the Transform key value - [[IC_Python_API:RLPy_RTransform|RTransform]] | |
− | === | + | |
− | <syntaxhighlight lang=" | + | ==== Return ==== |
− | RLPy. | + | :Success - RLPy.RStatus.Success |
+ | :Failure - RLPy.RStatus.Failure | ||
+ | |||
+ | <syntaxhighlight lang="python" line='line'> | ||
+ | # Get Value | ||
+ | transform = RLPy.RTransform.IDENTITY | ||
+ | transform_control.GetValue(RLPy.RTime(0), transform) | ||
+ | transform.T().x = 1.5 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
− | |||
− | + | === SetValue ( self, kTime, kValue ) === | |
− | + | Set the value of a Transform Key in this Transform Control at a given point in time. | |
− | + | ||
− | + | ||
− | + | ||
− | + | See Also: [[#GetValue ( self, kTime, kValue )|GetValue]] | |
− | '''RLPy.RStatus.Failure'' | + | ==== Parameters ==== |
− | </ | + | :'''kTime''' [IN] Select a Transform key on a given time - [[IC_Python_API:RLPy_RTime|RTime]] |
+ | :'''kValue''' [OUT] Entity variable for writing the Transform key value - [[IC_Python_API:RLPy_RTransform|RTransform]] | ||
+ | |||
+ | ==== Return ==== | ||
+ | :Success - RLPy.RStatus.Success | ||
+ | :Failure - RLPy.RStatus.Failure | ||
+ | |||
+ | <syntaxhighlight lang="python" line='line'> | ||
+ | # Set Value | ||
+ | transform = RLPy.RTransform.IDENTITY | ||
+ | transform.T().x = 1.5 | ||
+ | transform_control.SetValue(RLPy.RTime(0), transform) | ||
+ | </syntaxhighlight> |
Revision as of 02:21, 15 April 2020
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 Keys 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)