Difference between revisions of "IC Python API:RLPy RISkeletonComponent"
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.RIBase ==Detai...") |
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 == | |
− | == | + | |
− | + | [[File:Rlpy_riskeletoncomponent_01.png|frame|left|Motion bones are responsible for retargeting motion between different characters of different sizes and proportions.]] | |
− | + | ||
− | avatars | + | This class is mainly used to get all the bones, skeleton states, and animation clips inside an object. If the control object of this component is [[IC_Python_API:RLPy_RIAvatar|RIAvatar]], then the motion bones will be retrieved. For other objects, the skin bones will be returned. For avatars, the motion bones will be present mainly for retargeting purchases, which are also responsible for driving the skin bones. |
− | + | ||
− | + | === Inheritance === | |
− | + | ||
− | + | [[IC_Python_API:RLPy_RIBase|RIBase]]> [[IC_Python_API:RLPy_RISkeletonComponent|RISkeletonComponent]] | |
− | + | {{clear}} | |
− | + | ||
− | + | == Member Functions == | |
− | # | + | |
− | + | === GetClip ( self, uIndex ) === | |
− | print( | + | |
+ | Get the clip on the current object at the specified index. Currently, only works for body motion clips on the timeline for avatars and animation tracks for other object types. If the current object does not have a clip or if the index exceeds the number of existing clips then return '''None'''. | ||
+ | |||
+ | See also: [[IC_Python_API:RLPy_RIClip|RIClip]] | ||
+ | |||
+ | ==== Parameters ==== | ||
+ | :'''uIndex''' [IN] Index number for the Clip - integer | ||
+ | |||
+ | ==== Returns ==== | ||
+ | :The newly copied animation clip object - [[IC_Python_API:RLPy_RIClip|RIClip]] | ||
+ | |||
+ | <syntaxhighlight lang="python" line='line'> | ||
+ | # Get Clip | ||
+ | skeleton_component = avatar.GetSkeletonComponent() | ||
+ | print(skeleton_component.GetClip(0)) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | == | + | |
− | === | + | === GetClipCount ( self ) === |
− | <syntaxhighlight lang=" | + | |
− | + | Get the total clip count for the current object. Currently, only works for body motion clips on the timeline for avatars and animation tracks for other object types. If a clip does not exist then return 0. | |
+ | |||
+ | See also: [[IC_Python_API:RLPy_RIClip|RIClip]] | ||
+ | |||
+ | ==== Returns ==== | ||
+ | :The total number of clips in this skeleton component - integer | ||
+ | |||
+ | <syntaxhighlight lang="python" line='line'> | ||
+ | # Get Clip Count | ||
+ | skeleton_component = avatar.GetSkeletonComponent() | ||
+ | print(skeleton_component.GetClipCount()) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
− | |||
− | + | === GetMotionBones ( self ) === | |
− | + | ||
− | === | + | Get all of the motion bones for the current object. Currently, this function is only supported for avatars. Retargeting is applied to the motion bones, which is a unified skeleton for various characters. Motion bones are also responsible for driving skin bones. |
− | + | ||
− | + | See also: [[IC_Python_API:RLPy_RINode|RINode]] | |
− | + | ||
− | === | + | ==== Returns ==== |
− | <syntaxhighlight lang=" | + | :All of the motion bone nodes - [[IC_Python_API:RLPy_RINode|RINode]] list |
− | + | ||
+ | <syntaxhighlight lang="python" line='line'> | ||
+ | # Get Motion Bones | ||
+ | skeleton_component = avatar.GetSkeletonComponent() | ||
+ | motion_bones = skeleton_component.GetMotionBones() | ||
+ | print(len(motion_bones)) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | ||
− | === | + | === GetRootBone ( self ) === |
− | + | ||
− | + | Get the root bone of this skeleton component. | |
− | + | ||
− | === | + | See also: [[IC_Python_API:RLPy_RINode|RINode]] |
− | <syntaxhighlight lang=" | + | |
− | + | ==== Returns ==== | |
+ | :The root bone - [[IC_Python_API:RLPy_RINode|RINode]] | ||
+ | |||
+ | <syntaxhighlight lang="python" line='line'> | ||
+ | # Get Motion Bones | ||
+ | skeleton_component = avatar.GetSkeletonComponent() | ||
+ | root_bone = skeleton_component.GetRootBone() | ||
+ | print(root_bone.GetName()) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | Get | + | |
− | ====Returns==== | + | === GetSkinBones ( self ) === |
− | + | ||
− | + | Get the skin bones for the current object. Skin bones are the counterparts to the mesh skin, if this object is an avatar then the motion bones will drive the skin bones. | |
− | + | ||
− | + | See also: [[IC_Python_API:RLPy_RINode|RINode]] | |
− | <syntaxhighlight lang=" | + | |
− | + | ==== Returns ==== | |
+ | :All of the skin bone nodes - [[IC_Python_API:RLPy_RINode|RINode]] list | ||
+ | |||
+ | <syntaxhighlight lang="python" line='line'> | ||
+ | # Get Motion Bones | ||
+ | skeleton_component = avatar.GetSkeletonComponent() | ||
+ | motion_bones = skeleton_component.GetSkinBones() | ||
+ | print(len(motion_bones)) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | ||
− | === | + | === GetSelectedBones ( self ) === |
− | + | ||
− | + | Get all of the selected bones on the current object. If no bones are selected for the current character, then an empty list is returned. | |
− | + | ||
− | === | + | ==== Returns ==== |
− | <syntaxhighlight lang=" | + | :All of the currently selected bones - [[IC_Python_API:RLPy_RINode|RINode]] list |
− | + | ||
+ | <syntaxhighlight lang="python" line='line'> | ||
+ | # Get Motion Bones | ||
+ | skeleton_component = avatar.GetSkeletonComponent() | ||
+ | selected_bones = skeleton_component.GetSelectedBones() | ||
+ | print(len(selected_bones)) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | ||
− | === | + | === GetRootPositionRetargetingRatio ( self ) === |
− | + | ||
− | + | If the current object has motion bone retargeting, then get the position ratio (x, y, z) between the MotionRoot and SkinBoneRoot. If the current object is a prop then retargeting is not supported and (0, 0, 0) will be returned. | |
− | + | ||
− | === | + | ==== Returns ==== |
− | <syntaxhighlight lang=" | + | :The motion and skin bone root position ratio - [[IC_Python_API:RLPy_RVector3|RVector3]] |
− | + | ||
+ | <syntaxhighlight lang="python" line='line'> | ||
+ | # Get Motion Bones | ||
+ | skeleton_component = avatar.GetSkeletonComponent() | ||
+ | xyz_ratio = skeleton_component.GetRootPositionRetargetingRatio() | ||
+ | print(xyz_ratio.x) | ||
+ | print(xyz_ratio.y) | ||
+ | print(xyz_ratio.z) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
− | |||
− |
Latest revision as of 19:33, 29 April 2020
- Main article: Modules.
- Last modified: 04/29/2020
Description
This class is mainly used to get all the bones, skeleton states, and animation clips inside an object. If the control object of this component is RIAvatar, then the motion bones will be retrieved. For other objects, the skin bones will be returned. For avatars, the motion bones will be present mainly for retargeting purchases, which are also responsible for driving the skin bones.
Inheritance
RIBase> RISkeletonComponent
Member Functions
GetClip ( self, uIndex )
Get the clip on the current object at the specified index. Currently, only works for body motion clips on the timeline for avatars and animation tracks for other object types. If the current object does not have a clip or if the index exceeds the number of existing clips then return None.
See also: RIClip
Parameters
- uIndex [IN] Index number for the Clip - integer
Returns
- The newly copied animation clip object - RIClip
1 # Get Clip
2 skeleton_component = avatar.GetSkeletonComponent()
3 print(skeleton_component.GetClip(0))
GetClipCount ( self )
Get the total clip count for the current object. Currently, only works for body motion clips on the timeline for avatars and animation tracks for other object types. If a clip does not exist then return 0.
See also: RIClip
Returns
- The total number of clips in this skeleton component - integer
1 # Get Clip Count
2 skeleton_component = avatar.GetSkeletonComponent()
3 print(skeleton_component.GetClipCount())
GetMotionBones ( self )
Get all of the motion bones for the current object. Currently, this function is only supported for avatars. Retargeting is applied to the motion bones, which is a unified skeleton for various characters. Motion bones are also responsible for driving skin bones.
See also: RINode
Returns
- All of the motion bone nodes - RINode list
1 # Get Motion Bones
2 skeleton_component = avatar.GetSkeletonComponent()
3 motion_bones = skeleton_component.GetMotionBones()
4 print(len(motion_bones))
GetRootBone ( self )
Get the root bone of this skeleton component.
See also: RINode
Returns
- The root bone - RINode
1 # Get Motion Bones
2 skeleton_component = avatar.GetSkeletonComponent()
3 root_bone = skeleton_component.GetRootBone()
4 print(root_bone.GetName())
GetSkinBones ( self )
Get the skin bones for the current object. Skin bones are the counterparts to the mesh skin, if this object is an avatar then the motion bones will drive the skin bones.
See also: RINode
Returns
- All of the skin bone nodes - RINode list
1 # Get Motion Bones
2 skeleton_component = avatar.GetSkeletonComponent()
3 motion_bones = skeleton_component.GetSkinBones()
4 print(len(motion_bones))
GetSelectedBones ( self )
Get all of the selected bones on the current object. If no bones are selected for the current character, then an empty list is returned.
Returns
- All of the currently selected bones - RINode list
1 # Get Motion Bones
2 skeleton_component = avatar.GetSkeletonComponent()
3 selected_bones = skeleton_component.GetSelectedBones()
4 print(len(selected_bones))
GetRootPositionRetargetingRatio ( self )
If the current object has motion bone retargeting, then get the position ratio (x, y, z) between the MotionRoot and SkinBoneRoot. If the current object is a prop then retargeting is not supported and (0, 0, 0) will be returned.
Returns
- The motion and skin bone root position ratio - RVector3
1 # Get Motion Bones
2 skeleton_component = avatar.GetSkeletonComponent()
3 xyz_ratio = skeleton_component.GetRootPositionRetargetingRatio()
4 print(xyz_ratio.x)
5 print(xyz_ratio.y)
6 print(xyz_ratio.z)