IC Python API:RLPy RIHikEffectorComponent

From Reallusion Wiki!
Revision as of 02:44, 28 March 2019 by 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...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Main article: Modules.

Inheritance

This class inherits public member functions from:

Detailed Description

This class is the interface to the face key in the avatar.

( Experimental Class )
# Get face component
avatar_list = RLPy.RScene.GetAvatars()
avatar = avatar_list[0]
face_component = avatar.GetFaceComponent()

# Add facial clip
time = RLPy.RGlobal.GetTime()
clip_name = "New Clip"
clip_length = RLPy.RTime(50)
result = face_component.AddClip(time, clip_name, clip_length)
print(result)

# Get current facial key
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
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
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
result = face_component.AddHeadKey( RLPy.RTime( 0 ), [ 0.1, 0.4, 0.8 ] ) #[ Vertical, Horizontal, Tilt ]
print(result)

Member Functions

AddClip

RLPy.RIFaceComponent.AddClip ( self, kTime, strName, kLength )

Add facial clip. ( Experimental API )

Parameters

kTime [IN] The time at which to add the clip - RLPy.RTime

strName [IN] Clip name - string

kLength [IN] Clip length - RLPy.RTime

Return Values

RLPy.RStatus.Success Success

RLPy.RStatus.Failure Fail


AddExpressionKey

RLPy.RIFaceComponent.AddExpressionKey ( self, kTime, kMorph, kBone, kCustom, fStrength )

Add an head key in Facial Layer. ( Experimental API )

Parameters

kTime [IN] The time at which to add the key - RLPy.RTime

kMorph [IN] Morph weight - float

kCustom [IN] Custom weight - float

kBone [IN] Bone weight - float

fStrength [IN] The strength of expression - float

Return Values

RLPy.RStatus.Success Success

RLPy.RStatus.Failure Fail


AddEyeKey

RLPy.RIFaceComponent.AddEyeKey ( self, kTime, kLeftEye, kRightEye )

Add an eye key in Facial Layer. ( Experimental API )

Parameters

kTime [IN] The time at which to add the key - RLPy.RTime

kLeftEye [IN] Left eye weight - float

kRightEye [IN] Right eye weight - float

Return Values

RLPy.RStatus.Success Success

RLPy.RStatus.Failure Fail


AddHeadKey

RLPy.RIFaceComponent.AddHeadKey ( self, kTime, kHead )

Add an head key in Facial Layer. ( Experimental API )

Parameters

kTime [IN] The time at which to add the key - RLPy.RTime

kHead [IN] Head rotate weight - float

Return Values

RLPy.RStatus.Success Success

RLPy.RStatus.Failure Fail


GetKey

RLPy.RIFaceComponent.GetKey ( self, kTime, kHead, kLeftEye, kRightEye, kMorph, kBone, kCustom, fStrength )

Get facial key with expressiveness. ( Experimental API )

Parameters

kTime [IN] The time at which to get the key - RLPy.RTime

kHead [OUT] Head weight - float

kLeftEye [OUT] Left eye weight - float

kRightEye [OUT] Right eye weight - float

kMorph [INOUT Morph weight - float

kBone [OUT] Bone weight - float

kCustom [OUT] Custom weight - float

fStrength [OUT] The strength of expression - float

Return Values

RLPy.RStatus.Success Success

RLPy.RStatus.Failure Fail