Difference between revisions of "IC Python API:RLPy RIObject"

From Reallusion Wiki!
Jump to: navigation, search
(Created page with "{{TOC}} {{Parent|IC_Python_API:RL_Python_Modules|Modules}} This class inherits member functions from: RLPy.RIBase == Detailed Description == This...")
 
m
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{TOC}}
 
{{TOC}}
 
{{Parent|IC_Python_API:RL_Python_Modules|Modules}}
 
{{Parent|IC_Python_API:RL_Python_Modules|Modules}}
This class inherits member functions from:
+
{{last_modified}}
[[IC_Python_API:RLPy_RIBase|RLPy.RIBase]]
+
 
== Detailed Description ==
+
== Description ==
This class is the base class of the objects in the scene.
+
 
<syntaxhighlight lang="Python">
+
This class is used to access the bone node parameters in a character skeleton or object.  Retrievable parameters include name, ID, parent node, list of child nodes, and more.  Use [[#Update ( self )|Update]] to get the world-transform values of the bone node for the current point in time.
 +
 
 +
=== Inheritance ===
 +
 
 +
[[IC_Python_API:RLPy_RIBase|RIBase]] > [[IC_Python_API:RLPy_RIObject|RIObject]] > [[IC_Python_API:RLPy_RIAvatar|RIAvatar]] | [[IC_Python_API:RLPy_RICamera|RICamera]] | [[IC_Python_API:RLPy_RIParticle|RIParticle]] | [[IC_Python_API:RLPy_RIProp|RIProp]]  
 +
[[IC_Python_API:RLPy_RIObject|RIObject]] > [[IC_Python_API:RLPy_RILight|RILight]] > [[IC_Python_API:RLPy_RISpotLight|RISpotLight]] | [[IC_Python_API:RLPy_RIPointLight|RIPointLight]] | [[IC_Python_API:RLPy_RIDirectionalLight|RIDirectionalLight]]
 +
 
 +
=== Examples ===
 +
 
 +
<syntaxhighlight lang="python" line='line'>
 +
# Get root bone node
 
avatar_list = RLPy.RScene.GetAvatars()
 
avatar_list = RLPy.RScene.GetAvatars()
 
avatar = avatar_list[0]
 
avatar = avatar_list[0]
+
skeleton_component = avatar.GetSkeletonComponent()
# basic information
+
bone_node = skeleton_component.GetRootBone()
print(avatar.GetName())
+
</syntaxhighlight>
print(avatar.GetID())
+
print(avatar.GetType()) # RLPy.EObjectType_Avatar
+
+
# get control
+
transform_control = avatar.GetControl("Transform") # type RTransformControl
+
avatar_path_position_control = avatar.GetControl("PathPosition") # type RFloatControl
+
avatar_path_offset_control = avatar.GetControl("PathOffset") # type RTransformControl
+
  
#clone object
+
== Member Functions ==
clone_avatar = avatar.Clone()
+
print( clone_avatar )
+
  
#is selected
+
=== GetName ( self ) ===
RLPy.RScene.SelectObject(avatar)
+
 
print(avatar.IsSelected()) #True
+
Get the name of the bone node in a character skeleton or scene object.
</syntaxhighlight>
+
 
==Operators==
+
==== Returns ====
This class supports the following operators:
+
:Name of the bone node - str
{| class="wikitable"
+
 
!Member
+
<syntaxhighlight lang="python" line='line'>
!Operation
+
# Get root bone node
!Syntax
+
avatar_list = RLPy.RScene.GetAvatars()
!Description
+
avatar = avatar_list[0]
!Example
+
skeleton_component = avatar.GetSkeletonComponent()
|-
+
bone_node = skeleton_component.GetRootBone()
! scope="row"|__eq__
+
|Equality
+
|a == b
+
|If the values of two operands are equal, then the condition becomes true.
+
|(a == b) is not true.
+
|}
+
==Member Functions==
+
===Clone===
+
<syntaxhighlight lang="Python">
+
RLPy.RIObject.Clone ( self )
+
</syntaxhighlight>
+
Clones the object original and returns the clone.
+
<span style="background:#ffcccc">( Experimental API )</span>
+
====Return Values====
+
<div style="margin-left: 2em;">
+
  
'''cloned''' object.
+
# Get root bone name
</div>
+
bone_name = bone_node.GetName()
-----
+
print(bone_name)
===GetBounds===
+
<syntaxhighlight lang="Python">
+
RLPy.RIObject.GetBounds ( self, kMaxPoint, kCenterPoint, kMinPoint )
+
 
</syntaxhighlight>
 
</syntaxhighlight>
Get world bound of this object.
 
<span style="background:#ffcccc">( Experimental API )</span>
 
====Parameters====
 
<div style="margin-left: 2em;">
 
  
'''kMaxPoint''' [OUT] The maximal point of the box - RLPy.RVector3f
+
=== GetID ( self ) ===
  
'''kCenterPoint''' [OUT] The center of the bounding box - RLPy.RVector3f
+
Get the ID of the bone node in a character skeleton or scene object.
  
'''kMinPoint''' [OUT] The minimal point of the box - RLPy.RVector3f
+
==== Returns ====
</div>
+
:ID of the bone node - int
====Return Values====
+
<div style="margin-left: 2em;">
+
  
'''RLPy.RStatus.Success''' Success
+
<syntaxhighlight lang="python" line='line'>
 +
# Get root bone node
 +
avatar_list = RLPy.RScene.GetAvatars()
 +
avatar = avatar_list[0]
 +
skeleton_component = avatar.GetSkeletonComponent()
 +
bone_node = skeleton_component.GetRootBone()
  
'''RLPy.RStatus.Failure''' Fail
+
# Get root bone ID
</div>
+
bone_id = bone_node.GetID()
-----
+
print(bone_id)
===GetControl===
+
<syntaxhighlight lang="Python">
+
RLPy.RIObject.GetControl ( self, strKey )
+
 
</syntaxhighlight>
 
</syntaxhighlight>
Get control of the object.
 
====Parameters====
 
<div style="margin-left: 2em;">
 
  
'''strKey''' [IN] Key of the
+
=== GetParent ( self ) ===
controller, allowing use "Transform" to retrieve the transform control
+
 
of the Transform track, use "PathPosition" to retrieve the float control
+
Get the parent bone of the bone node in a character skeleton or scene object.  If a parent does not exist, then return '''None'''.
of Path position track, and use "PathOffset" to retrieve the transform
+
 
control of the Path Offset track, - string
+
See Also: [[#GetChildren ( self )|GetChildren]]
</div>
+
 
====Returns====
+
==== Returns ====
<div style="margin-left: 2em;">The specified control - RLPy.RControl
+
:Parent bone node - [[IC_Python_API:RLPy_RINode|RINode]]
</div>
+
:No parent bone node - None
-----
+
 
===GetID===
+
<syntaxhighlight lang="python" line='line'>
<syntaxhighlight lang="Python">
+
# Get root bone node
RLPy.RIObject.GetID ( self )
+
avatar_list = RLPy.RScene.GetAvatars()
</syntaxhighlight>
+
avatar = avatar_list[0]
Get unique id of the object.
+
skeleton_component = avatar.GetSkeletonComponent()
====Returns====
+
bone_node = skeleton_component.GetRootBone()
<div style="margin-left: 2em;">Object id - int
+
 
</div>
+
# Get root bone parent bone
-----
+
parent_bone = bone_node.GetParent()
===GetMeshNames===
+
print(parent_bone)
<syntaxhighlight lang="Python">
+
RLPy.RIObject.GetMeshNames ( self )
+
</syntaxhighlight>
+
Get all mesh names of the object.
+
====Returns====
+
<div style="margin-left: 2em;">Mesh name list - string
+
</div>
+
-----
+
===GetName===
+
<syntaxhighlight lang="Python">
+
RLPy.RIObject.GetName ( self )
+
</syntaxhighlight>
+
Get name of the object.
+
====Returns====
+
<div style="margin-left: 2em;">Object name - string
+
</div>
+
-----
+
===GetPivot===
+
<syntaxhighlight lang="Python">
+
RLPy.RIObject.GetPivot ( self, kPosition, kOrientation )
+
 
</syntaxhighlight>
 
</syntaxhighlight>
Get this object's pivot.
 
<span style="background:#ffcccc">( Experimental API )</span>
 
====Parameters====
 
<div style="margin-left: 2em;">
 
  
'''kPosition''' [OUT] current pivot position - RLPy.RVector3f
+
=== GetChildren ( self ) ===
  
'''kOrientation''' [OUT] current pivot orientation - RLPy.RVector3f
+
Get a list of child bones for a bone node in a character skeleton or scene object.  If this bone node does not have child bones, then return '''None'''.
</div>
+
====Return Values====
+
<div style="margin-left: 2em;">
+
  
'''RLPy.RStatus.Success''' Success
+
See Also: [[#GetParent ( self )|GetParent]]
  
'''RLPy.RStatus.Failure''' Fail
+
==== Returns ====
</div>
+
:List of child bone nodes - [[IC_Python_API:RLPy_RINode|RINode]] list
-----
+
:No child bones - None
===GetType===
+
 
<syntaxhighlight lang="Python">
+
<syntaxhighlight lang="python" line='line'>
RLPy.RIObject.GetType ( self )
+
# Get root bone node
</syntaxhighlight>
+
avatar_list = RLPy.RScene.GetAvatars()
Get object type of the object.
+
avatar = avatar_list[0]
====Returns====
+
skeleton_component = avatar.GetSkeletonComponent()
<div style="margin-left: 2em;">Object type - RLPy.EObjectType
+
bone_node = skeleton_component.GetRootBone()
*'''RLPy.EObjectType_Object'''
+
 
*'''RLPy.EObjectType_Avatar'''
+
# Get root bone children bone list
*'''RLPy.EObjectType_Prop'''
+
children_bone_list = bone_node.GetChildren()
*'''RLPy.EObjectType_Camera'''
+
print(children_bone_list)
*'''RLPy.EObjectType_Particle'''
+
*'''RLPy.EObjectType_Light'''
+
*'''RLPy.EObjectType_SpotLight'''
+
*'''RLPy.EObjectType_PointLight'''
+
*'''RLPy.EObjectType_DirectionalLight'''
+
</div>
+
-----
+
===IsSelected===
+
<syntaxhighlight lang="Python">
+
RLPy.RIObject.IsSelected ( self )
+
 
</syntaxhighlight>
 
</syntaxhighlight>
A Boolean value indicating whether the object is in the selected state.
 
<span style="background:#ffcccc">( Experimental API )</span>
 
====Return Values====
 
<div style="margin-left: 2em;">
 
  
'''selected''' or not
+
=== LocalTransform ( self ) ===
</div>
+
 
-----
+
Get the local-transform for a bone node in a character skeleton or scene object.
===LinkTo===
+
 
<syntaxhighlight lang="Python">
+
See Also: [[#WorldTransform ( self )|WorldTransform]]
RLPy.RIObject.LinkTo ( self, spTargetObject, kTime )
+
 
 +
==== Returns ====
 +
:Bone node local-transform - [[IC_Python_API:RLPy_RTransform|RTransform]]
 +
 
 +
<syntaxhighlight lang="python" line='line'>
 +
# Get root bone node
 +
avatar_list = RLPy.RScene.GetAvatars()
 +
avatar = avatar_list[0]
 +
skeleton_component = avatar.GetSkeletonComponent()
 +
bone_node = skeleton_component.GetRootBone()
 +
 
 +
# Get root bone local transform
 +
local_transform = bone_node.LocalTransform()
 +
print(local_transform)
 
</syntaxhighlight>
 
</syntaxhighlight>
Simultaneously move or rotate link target object and this object.
 
And allowed to link your object to another one at a specific point of
 
time. The Link never changes the Hierarchy Structure of the current
 
object. <span style="background:#ffcccc">( Experimental API )</span>
 
====Parameters====
 
<div style="margin-left: 2em;">
 
  
'''spTargetObject''' [IN] Link target object - RLPy.RIObject
+
=== WorldTransform ( self ) ===
  
'''kTime''' [IN] Time of link - RLPy.RTime
+
Get the world-transform for a bone node in a character skeleton or scene object.
</div>
+
====Return Values====
+
<div style="margin-left: 2em;">
+
  
'''RLPy.RStatus.Success''' Success
+
See Also: [[#LocalTransform ( self )|LocalTransform]]
  
'''RLPy.RStatus.Failure''' Fail
+
==== Returns ====
</div>
+
:Bone node world-transform - [[IC_Python_API:RLPy_RTransform|RTransform]]
-----
+
 
===LocalTransform===
+
<syntaxhighlight lang="python" line='line'>
<syntaxhighlight lang="Python">
+
# Get root bone node
RLPy.RIObject.LocalTransform ( self )
+
avatar_list = RLPy.RScene.GetAvatars()
</syntaxhighlight>
+
avatar = avatar_list[0]
Get local transform of the object.
+
skeleton_component = avatar.GetSkeletonComponent()
<span style="background:#ffcccc">( Experimental API )</span>
+
bone_node = skeleton_component.GetRootBone()
====Returns====
+
 
<div style="margin-left: 2em;">Object transform - RLPy.RTransformf
+
# Get root bone world transform
</div>
+
world_transform = bone_node.WorldTransform()
-----
+
print(world_transform)
===SetName===
+
<syntaxhighlight lang="Python">
+
RLPy.RIObject.SetName ( self, strName )
+
 
</syntaxhighlight>
 
</syntaxhighlight>
Set object's name.
 
<span style="background:#ffcccc">( Experimental API )</span>
 
====Parameters====
 
<div style="margin-left: 2em;">
 
  
'''strName''' [IN] object name - string
+
=== WorldToLocal ( self, kWorldMatrix ) ===
</div>
+
====Return Values====
+
<div style="margin-left: 2em;">
+
  
'''RLPy.RStatus.Success''' Success
+
Convert the world-transform matrix for a bone node in a character skeleton or scene object to local-transform matrix.
  
'''RLPy.RStatus.Failure''' Fail
+
See Also: [[#LocalToWorld ( self, kLocalMatrix )|LocalToWorld]]
</div>
+
 
-----
+
==== Parameters ====
===SetParent===
+
:'''kWorldMatrix''' [IN] Character bone node world-transform matrix - [[IC_Python_API:RLPy_RMatrix4|RMatrix4]]
<syntaxhighlight lang="Python">
+
 
RLPy.RIObject.SetParent ( self, args )
+
==== Returns ====
 +
:Bone node local-transform matrix - [[IC_Python_API:RLPy_RMatrix4|RMatrix4]]
 +
 
 +
<syntaxhighlight lang="python" line='line'>
 +
# Get root bone node
 +
avatar_list = RLPy.RScene.GetAvatars()
 +
avatar = avatar_list[0]
 +
skeleton_component = avatar.GetSkeletonComponent()
 +
bone_node = skeleton_component.GetRootBone()
 +
 
 +
# Transfer root bone world transform matrix to local transform matrix
 +
world_transform = bone_node.WorldTransform()
 +
world_matrix = world_transform.Matrix() 
 +
world_to_local = bone.WorldToLocal(world_matrix)
 +
print(world_to_local)
 
</syntaxhighlight>
 
</syntaxhighlight>
<span style="background:#ffcccc">( Experimental API )</span>
 
====Parameters====
 
<div style="margin-left: 2em;">
 
  
'''spParent''' [IN] If parent is null, this object will restore default parent - RLPy.RINode
+
=== LocalToWorld ( self, kLocalMatrix ) ===
</div>
+
 
====Returns====
+
Convert the local-transform matrix for a bone node in a character skeleton or scene object to world-transform matrix.
<div style="margin-left: 2em;">RStatus - RLPy.RStatus
+
 
</div>
+
See Also: [[#WorldToLocal ( self, kWorldMatrix )|WorldToLocal]]
-----
+
 
===UnLink===
+
==== Parameters ====
<syntaxhighlight lang="Python">
+
:'''kLocalMatrix''' [IN] Character bone node local-transform matrix - [[IC_Python_API:RLPy_RMatrix4|RMatrix4]]
RLPy.RIObject.UnLink ( self, kTime )
+
 
 +
==== Returns ====
 +
:Bone node world-transform matrix - [[IC_Python_API:RLPy_RMatrix4|RMatrix4]]
 +
 
 +
<syntaxhighlight lang="python" line='line'>
 +
# Get root bone node
 +
avatar_list = RLPy.RScene.GetAvatars()
 +
avatar = avatar_list[0]
 +
skeleton_component = avatar.GetSkeletonComponent()
 +
bone_node = skeleton_component.GetRootBone()
 +
 
 +
# Transfer root bone local transform matrix to world transform matrix
 +
local_transform = bone_node.LocalTransform()
 +
local_matrix = local_transform.Matrix()   
 +
local_to_world = bone.LocalToWorld(local_matrix)
 +
print(local_to_world)
 
</syntaxhighlight>
 
</syntaxhighlight>
Unlink object of time.
 
<span style="background:#ffcccc">( Experimental API )</span>
 
====Parameters====
 
<div style="margin-left: 2em;">
 
  
'''kTime''' [IN] Time of unlink - RLPy.RTime
+
=== Update ( self ) ===
</div>
+
 
====Return Values====
+
Update the Transform Control for a bone node in a character skelecton or scene object and update the scene.  After the [[#Update ( self )|Update]], the Transform Control's key values will reflect the world-transform values of the bone node for the current point in time.
<div style="margin-left: 2em;">
+
 
 +
<syntaxhighlight lang="python" line='line'>
 +
# Get root bone node
 +
avatar_list = RLPy.RScene.GetAvatars()
 +
avatar = avatar_list[0]
 +
skeleton_component = avatar.GetSkeletonComponent()
 +
bone_node = skeleton_component.GetRootBone()
 +
 
 +
# Get root bone child node world transform rotation x-axis value
 +
motion_bones = skeleton_component.GetMotionBones()
 +
child = motion_bones[1]
 +
child_world = child.WorldTransform()
 +
child_rot_x = child_world.R().x
 +
 
 +
# Set float control rotation x-axis value
 +
RLPy.RGlobal.SetTime(RLPy.RTime(0))
 +
animation_clip = skeleton_component.GetClip(0)
 +
root_control = animation_clip.GetControl("Layer", root)
 +
data_block = root_control.GetDataBlock()
 +
float_control_rotate_x = data_block.GetControl("Rotation/RotationX")
 +
float_control_rotate_x.SetValue(RLPy.RGlobal.GetTime(), math.radians(60))
  
'''RLPy.RStatus.Success''' Success
+
# Update root bone with float control
 +
bone_node.Update()
  
'''RLPy.RStatus.Failure''' Fail
+
# Get root bone child node world transform rotation x-axis value after updated
</div>
+
new_child_world = child.WorldTransform()
-----
+
after_update_child_rot_x = new_child_world.R().x
===WorldTransform===
+
<syntaxhighlight lang="Python">
+
RLPy.RIObject.WorldTransform ( self )
+
 
</syntaxhighlight>
 
</syntaxhighlight>
Get world transform of the object.
 
<span style="background:#ffcccc">( Experimental API )</span>
 
====Returns====
 
<div style="margin-left: 2em;">Object transform - RLPy.RTransformf
 
</div>
 

Latest revision as of 00:56, 15 April 2020

Main article: Modules.
Last modified: 04/15/2020

Description

This class is used to access the bone node parameters in a character skeleton or object. Retrievable parameters include name, ID, parent node, list of child nodes, and more. Use Update to get the world-transform values of the bone node for the current point in time.

Inheritance

RIBase > RIObject > RIAvatar | RICamera | RIParticle | RIProp 
RIObject > RILight > RISpotLight | RIPointLight | RIDirectionalLight 

Examples

1 # Get root bone node
2 avatar_list = RLPy.RScene.GetAvatars()
3 avatar = avatar_list[0]
4 skeleton_component = avatar.GetSkeletonComponent()
5 bone_node = skeleton_component.GetRootBone()

Member Functions

GetName ( self )

Get the name of the bone node in a character skeleton or scene object.

Returns

Name of the bone node - str
1 # Get root bone node
2 avatar_list = RLPy.RScene.GetAvatars()
3 avatar = avatar_list[0]
4 skeleton_component = avatar.GetSkeletonComponent()
5 bone_node = skeleton_component.GetRootBone()
6 
7 # Get root bone name
8 bone_name = bone_node.GetName()
9 print(bone_name)

GetID ( self )

Get the ID of the bone node in a character skeleton or scene object.

Returns

ID of the bone node - int
1 # Get root bone node
2 avatar_list = RLPy.RScene.GetAvatars()
3 avatar = avatar_list[0]
4 skeleton_component = avatar.GetSkeletonComponent()
5 bone_node = skeleton_component.GetRootBone()
6 
7 # Get root bone ID
8 bone_id = bone_node.GetID()
9 print(bone_id)

GetParent ( self )

Get the parent bone of the bone node in a character skeleton or scene object. If a parent does not exist, then return None.

See Also: GetChildren

Returns

Parent bone node - RINode
No parent bone node - None
1 # Get root bone node
2 avatar_list = RLPy.RScene.GetAvatars()
3 avatar = avatar_list[0]
4 skeleton_component = avatar.GetSkeletonComponent()
5 bone_node = skeleton_component.GetRootBone()
6 
7 # Get root bone parent bone
8 parent_bone = bone_node.GetParent()
9 print(parent_bone)

GetChildren ( self )

Get a list of child bones for a bone node in a character skeleton or scene object. If this bone node does not have child bones, then return None.

See Also: GetParent

Returns

List of child bone nodes - RINode list
No child bones - None
1 # Get root bone node
2 avatar_list = RLPy.RScene.GetAvatars()
3 avatar = avatar_list[0]
4 skeleton_component = avatar.GetSkeletonComponent()
5 bone_node = skeleton_component.GetRootBone()
6 
7 # Get root bone children bone list
8 children_bone_list = bone_node.GetChildren()
9 print(children_bone_list)

LocalTransform ( self )

Get the local-transform for a bone node in a character skeleton or scene object.

See Also: WorldTransform

Returns

Bone node local-transform - RTransform
1 # Get root bone node
2 avatar_list = RLPy.RScene.GetAvatars()
3 avatar = avatar_list[0]
4 skeleton_component = avatar.GetSkeletonComponent()
5 bone_node = skeleton_component.GetRootBone()
6 
7 # Get root bone local transform
8 local_transform = bone_node.LocalTransform()
9 print(local_transform)

WorldTransform ( self )

Get the world-transform for a bone node in a character skeleton or scene object.

See Also: LocalTransform

Returns

Bone node world-transform - RTransform
1 # Get root bone node
2 avatar_list = RLPy.RScene.GetAvatars()
3 avatar = avatar_list[0]
4 skeleton_component = avatar.GetSkeletonComponent()
5 bone_node = skeleton_component.GetRootBone()
6 
7 # Get root bone world transform
8 world_transform = bone_node.WorldTransform()
9 print(world_transform)

WorldToLocal ( self, kWorldMatrix )

Convert the world-transform matrix for a bone node in a character skeleton or scene object to local-transform matrix.

See Also: LocalToWorld

Parameters

kWorldMatrix [IN] Character bone node world-transform matrix - RMatrix4

Returns

Bone node local-transform matrix - RMatrix4
 1 # Get root bone node
 2 avatar_list = RLPy.RScene.GetAvatars()
 3 avatar = avatar_list[0]
 4 skeleton_component = avatar.GetSkeletonComponent()
 5 bone_node = skeleton_component.GetRootBone()
 6 
 7 # Transfer root bone world transform matrix to local transform matrix
 8 world_transform = bone_node.WorldTransform()
 9 world_matrix = world_transform.Matrix()  
10 world_to_local = bone.WorldToLocal(world_matrix)
11 print(world_to_local)

LocalToWorld ( self, kLocalMatrix )

Convert the local-transform matrix for a bone node in a character skeleton or scene object to world-transform matrix.

See Also: WorldToLocal

Parameters

kLocalMatrix [IN] Character bone node local-transform matrix - RMatrix4

Returns

Bone node world-transform matrix - RMatrix4
 1 # Get root bone node
 2 avatar_list = RLPy.RScene.GetAvatars()
 3 avatar = avatar_list[0]
 4 skeleton_component = avatar.GetSkeletonComponent()
 5 bone_node = skeleton_component.GetRootBone()
 6 
 7 # Transfer root bone local transform matrix to world transform matrix
 8 local_transform = bone_node.LocalTransform()
 9 local_matrix = local_transform.Matrix()     
10 local_to_world = bone.LocalToWorld(local_matrix)
11 print(local_to_world)

Update ( self )

Update the Transform Control for a bone node in a character skelecton or scene object and update the scene. After the Update, the Transform Control's key values will reflect the world-transform values of the bone node for the current point in time.

 1 # Get root bone node
 2 avatar_list = RLPy.RScene.GetAvatars()
 3 avatar = avatar_list[0]
 4 skeleton_component = avatar.GetSkeletonComponent()
 5 bone_node = skeleton_component.GetRootBone()
 6 
 7 # Get root bone child node world transform rotation x-axis value
 8 motion_bones = skeleton_component.GetMotionBones()
 9 child = motion_bones[1]
10 child_world = child.WorldTransform()
11 child_rot_x = child_world.R().x
12 
13 # Set float control rotation x-axis value
14 RLPy.RGlobal.SetTime(RLPy.RTime(0))
15 animation_clip = skeleton_component.GetClip(0)
16 root_control = animation_clip.GetControl("Layer", root)
17 data_block = root_control.GetDataBlock()
18 float_control_rotate_x = data_block.GetControl("Rotation/RotationX")
19 float_control_rotate_x.SetValue(RLPy.RGlobal.GetTime(), math.radians(60))
20 
21 # Update root bone with float control
22 bone_node.Update()
23 
24 # Get root bone child node world transform rotation x-axis value after updated
25 new_child_world = child.WorldTransform()
26 after_update_child_rot_x = new_child_world.R().x