Difference between revisions of "IC Python API:RLPy RIHikEffectorComponent"
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 |
||
(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}} | ||
− | == | + | {{last_modified}} |
− | This class | + | |
− | + | == Description == | |
− | == | + | |
− | + | 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. | |
− | + | ||
− | # Get | + | 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] | ||
− | + | hik_effector_component = avatar.GetHikEffectorComponent() | |
− | # | + | # Activate left hand effector |
− | + | hik_effector_component.SetActive( | |
− | + | RLPy.EHikEffector_LeftHand, RLPy.EHikEffectorType_Translate, True) | |
− | + | hik_effector_component.SetActive( | |
− | + | RLPy.EHikEffector_LeftHand, RLPy.EHikEffectorType_Rotate, True) | |
− | + | </syntaxhighlight> | |
− | + | === GetActive ( self, eEffector, eType ) === | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | Get the translational or rotational active state of a given IK effector. | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | See Also: [[#SetActive ( self, eEffector, eType, bActive )|SetActive]] | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | # | + | ==== Parameters ==== |
− | + | :'''eEffector''' [IN] IK effector for different parts of the character - [[#EHikEffector|EHikEffector]] | |
− | print( | + | :'''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> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | === SetLock ( self, eEffector, eType, bLock ) === | |
− | + | Set the lock state of a given IK effector and transformation type (rotation or translation). | |
− | + | See Also: [[#GetLock ( self, eEffector, eType )|GetLock]] | |
− | + | ||
− | + | ||
− | + | ||
− | ''' | + | ==== 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 | ||
− | + | ==== Return ==== | |
− | + | :Success - RLPy.RStatus.Success | |
− | + | :Failure - RLPy.RStatus.Failure | |
− | + | ||
− | <syntaxhighlight lang=" | + | <syntaxhighlight lang="python" line='line'> |
− | RLPy. | + | # 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> | ||
− | |||
− | |||
− | |||
− | |||
− | + | === GetLock ( self, eEffector, eType ) === | |
− | + | Get the lock status of a given IK effector and transformation type (rotation or translation). | |
− | + | See Also: [[#SetLock ( self, eEffector, eType, bLock )|SetLock]] | |
− | ''' | + | ==== 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]] | ||
− | + | ==== Returns ==== | |
− | + | :'''True''' if human IK effector is locked, 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 effector translate lock | ||
+ | is_lock = hik_effector_component.GetLock( | ||
+ | RLPy.EHikEffector_Head, RLPy.EHikEffectorType_Translate); | ||
+ | print(is_lock) | ||
− | + | # Get effector rotate lock | |
− | + | is_lock = hik_effector_component.GetLock( | |
− | + | RLPy.EHikEffector_Head, RLPy.EHikEffectorType_Rotate); | |
− | = | + | print(is_lock) |
− | + | ||
− | RLPy. | + | |
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
− | |||
− | |||
− | + | === SetPosition ( self, eEffector, kPosition ) === | |
− | + | 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. | |
− | ''' | + | ==== Parameters ==== |
− | + | :'''eEffector''' [IN] IK effector for different parts of the character. - [[#EHikEffector|EHikEffector]] | |
− | + | :'''kPosition''' [IN] Position Data - [[IC_Python_API:RLPy_RVector3|RVector3]] | |
− | + | ||
− | + | ==== 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() | |
− | RLPy. | + | |
+ | # Process left hand data to effector | ||
+ | pos = RLPy.RVector3.ZERO | ||
+ | result = hik_effector_component.SetPosition( | ||
+ | RLPy.EHikEffector_LeftHand, pos) | ||
+ | print(result) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | |||
− | |||
− | |||
− | |||
− | + | === SetPosition ( self, eEffector, kWorldMatrix, bRotateActive, bTranslateActive ) === | |
− | + | 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. | |
− | + | ||
− | + | ||
− | + | ||
− | ''' | + | ==== 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 | ||
− | + | ==== Return ==== | |
− | + | :Success - RLPy.RStatus.Success | |
− | + | :Failure - RLPy.RStatus.Failure | |
− | + | ||
− | <syntaxhighlight lang=" | + | <syntaxhighlight lang="python" line='line'> |
− | RLPy. | + | # 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> | ||
− | |||
− | |||
− | |||
− | |||
− | + | === ProcessEffector ( ) === | |
− | '' | + | <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> | ||
− | + | === Solve ( self, eEffector, kEffectorWorldMatrix ) === | |
− | + | 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. | |
− | ''' | + | ==== 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]] | ||
− | ' | + | ==== Return ==== |
+ | :The entire body's IK effector matrix data. | ||
− | '' | + | <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 matrix and get full body IK matrix data | |
− | + | matrix = RLPy.RMatrix4() | |
− | = | + | matrix.MakeIdentity() |
− | < | + | result = hik_effector_component.Solve( RLPy.EHikEffector_LeftHand, matrix ); |
+ | print(result) | ||
+ | </syntaxhighlight> | ||
− | + | === SetBodyWeight ( self, fWeight ) === | |
− | '''RLPy.RStatus.Failure'' | + | 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 | ||
+ | |||
+ | <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
Contents
- 1 Description
- 2 Related Enumerations
- 3 Member Functions
- 3.1 SetActive ( self, eEffector, eType, bActive )
- 3.2 GetActive ( self, eEffector, eType )
- 3.3 SetLock ( self, eEffector, eType, bLock )
- 3.4 GetLock ( self, eEffector, eType )
- 3.5 SetPosition ( self, eEffector, kPosition )
- 3.6 SetPosition ( self, eEffector, kWorldMatrix, bRotateActive, bTranslateActive )
- 3.7 ProcessEffector ( )
- 3.8 Solve ( self, eEffector, kEffectorWorldMatrix )
- 3.9 SetBodyWeight ( self, fWeight )
- 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