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

From Reallusion Wiki!
Jump to: navigation, search
(Created page with "{{TOC}} {{Parent|IC_Python_API:RL_Python_Modules|Modules}} ==Inheritance== This class inherits public member functions from: *RLPy.RIBase ==Detai...")
 
m
 
(One intermediate revision 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}}
==Inheritance==
+
{{last_modified}}
This class inherits public member functions from:
+
 
*[[IC_Python_API:RLPy_RIBase|RLPy.RIBase]]
+
== Description ==
==Detailed Description==
+
 
This class is the interface to the face key in the avatar.
+
This class primarily manages IK skeleton controls.  This component can adjust [[#EHikEffector|EHikEffector]] for various body parts i.e. '''RLPy.EHikEffector_LeftHand'''.  [[#ProcessEffector ( )|ProcessEffector]] can be used move different parts of the body IK.
<span style="background:#ffcccc">( Experimental Class )</span> <syntaxhighlight lang="Python">
+
 
# Get face component
+
See Also: [[#EHikEffector|EHikEffector]], [[#ProcessEffector ( )|ProcessEffector]]
 +
 
 +
=== Inheritance ===
 +
 
 +
[[IC_Python_API:RLPy_RIBase|RIBase]] > [[IC_Python_API:RLPy_RIHikEffectorComponent|RIHikEffectorComponent]]  
 +
 
 +
== Related Enumerations ==
 +
 
 +
=== EHikEffector ===
 +
 
 +
{|class="wikitable"
 +
!IK Effector Type
 +
!Description
 +
|-
 +
|RLPy.EHikEffector_Invalid
 +
|Invalid
 +
|-
 +
|RLPy.EHikEffector_LeftHand
 +
|Left Hand
 +
|-
 +
|RLPy.EHikEffector_LeftElbow
 +
|Left Elbow
 +
|-
 +
|RLPy.EHikEffector_LeftShoulder
 +
|Left Shoulder
 +
|-
 +
|RLPy.EHikEffector_RightHand
 +
|Right Hand
 +
|-
 +
|RLPy.EHikEffector_RightElbow
 +
|Right Elbow
 +
|-
 +
|RLPy.EHikEffector_RightShoulder
 +
|Right Shoulder
 +
|-
 +
|RLPy.EHikEffector_LeftFoot
 +
|Left Foot
 +
|-
 +
|RLPy.EHikEffector_LeftKnee
 +
|Left Knee
 +
|-
 +
|RLPy.EHikEffector_LeftHip
 +
|Left Hip
 +
|-
 +
|RLPy.EHikEffector_RightFoot
 +
|Right Foot
 +
|-
 +
|RLPy.EHikEffector_RightKnee
 +
|Right Knee
 +
|-
 +
|RLPy.EHikEffector_RightHip
 +
|Right Hip
 +
|-
 +
|RLPy.EHikEffector_Hip
 +
|Hip
 +
|-
 +
|RLPy.EHikEffector_Head
 +
|Head
 +
|-
 +
|RLPy.EHikEffector_Neck
 +
|Neck
 +
|-
 +
|RLPy.EHikEffector_ChestOrigin
 +
|Chest Origin
 +
|-
 +
|RLPy.EHikEffector_LeftToe
 +
|Left Toe
 +
|-
 +
|RLPy.EHikEffector_RightToe
 +
|RightToe
 +
|-
 +
|RLPy.EHikEffector_LeftFingerBase
 +
|Left Finger Base
 +
|-
 +
|RLPy.EHikEffector_RightFingerBase
 +
|Right Finger Base
 +
|-
 +
|RLPy.EHikEffector_LeftHandThumb
 +
|Left Hand Thumb
 +
|-
 +
|RLPy.EHikEffector_LeftHandIndex
 +
|Left Hand Index
 +
|-
 +
|RLPy.EHikEffector_LeftHandMiddle
 +
|Left Hand Middle
 +
|-
 +
|RLPy.EHikEffector_LeftHandRing
 +
|Left Hand Ring
 +
|-
 +
|RLPy.EHikEffector_LeftHandPinky
 +
|Left Hand Pinky
 +
|-
 +
|RLPy.EHikEffector_LeftHandExtraFinger
 +
|Left Hand Extra Finger
 +
|-
 +
|RLPy.EHikEffector_RightHandThumb
 +
|Right Hand Thumb
 +
|-
 +
|RLPy.EHikEffector_RightHandIndex
 +
|Right Hand Index
 +
|-
 +
|RLPy.EHikEffector_RightHandMiddle
 +
|Right Hand Middle
 +
|-
 +
|RLPy.EHikEffector_RightHandRing
 +
|Right Hand Ring
 +
|-
 +
|RLPy.EHikEffector_RightHandPinky
 +
|Right Hand Pinky
 +
|-
 +
|RLPy.EHikEffector_RightHandExtraFinger
 +
|Right Hand Extra Finger
 +
|-
 +
|RLPy.EHikEffector_LeftFootThumb
 +
|Left Foot Thumb
 +
|-
 +
|RLPy.EHikEffector_LeftFootIndex
 +
|Left Foot Index
 +
|-
 +
|RLPy.EHikEffector_LeftFootMiddle
 +
|Left Foot Middle
 +
|-
 +
|RLPy.EHikEffector_LeftFootRing
 +
|Left Foot Ring
 +
|-
 +
|RLPy.EHikEffector_LeftFootPinky
 +
|Left Foot Pinky
 +
|-
 +
|RLPy.EHikEffector_LeftFootExtraFinger
 +
|Left Foot Extra Finger
 +
|-
 +
|RLPy.EHikEffector_RightFootThumb
 +
|Right Foot Thumb
 +
|-
 +
|RLPy.EHikEffector_RightFootIndex
 +
|Right Foot Index
 +
|-
 +
|RLPy.EHikEffector_RightFootMiddle
 +
|Right Foot Middle
 +
|-
 +
|RLPy.EHikEffector_RightFootRing
 +
|Right Foot Ring
 +
|-
 +
|RLPy.EHikEffector_RightFootPinky
 +
|Right Foot Pinky
 +
|-
 +
|RLPy.EHikEffector_RightFootExtraFinger
 +
|Right Foot Extra Finger
 +
|-
 +
|RLPy.EHikEffector_Quantity
 +
|Quantity
 +
|}
 +
 
 +
=== EHikEffectorType ===
 +
 
 +
{|class="wikitable"
 +
!IK Effector Activation Type
 +
!Description
 +
|-
 +
|EHikEffectorType_Translate
 +
|Translate
 +
|-
 +
|EHikEffectorType_Rotate
 +
|Rotate
 +
|}
 +
 
 +
== Member Functions ==
 +
 
 +
=== SetActive ( self, eEffector, eType, bActive ) ===
 +
 
 +
Set the translational or rotational active state for a given IK effector.
 +
 
 +
See Also: [[#GetActive ( self, eEffector, eType )|GetActive]]
 +
 
 +
==== Parameters ====
 +
:'''eEffector''' [IN] IK effector on different parts of the character - [[#EHikEffector|EHikEffector]]
 +
:'''eType''' [IN] Set activation type as either translational or rotational - [[#EHikEffectorType|EHikEffectorType]]
 +
:'''bActive''' [IN] Activate or deactivate the IK effector - bool
 +
 
 +
==== Return ====
 +
:Success - RLPy.RStatus.Success
 +
:Failure - RLPy.RStatus.Failure
 +
 
 +
<syntaxhighlight lang="python" line='line'>
 +
# Get human IK component
 
avatar_list = RLPy.RScene.GetAvatars()
 
avatar_list = RLPy.RScene.GetAvatars()
 
avatar = avatar_list[0]
 
avatar = avatar_list[0]
face_component = avatar.GetFaceComponent()
+
hik_effector_component = avatar.GetHikEffectorComponent()
  
# Add facial clip
+
# Activate left hand effector
time = RLPy.RGlobal.GetTime()
+
hik_effector_component.SetActive(
clip_name = "New Clip"
+
RLPy.EHikEffector_LeftHand, RLPy.EHikEffectorType_Translate, True)
clip_length = RLPy.RTime(50)
+
hik_effector_component.SetActive(
result = face_component.AddClip(time, clip_name, clip_length)
+
RLPy.EHikEffector_LeftHand, RLPy.EHikEffectorType_Rotate, True)
print(result)
+
</syntaxhighlight>
  
# Get current facial key
+
=== GetActive ( self, eEffector, eType ) ===
head = RLPy.FloatVector()
+
left_eye = RLPy.FloatVector()
+
right_eye = RLPy.FloatVector()
+
morph = RLPy.FloatVector()
+
custom = RLPy.FloatVector()
+
bone = RLPy.FloatVector()
+
weight = 0.0
+
result = face_component.GetKey(time, head, left_eye, right_eye, morph, custom, bone, weight)
+
print(result[0]) # RStatus: result[0]
+
print(result[1]) # weight: result[1]
+
print(head) # head weight
+
print(left_eye) # left eye weight
+
print(right_eye) # right eye weight
+
print(morph) # morph weight
+
print(custom) # custom weight
+
print(bone) # bone weight
+
  
#Add expression key
+
Get the translational or rotational active state of a given IK effector.
morph = RLPy.FloatVector()
+
bone = RLPy.FloatVector()
+
custom = RLPy.FloatVector()
+
morph.resize(60)
+
bone.resize(12)
+
custom.resize(24)
+
result = face_component.AddExpressionKey( RLPy.RTime( 0 ), morph, bone, custom, 1 )
+
print(result)
+
  
#Add eye key
+
See Also: [[#SetActive ( self, eEffector, eType, bActive )|SetActive]]
eye_l = [ 0.2, 0.2 ] #[ Horizontal, Vertical ]
+
eye_r = [ 0.2, 0.2 ] #[ Horizontal, Vertical ]
+
result = face_component.AddEyeKey( RLPy.RTime( 0 ), eye_l, eye_r )
+
print(result)
+
  
#Add head key
+
==== Parameters ====
result = face_component.AddHeadKey( RLPy.RTime( 0 ), [ 0.1, 0.4, 0.8 ] ) #[ Vertical, Horizontal, Tilt ]
+
:'''eEffector''' [IN] IK effector for different parts of the character - [[#EHikEffector|EHikEffector]]
print(result)
+
:'''eType''' [IN] Query type of either translational or rotational - [[#EHikEffectorType|EHikEffectorType]]
 +
 
 +
==== Returns ====
 +
:'''True''' if the IK effector is active, else '''False'''.
 +
 
 +
<syntaxhighlight lang="python" line='line'>
 +
# Get human IK component
 +
avatar_list = RLPy.RScene.GetAvatars()
 +
avatar = avatar_list[0]
 +
hik_effector_component = avatar.GetHikEffectorComponent()
 +
 
 +
# Get human IK effector active status with translate/rotate type
 +
print(hik_effector_component.GetActive(RLPy.EHikEffector_LeftHand, RLPy.EHikEffectorType_Translate))
 +
print(hik_effector_component.GetActive(RLPy.EHikEffector_LeftHand, RLPy.EHikEffectorType_Rotate))
 
</syntaxhighlight>
 
</syntaxhighlight>
==Member Functions==
 
===AddClip===
 
<syntaxhighlight lang="Python">
 
RLPy.RIFaceComponent.AddClip ( self, kTime, strName, kLength )
 
</syntaxhighlight>
 
Add facial clip.
 
<span style="background:#ffcccc">( Experimental API )</span>
 
====Parameters====
 
<div style="margin-left: 2em;">
 
  
'''kTime''' [IN] The time at which to add the clip - RLPy.RTime
+
=== SetLock ( self, eEffector, eType, bLock ) ===
  
'''strName''' [IN] Clip name - string
+
Set the lock state of a given IK effector and transformation type (rotation or translation).
  
'''kLength''' [IN] Clip length - RLPy.RTime
+
See Also: [[#GetLock ( self, eEffector, eType )|GetLock]]
</div>
+
====Return Values====
+
<div style="margin-left: 2em;">
+
  
'''RLPy.RStatus.Success''' Success
+
==== Parameters ====
 +
:'''eEffector''' [IN] IK effector on different parts of the character - [[#EHikEffector|EHikEffector]]
 +
:'''eType''' [IN] Set the lock type as either translational or rotational - [[#EHikEffectorType|EHikEffectorType]]
 +
:'''bLock''' [IN] Lock for the IK effector - bool
  
'''RLPy.RStatus.Failure''' Fail
+
==== Return ====
</div>
+
:Success - RLPy.RStatus.Success
-----
+
:Failure - RLPy.RStatus.Failure
===AddExpressionKey===
+
 
<syntaxhighlight lang="Python">
+
<syntaxhighlight lang="python" line='line'>
RLPy.RIFaceComponent.AddExpressionKey ( self, kTime, kMorph, kBone, kCustom, fStrength )
+
# Get human IK component
 +
avatar_list = RLPy.RScene.GetAvatars()
 +
avatar = avatar_list[0]
 +
hik_effector_component = avatar.GetHikEffectorComponent()
 +
 
 +
# Set effector translate lock
 +
result = hik_effector_component.SetLock(
 +
RLPy.EHikEffector_Head, RLPy.EHikEffectorType_Translate, True);
 +
print(result)
 +
 
 +
# Set effector rotate lock
 +
result = hik_effector_component.SetLock(
 +
RLPy.EHikEffector_Head, RLPy.EHikEffectorType_Rotate, True);
 +
print(result)
 
</syntaxhighlight>
 
</syntaxhighlight>
Add an head key in Facial Layer.
 
<span style="background:#ffcccc">( Experimental API )</span>
 
====Parameters====
 
<div style="margin-left: 2em;">
 
  
'''kTime''' [IN] The time at which to add the key - RLPy.RTime
+
=== GetLock ( self, eEffector, eType ) ===
  
'''kMorph''' [IN] Morph weight - float
+
Get the lock status of a given IK effector and transformation type (rotation or translation).
  
'''kCustom''' [IN] Custom weight - float
+
See Also: [[#SetLock ( self, eEffector, eType, bLock )|SetLock]]
  
'''kBone''' [IN] Bone weight - float
+
==== Parameters ====
 +
:'''eEffector''' [IN] IK effector for the different parts of the character - [[#EHikEffector|EHikEffector]]
 +
:'''eType''' [IN] Query type of either rotational or translational - [[#EHikEffectorType|EHikEffectorType]]
  
'''fStrength''' [IN] The strength of expression - float
+
==== Returns ====
</div>
+
:'''True''' if human IK effector is locked, else '''False'''.
====Return Values====
+
<div style="margin-left: 2em;">
+
  
'''RLPy.RStatus.Success''' Success
+
<syntaxhighlight lang="python" line='line'>
 +
# Get human IK component
 +
avatar_list = RLPy.RScene.GetAvatars()
 +
avatar = avatar_list[0]
 +
hik_effector_component = avatar.GetHikEffectorComponent()
 +
 
 +
# Get effector translate lock
 +
is_lock = hik_effector_component.GetLock(
 +
RLPy.EHikEffector_Head, RLPy.EHikEffectorType_Translate);
 +
print(is_lock)
  
'''RLPy.RStatus.Failure''' Fail
+
# Get effector rotate lock
</div>
+
is_lock = hik_effector_component.GetLock(
-----
+
RLPy.EHikEffector_Head, RLPy.EHikEffectorType_Rotate);
===AddEyeKey===
+
print(is_lock)
<syntaxhighlight lang="Python">
+
RLPy.RIFaceComponent.AddEyeKey ( self, kTime, kLeftEye, kRightEye )
+
 
</syntaxhighlight>
 
</syntaxhighlight>
Add an eye key in Facial Layer.
 
<span style="background:#ffcccc">( Experimental API )</span>
 
====Parameters====
 
<div style="margin-left: 2em;">
 
  
'''kTime''' [IN] The time at which to add the key - RLPy.RTime
+
=== SetPosition ( self, eEffector, kPosition ) ===
  
'''kLeftEye''' [IN] Left eye weight - float
+
Sets the movement (translation) of an IK effector for a body part, given an [[#EHikEffector|EHikEffector]] and a Vector3 for the X, Y, Z positions.
  
'''kRightEye''' [IN] Right eye weight - float
+
==== Parameters ====
</div>
+
:'''eEffector''' [IN] IK effector for different parts of the character. - [[#EHikEffector|EHikEffector]]
====Return Values====
+
:'''kPosition''' [IN] Position Data - [[IC_Python_API:RLPy_RVector3|RVector3]]
<div style="margin-left: 2em;">
+
  
'''RLPy.RStatus.Success''' Success
+
==== Return ====
 +
:Success - RLPy.RStatus.Success
 +
:Failure - RLPy.RStatus.Failure
  
'''RLPy.RStatus.Failure''' Fail
+
<syntaxhighlight lang="python" line='line'>
</div>
+
# Get human IK component
-----
+
avatar_list = RLPy.RScene.GetAvatars()
===AddHeadKey===
+
avatar = avatar_list[0]
<syntaxhighlight lang="Python">
+
hik_effector_component = avatar.GetHikEffectorComponent()
RLPy.RIFaceComponent.AddHeadKey ( self, kTime, kHead )
+
 
 +
# Process left hand data to effector
 +
pos = RLPy.RVector3.ZERO
 +
result = hik_effector_component.SetPosition(
 +
RLPy.EHikEffector_LeftHand, pos)
 +
print(result)
 
</syntaxhighlight>
 
</syntaxhighlight>
Add an head key in Facial Layer.
 
<span style="background:#ffcccc">( Experimental API )</span>
 
====Parameters====
 
<div style="margin-left: 2em;">
 
  
'''kTime''' [IN] The time at which to add the key - RLPy.RTime
+
=== SetPosition ( self, eEffector, kWorldMatrix, bRotateActive, bTranslateActive ) ===
  
'''kHead''' [IN] Head rotate weight - float
+
Sets the movement and rotation of an IK effector for a body part, given an [[#EHikEffector|EHikEffector]] and world transform 4x4 matrix.  This functions has the option to include/exclude rotations and translations.
</div>
+
====Return Values====
+
<div style="margin-left: 2em;">
+
  
'''RLPy.RStatus.Success''' Success
+
==== Parameters ====
 +
:'''eEffector''' [IN] IK effector on different parts of the character - [[#EHikEffector|EHikEffector]]
 +
:'''kWorldMatrix''' [IN] World-space transformational matrix - [[IC_Python_API:RLPy_RMatrix4|RMatrix4]]
 +
:'''bRotateActive''' [IN] Whether to enable the IK rotations - bool
 +
:'''bTranslateActive''' [IN] Whether to enable the IK translations - bool
  
'''RLPy.RStatus.Failure''' Fail
+
==== Return ====
</div>
+
:Success - RLPy.RStatus.Success
-----
+
:Failure - RLPy.RStatus.Failure
===GetKey===
+
 
<syntaxhighlight lang="Python">
+
<syntaxhighlight lang="python" line='line'>
RLPy.RIFaceComponent.GetKey ( self, kTime, kHead, kLeftEye, kRightEye, kMorph, kBone, kCustom, fStrength )
+
# Get human IK component
 +
avatar_list = RLPy.RScene.GetAvatars()
 +
avatar = avatar_list[0]
 +
hik_effector_component = avatar.GetHikEffectorComponent()
 +
 
 +
# Set Effector rotation and position with matrix
 +
matrix = RLPy.RMatrix4()
 +
matrix.MakeIdentity()
 +
result = hik_effector_component.SetPosition(
 +
RLPy.EHikEffector_LeftHand, matrix, true, true ); //enable R & T
 +
print(result)
 
</syntaxhighlight>
 
</syntaxhighlight>
Get facial key with expressiveness.
 
<span style="background:#ffcccc">( Experimental API )</span>
 
====Parameters====
 
<div style="margin-left: 2em;">
 
  
'''kTime''' [IN] The time at which to get the key - RLPy.RTime
+
=== ProcessEffector ( ) ===
  
'''kHead''' [OUT] Head weight - float
+
<syntaxhighlight lang="python" line='line'>
 +
# Get human IK component
 +
avatar_list = RLPy.RScene.GetAvatars()
 +
avatar = avatar_list[0]
 +
hik_effector_component = avatar.GetHikEffectorComponent()
 +
# Activate left hand effector
 +
hik_effector_component.ActivateEffector(RLPy.EHikEffector_LeftHand)
 +
print(hik_effector_component.GetEffectorActive(RLPy.EHikEffector_LeftHand))
 +
# Process left hand data to effector
 +
pos_1 = RLPy.RVector3.UNIT_X
 +
pos_2 = RLPy.RVector3.UNIT_Y
 +
position_data = [pos_1, pos_2]
 +
result = hik_effector_component.ProcessEffector(position_data)
 +
print(result)
 +
</syntaxhighlight>
  
'''kLeftEye''' [OUT] Left eye weight - float
+
=== Solve ( self, eEffector, kEffectorWorldMatrix ) ===
  
'''kRightEye''' [OUT] Right eye weight - float
+
Given an IK effector body part ( [[#EHikEffector|EHikEffector]] ) and a transformation 4x4 matrix, return the IK effector matrix data for the entire body after having transformed the given body part.
  
'''kMorph''' [INOUT Morph weight - float
+
==== Parameters ====
 +
:'''eEffector''' [IN] IK effector for different parts of the character - [[#EHikEffector|EHikEffector]]
 +
:'''kEffectorWorldMatrix''' [IN] Transformational matrix to move and rotate the Human IK effector. - [[IC_Python_API:RLPy_RMatrix4|RMatrix4]]
  
'''kBone''' [OUT] Bone weight - float
+
==== Return ====
 +
:The entire body's IK effector matrix data.
  
'''kCustom''' [OUT] Custom weight - float
+
<syntaxhighlight lang="python" line='line'>
 +
# Get human IK component
 +
avatar_list = RLPy.RScene.GetAvatars()
 +
avatar = avatar_list[0]
 +
hik_effector_component = avatar.GetHikEffectorComponent()
  
'''fStrength''' [OUT] The strength of expression - float
+
# Set effector matrix and get full body IK matrix data
</div>
+
matrix = RLPy.RMatrix4()
====Return Values====
+
matrix.MakeIdentity()
<div style="margin-left: 2em;">
+
result = hik_effector_component.Solve( RLPy.EHikEffector_LeftHand, matrix );
 +
print(result)
 +
</syntaxhighlight>
  
'''RLPy.RStatus.Success''' Success
+
=== SetBodyWeight ( self, fWeight ) ===
  
'''RLPy.RStatus.Failure''' Fail
+
Sets the amount of influence IK effectors have on the entire body IK, from 0 to 1.  A value of 0 means the IK system is driven by body parts, while 1 sets the IK effectors to full body influence.
</div>
+
 
 +
==== Parameters ====
 +
:'''fWeight''' [IN] Weight value - float [0.0,1.0]
 +
 
 +
==== Return ====
 +
:Success - RLPy.RStatus.Success
 +
:Failure - RLPy.RStatus.Failure
 +
 
 +
<syntaxhighlight lang="python" line='line'>
 +
# Get human IK component
 +
avatar_list = RLPy.RScene.GetAvatars()
 +
avatar = avatar_list[0]
 +
hik_effector_component = avatar.GetHikEffectorComponent()
 +
 
 +
# Set effector body weight
 +
hik_effector_component.SetBodyWeight(1); # 0.0~1.0
 +
</syntaxhighlight>

Latest revision as of 00:05, 17 April 2020

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

Description

This class primarily manages IK skeleton controls. This component can adjust EHikEffector for various body parts i.e. RLPy.EHikEffector_LeftHand. ProcessEffector can be used move different parts of the body IK.

See Also: EHikEffector, ProcessEffector

Inheritance

RIBase > RIHikEffectorComponent 

Related Enumerations

EHikEffector

IK Effector Type Description
RLPy.EHikEffector_Invalid Invalid
RLPy.EHikEffector_LeftHand Left Hand
RLPy.EHikEffector_LeftElbow Left Elbow
RLPy.EHikEffector_LeftShoulder Left Shoulder
RLPy.EHikEffector_RightHand Right Hand
RLPy.EHikEffector_RightElbow Right Elbow
RLPy.EHikEffector_RightShoulder Right Shoulder
RLPy.EHikEffector_LeftFoot Left Foot
RLPy.EHikEffector_LeftKnee Left Knee
RLPy.EHikEffector_LeftHip Left Hip
RLPy.EHikEffector_RightFoot Right Foot
RLPy.EHikEffector_RightKnee Right Knee
RLPy.EHikEffector_RightHip Right Hip
RLPy.EHikEffector_Hip Hip
RLPy.EHikEffector_Head Head
RLPy.EHikEffector_Neck Neck
RLPy.EHikEffector_ChestOrigin Chest Origin
RLPy.EHikEffector_LeftToe Left Toe
RLPy.EHikEffector_RightToe RightToe
RLPy.EHikEffector_LeftFingerBase Left Finger Base
RLPy.EHikEffector_RightFingerBase Right Finger Base
RLPy.EHikEffector_LeftHandThumb Left Hand Thumb
RLPy.EHikEffector_LeftHandIndex Left Hand Index
RLPy.EHikEffector_LeftHandMiddle Left Hand Middle
RLPy.EHikEffector_LeftHandRing Left Hand Ring
RLPy.EHikEffector_LeftHandPinky Left Hand Pinky
RLPy.EHikEffector_LeftHandExtraFinger Left Hand Extra Finger
RLPy.EHikEffector_RightHandThumb Right Hand Thumb
RLPy.EHikEffector_RightHandIndex Right Hand Index
RLPy.EHikEffector_RightHandMiddle Right Hand Middle
RLPy.EHikEffector_RightHandRing Right Hand Ring
RLPy.EHikEffector_RightHandPinky Right Hand Pinky
RLPy.EHikEffector_RightHandExtraFinger Right Hand Extra Finger
RLPy.EHikEffector_LeftFootThumb Left Foot Thumb
RLPy.EHikEffector_LeftFootIndex Left Foot Index
RLPy.EHikEffector_LeftFootMiddle Left Foot Middle
RLPy.EHikEffector_LeftFootRing Left Foot Ring
RLPy.EHikEffector_LeftFootPinky Left Foot Pinky
RLPy.EHikEffector_LeftFootExtraFinger Left Foot Extra Finger
RLPy.EHikEffector_RightFootThumb Right Foot Thumb
RLPy.EHikEffector_RightFootIndex Right Foot Index
RLPy.EHikEffector_RightFootMiddle Right Foot Middle
RLPy.EHikEffector_RightFootRing Right Foot Ring
RLPy.EHikEffector_RightFootPinky Right Foot Pinky
RLPy.EHikEffector_RightFootExtraFinger Right Foot Extra Finger
RLPy.EHikEffector_Quantity Quantity

EHikEffectorType

IK Effector Activation Type Description
EHikEffectorType_Translate Translate
EHikEffectorType_Rotate Rotate

Member Functions

SetActive ( self, eEffector, eType, bActive )

Set the translational or rotational active state for a given IK effector.

See Also: GetActive

Parameters

eEffector [IN] IK effector on different parts of the character - EHikEffector
eType [IN] Set activation type as either translational or rotational - EHikEffectorType
bActive [IN] Activate or deactivate the IK effector - bool

Return

Success - RLPy.RStatus.Success
Failure - RLPy.RStatus.Failure
 1 # Get human IK component
 2 avatar_list = RLPy.RScene.GetAvatars()
 3 avatar = avatar_list[0]
 4 hik_effector_component = avatar.GetHikEffectorComponent()
 5 
 6 # Activate left hand effector
 7 hik_effector_component.SetActive(
 8 RLPy.EHikEffector_LeftHand, RLPy.EHikEffectorType_Translate, True)
 9 hik_effector_component.SetActive(
10 RLPy.EHikEffector_LeftHand, RLPy.EHikEffectorType_Rotate, True)

GetActive ( self, eEffector, eType )

Get the translational or rotational active state of a given IK effector.

See Also: SetActive

Parameters

eEffector [IN] IK effector for different parts of the character - EHikEffector
eType [IN] Query type of either translational or rotational - EHikEffectorType

Returns

True if the IK effector is active, else False.
1 # Get human IK component
2 avatar_list = RLPy.RScene.GetAvatars()
3 avatar = avatar_list[0]
4 hik_effector_component = avatar.GetHikEffectorComponent()
5 
6 # Get human IK effector active status with translate/rotate type
7 print(hik_effector_component.GetActive(RLPy.EHikEffector_LeftHand, RLPy.EHikEffectorType_Translate))
8 print(hik_effector_component.GetActive(RLPy.EHikEffector_LeftHand, RLPy.EHikEffectorType_Rotate))

SetLock ( self, eEffector, eType, bLock )

Set the lock state of a given IK effector and transformation type (rotation or translation).

See Also: GetLock

Parameters

eEffector [IN] IK effector on different parts of the character - EHikEffector
eType [IN] Set the lock type as either translational or rotational - EHikEffectorType
bLock [IN] Lock for the IK effector - bool

Return

Success - RLPy.RStatus.Success
Failure - RLPy.RStatus.Failure
 1 # Get human IK component
 2 avatar_list = RLPy.RScene.GetAvatars()
 3 avatar = avatar_list[0]
 4 hik_effector_component = avatar.GetHikEffectorComponent()
 5 
 6 # Set effector translate lock
 7 result = hik_effector_component.SetLock(
 8 RLPy.EHikEffector_Head, RLPy.EHikEffectorType_Translate, True);
 9 print(result)
10 
11 # Set effector rotate lock
12 result = hik_effector_component.SetLock(
13 RLPy.EHikEffector_Head, RLPy.EHikEffectorType_Rotate, True);
14 print(result)

GetLock ( self, eEffector, eType )

Get the lock status of a given IK effector and transformation type (rotation or translation).

See Also: SetLock

Parameters

eEffector [IN] IK effector for the different parts of the character - EHikEffector
eType [IN] Query type of either rotational or translational - EHikEffectorType

Returns

True if human IK effector is locked, else False.
 1 # Get human IK component
 2 avatar_list = RLPy.RScene.GetAvatars()
 3 avatar = avatar_list[0]
 4 hik_effector_component = avatar.GetHikEffectorComponent()
 5 
 6 # Get effector translate lock
 7 is_lock = hik_effector_component.GetLock(
 8 RLPy.EHikEffector_Head, RLPy.EHikEffectorType_Translate);
 9 print(is_lock)
10 
11 # Get effector rotate lock
12 is_lock = hik_effector_component.GetLock(
13 RLPy.EHikEffector_Head, RLPy.EHikEffectorType_Rotate);
14 print(is_lock)

SetPosition ( self, eEffector, kPosition )

Sets the movement (translation) of an IK effector for a body part, given an EHikEffector and a Vector3 for the X, Y, Z positions.

Parameters

eEffector [IN] IK effector for different parts of the character. - EHikEffector
kPosition [IN] Position Data - RVector3

Return

Success - RLPy.RStatus.Success
Failure - RLPy.RStatus.Failure
 1 # Get human IK component
 2 avatar_list = RLPy.RScene.GetAvatars()
 3 avatar = avatar_list[0]
 4 hik_effector_component = avatar.GetHikEffectorComponent()
 5 
 6 # Process left hand data to effector
 7 pos = RLPy.RVector3.ZERO
 8 result = hik_effector_component.SetPosition(
 9 RLPy.EHikEffector_LeftHand, pos)
10 print(result)

SetPosition ( self, eEffector, kWorldMatrix, bRotateActive, bTranslateActive )

Sets the movement and rotation of an IK effector for a body part, given an EHikEffector and world transform 4x4 matrix. This functions has the option to include/exclude rotations and translations.

Parameters

eEffector [IN] IK effector on different parts of the character - EHikEffector
kWorldMatrix [IN] World-space transformational matrix - RMatrix4
bRotateActive [IN] Whether to enable the IK rotations - bool
bTranslateActive [IN] Whether to enable the IK translations - bool

Return

Success - RLPy.RStatus.Success
Failure - RLPy.RStatus.Failure
 1 # Get human IK component
 2 avatar_list = RLPy.RScene.GetAvatars()
 3 avatar = avatar_list[0]
 4 hik_effector_component = avatar.GetHikEffectorComponent()
 5 
 6 # Set Effector rotation and position with matrix
 7 matrix = RLPy.RMatrix4()
 8 matrix.MakeIdentity()
 9 result = hik_effector_component.SetPosition(
10 RLPy.EHikEffector_LeftHand, matrix, true, true ); //enable R & T 
11 print(result)

ProcessEffector ( )

 1 # Get human IK component
 2 avatar_list = RLPy.RScene.GetAvatars()
 3 avatar = avatar_list[0]
 4 hik_effector_component = avatar.GetHikEffectorComponent()
 5 # Activate left hand effector
 6 hik_effector_component.ActivateEffector(RLPy.EHikEffector_LeftHand)
 7 print(hik_effector_component.GetEffectorActive(RLPy.EHikEffector_LeftHand))
 8 # Process left hand data to effector
 9 pos_1 = RLPy.RVector3.UNIT_X
10 pos_2 = RLPy.RVector3.UNIT_Y
11 position_data = [pos_1, pos_2]
12 result = hik_effector_component.ProcessEffector(position_data)
13 print(result)

Solve ( self, eEffector, kEffectorWorldMatrix )

Given an IK effector body part ( EHikEffector ) and a transformation 4x4 matrix, return the IK effector matrix data for the entire body after having transformed the given body part.

Parameters

eEffector [IN] IK effector for different parts of the character - EHikEffector
kEffectorWorldMatrix [IN] Transformational matrix to move and rotate the Human IK effector. - RMatrix4

Return

The entire body's IK effector matrix data.
 1 # Get human IK component
 2 avatar_list = RLPy.RScene.GetAvatars()
 3 avatar = avatar_list[0]
 4 hik_effector_component = avatar.GetHikEffectorComponent()
 5 
 6 # Set effector matrix and get full body IK matrix data
 7 matrix = RLPy.RMatrix4()
 8 matrix.MakeIdentity()
 9 result = hik_effector_component.Solve( RLPy.EHikEffector_LeftHand, matrix );
10 print(result)

SetBodyWeight ( self, fWeight )

Sets the amount of influence IK effectors have on the entire body IK, from 0 to 1. A value of 0 means the IK system is driven by body parts, while 1 sets the IK effectors to full body influence.

Parameters

fWeight [IN] Weight value - float [0.0,1.0]

Return

Success - RLPy.RStatus.Success
Failure - RLPy.RStatus.Failure
1 # Get human IK component
2 avatar_list = RLPy.RScene.GetAvatars()
3 avatar = avatar_list[0]
4 hik_effector_component = avatar.GetHikEffectorComponent()
5 
6 # Set effector body weight
7 hik_effector_component.SetBodyWeight(1); # 0.0~1.0