IC8 Python API:RLPy RIHikEffectorComponent

From Reallusion Wiki!
Jump to: navigation, search
Main article: iC8 Modules.
Last modified: 01/16/2023

Description

This class is the interface to the human IK effector in the avatar.

Class Methods

RLPy.RIHikEffectorComponent.AddReachKey(self, eEffector, kKey)

Add new reach key of the effector.

Experimental API

Parameters

eEffector[IN] Human IK effector - RLPy.EHikEffector
  • RLPy.EHikEffector_Invalid
  • RLPy.EHikEffector_Hip
  • RLPy.EHikEffector_LeftFoot
  • RLPy.EHikEffector_RightFoot
  • RLPy.EHikEffector_LeftHand
  • RLPy.EHikEffector_RightHand
  • RLPy.EHikEffector_LeftKnee
  • RLPy.EHikEffector_RightKnee
  • RLPy.EHikEffector_LeftElbow
  • RLPy.EHikEffector_RightElbow
  • RLPy.EHikEffector_ChestOrigin
  • RLPy.EHikEffector_Neck
  • RLPy.EHikEffector_LeftToe
  • RLPy.EHikEffector_RightToe
  • RLPy.EHikEffector_LeftShoulder
  • RLPy.EHikEffector_RightShoulder
  • RLPy.EHikEffector_Head
  • RLPy.EHikEffector_LeftHip
  • RLPy.EHikEffector_RightHip
  • RLPy.EHikEffector_Quantity
kKey[IN] The key to be added - RLPy.RReachKey

Returns

RLPy.RStatus.Success - Succeed
RLPy.RStatus.Failure - Fail
1 # Get human IK component
2 avatar_list = RLPy.RScene.GetAvatars()
3 avatar = avatar_list[0]
4 hik_effector_component = avatar.GetHikEffectorComponent()
5 
6 # Add reach key
7 key = RLPy.RReachKey()
8 result = hik_effector_component.AddReachKey(RLPy.EHikEffector_RightHand, key)
9 print(result)

RLPy.RIHikEffectorComponent.GetActive(self, eEffector, eType)

Get human IK effector active status with translate/rotate type.

Experimental API

Parameters

eEffector[IN] Human IK effector - RLPy.EHikEffector
  • RLPy.EHikEffector_Invalid
  • RLPy.EHikEffector_Hip
  • RLPy.EHikEffector_LeftFoot
  • RLPy.EHikEffector_RightFoot
  • RLPy.EHikEffector_LeftHand
  • RLPy.EHikEffector_RightHand
  • RLPy.EHikEffector_LeftKnee
  • RLPy.EHikEffector_RightKnee
  • RLPy.EHikEffector_LeftElbow
  • RLPy.EHikEffector_RightElbow
  • RLPy.EHikEffector_ChestOrigin
  • RLPy.EHikEffector_Neck
  • RLPy.EHikEffector_LeftToe
  • RLPy.EHikEffector_RightToe
  • RLPy.EHikEffector_LeftShoulder
  • RLPy.EHikEffector_RightShoulder
  • RLPy.EHikEffector_Head
  • RLPy.EHikEffector_LeftHip
  • RLPy.EHikEffector_RightHip
  • RLPy.EHikEffector_Quantity
eType[IN] Human IK effector type - RLPy.EHikEffectorType
  • RLPy.EHikEffectorType_Translate
  • RLPy.EHikEffectorType_Rotate

Returns

True if human IK effector is active, False if human IK effector is not active - bool

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 active effector
7 print(hik_effector_component.GetActive(RLPy.EHikEffector_LeftHand, RLPy.EHikEffectorType_Translate))

RLPy.RIHikEffectorComponent.GetLock(self, eEffector, eType)

Get human IK effector lock status with translate/rotate type.

Experimental API

Parameters

eEffector[IN] Human IK effector - RLPy.EHikEffector
  • RLPy.EHikEffector_Invalid
  • RLPy.EHikEffector_Hip
  • RLPy.EHikEffector_LeftFoot
  • RLPy.EHikEffector_RightFoot
  • RLPy.EHikEffector_LeftHand
  • RLPy.EHikEffector_RightHand
  • RLPy.EHikEffector_LeftKnee
  • RLPy.EHikEffector_RightKnee
  • RLPy.EHikEffector_LeftElbow
  • RLPy.EHikEffector_RightElbow
  • RLPy.EHikEffector_ChestOrigin
  • RLPy.EHikEffector_Neck
  • RLPy.EHikEffector_LeftToe
  • RLPy.EHikEffector_RightToe
  • RLPy.EHikEffector_LeftShoulder
  • RLPy.EHikEffector_RightShoulder
  • RLPy.EHikEffector_Head
  • RLPy.EHikEffector_LeftHip
  • RLPy.EHikEffector_RightHip
  • RLPy.EHikEffector_Quantity
eType[IN] Human IK effector type - RLPy.EHikEffectorType
  • RLPy.EHikEffectorType_Translate
  • RLPy.EHikEffectorType_Rotate

Returns

True if human IK effector status is locked, False if human IK effector is unlocked - bool

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(RLPy.EHikEffector_Head, RLPy.EHikEffectorType_Translate);
8 print(is_lock)

RLPy.RIHikEffectorComponent.GetReachKeys(self, eEffector)

Get all reach key of the effector.

Experimental API

Parameters

eEffector[IN] Human IK effector - RLPy.EHikEffector
  • RLPy.EHikEffector_Invalid
  • RLPy.EHikEffector_Hip
  • RLPy.EHikEffector_LeftFoot
  • RLPy.EHikEffector_RightFoot
  • RLPy.EHikEffector_LeftHand
  • RLPy.EHikEffector_RightHand
  • RLPy.EHikEffector_LeftKnee
  • RLPy.EHikEffector_RightKnee
  • RLPy.EHikEffector_LeftElbow
  • RLPy.EHikEffector_RightElbow
  • RLPy.EHikEffector_ChestOrigin
  • RLPy.EHikEffector_Neck
  • RLPy.EHikEffector_LeftToe
  • RLPy.EHikEffector_RightToe
  • RLPy.EHikEffector_LeftShoulder
  • RLPy.EHikEffector_RightShoulder
  • RLPy.EHikEffector_Head
  • RLPy.EHikEffector_LeftHip
  • RLPy.EHikEffector_RightHip
  • RLPy.EHikEffector_Quantity

Returns

Vectorof reach keys.

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 reach keys
7 keys = hik_effector_component.GetReachKeys(RLPy.EHikEffector_RightHand)
8 print(len(keys))

RLPy.RIHikEffectorComponent.RemoveReachKey(self, eEffector, kKey)

Remove reach key of the effector.

Experimental API

Parameters

eEffector[IN] Human IK effector - RLPy.EHikEffector
  • RLPy.EHikEffector_Invalid
  • RLPy.EHikEffector_Hip
  • RLPy.EHikEffector_LeftFoot
  • RLPy.EHikEffector_RightFoot
  • RLPy.EHikEffector_LeftHand
  • RLPy.EHikEffector_RightHand
  • RLPy.EHikEffector_LeftKnee
  • RLPy.EHikEffector_RightKnee
  • RLPy.EHikEffector_LeftElbow
  • RLPy.EHikEffector_RightElbow
  • RLPy.EHikEffector_ChestOrigin
  • RLPy.EHikEffector_Neck
  • RLPy.EHikEffector_LeftToe
  • RLPy.EHikEffector_RightToe
  • RLPy.EHikEffector_LeftShoulder
  • RLPy.EHikEffector_RightShoulder
  • RLPy.EHikEffector_Head
  • RLPy.EHikEffector_LeftHip
  • RLPy.EHikEffector_RightHip
  • RLPy.EHikEffector_Quantity
kKey[IN] The key to be removed - RLPy.RReachKey

Returns

RLPy.RStatus.Success - Succeed
RLPy.RStatus.Failure - Fail
 1 # Get human IK component
 2 avatar_list = RLPy.RScene.GetAvatars()
 3 avatar = avatar_list[0]
 4 hik_effector_component = avatar.GetHikEffectorComponent()
 5 
 6 # Add reach key
 7 key = RLPy.RReachKey()
 8 result = hik_effector_component.AddReachKey(RLPy.EHikEffector_RightHand, key)
 9 print(result)
10 
11 # Remove reach key
12 result = hik_effector_component.RemoveReachKey(RLPy.EHikEffector_RightHand, key)
13 print(result)

RLPy.RIHikEffectorComponent.SetActive(self, eEffector, eType, bActive)

Set human IK effector active status with translate/rotate type.

Experimental API

Parameters

eEffector[IN] Human IK effector - RLPy.EHikEffector
  • RLPy.EHikEffector_Invalid
  • RLPy.EHikEffector_Hip
  • RLPy.EHikEffector_LeftFoot
  • RLPy.EHikEffector_RightFoot
  • RLPy.EHikEffector_LeftHand
  • RLPy.EHikEffector_RightHand
  • RLPy.EHikEffector_LeftKnee
  • RLPy.EHikEffector_RightKnee
  • RLPy.EHikEffector_LeftElbow
  • RLPy.EHikEffector_RightElbow
  • RLPy.EHikEffector_ChestOrigin
  • RLPy.EHikEffector_Neck
  • RLPy.EHikEffector_LeftToe
  • RLPy.EHikEffector_RightToe
  • RLPy.EHikEffector_LeftShoulder
  • RLPy.EHikEffector_RightShoulder
  • RLPy.EHikEffector_Head
  • RLPy.EHikEffector_LeftHip
  • RLPy.EHikEffector_RightHip
  • RLPy.EHikEffector_Quantity
eType[IN] Human IK effector type - RLPy.EHikEffectorType
  • RLPy.EHikEffectorType_Translate
  • RLPy.EHikEffectorType_Rotate
bActive[IN] Active status - bool

Returns

RLPy.RStatus.Success - Succeed
RLPy.RStatus.Failure - Fail
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(RLPy.EHikEffector_LeftHand, RLPy.EHikEffectorType_Translate, True)

RLPy.RIHikEffectorComponent.SetBodyWeight(self, fWeight)

Set IK effector weight.

Experimental API

Parameters

fWeight[IN] weight data, the range is from 0.0 to 1.0 - float

Returns

RLPy.RStatus.Success - Succeed
RLPy.RStatus.Failure - Fail
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

RLPy.RIHikEffectorComponent.SetLock(self, eEffector, eType, bLock)

Set human IK effector lock status with translate/rotate type.

Experimental API

Parameters

eEffector[IN] Human IK effector - RLPy.EHikEffector
  • RLPy.EHikEffector_Invalid
  • RLPy.EHikEffector_Hip
  • RLPy.EHikEffector_LeftFoot
  • RLPy.EHikEffector_RightFoot
  • RLPy.EHikEffector_LeftHand
  • RLPy.EHikEffector_RightHand
  • RLPy.EHikEffector_LeftKnee
  • RLPy.EHikEffector_RightKnee
  • RLPy.EHikEffector_LeftElbow
  • RLPy.EHikEffector_RightElbow
  • RLPy.EHikEffector_ChestOrigin
  • RLPy.EHikEffector_Neck
  • RLPy.EHikEffector_LeftToe
  • RLPy.EHikEffector_RightToe
  • RLPy.EHikEffector_LeftShoulder
  • RLPy.EHikEffector_RightShoulder
  • RLPy.EHikEffector_Head
  • RLPy.EHikEffector_LeftHip
  • RLPy.EHikEffector_RightHip
  • RLPy.EHikEffector_Quantity
eType[IN] Human IK effector type - RLPy.EHikEffectorType
  • RLPy.EHikEffectorType_Translate
  • RLPy.EHikEffectorType_Rotate
bLock[IN] Lock status - bool

Returns

RLPy.RStatus.Success - Succeed
RLPy.RStatus.Failure - Fail
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(RLPy.EHikEffector_Head, RLPy.EHikEffectorType_Translate, True);
8 print(result)

RLPy.RIHikEffectorComponent.SetPosition(self, args)

Process world matrix to human IK effector.

Experimental API

Parameters

kWorldMatrix[IN] World matrix.

Returns

RLPy.RStatus.Success - Succeed
RLPy.RStatus.Failure - Fail
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(RLPy.EHikEffector_LeftHand, pos)
9 print(result)

RLPy.RIHikEffectorComponent.Solve(self, eEffector, kMatrix)

Solve human IK effector.

Experimental API

Parameters

kEffectorWorldMatrix[IN] Human IK effector with world matrix.

Returns

Motionbone world matrix

1 # No example