IC8 Python API:RLPy RIAvatar

From Reallusion Wiki!
Revision as of 18:40, 12 January 2023 by Chuck (RL) (Talk | contribs) (Created page with "{{TOC}} {{Parent|IC_8_Python_API:Modules|iC8 Modules}} {{Modified}} ==Description== This class is the interface to avatars in the scene. It provides methods to access variou...")

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

Contents

Main article: iC8 Modules.
Last modified: 01/12/2023

Description

This class is the interface to avatars in the scene. It provides methods to access various parts of an avatar such as its name, bones, etc. All methods of this class are implemented by the system.

Class Methods

RLPy.RIAvatar.AutoAdjustFootHeight(self)

Auto adjust foot height.

Returns

RLPy.RStatus.Success - Succeed
RLPy.RStatus.Failure - Fail
1 avatar = RLPy.RScene.FindObject(RLPy.EObjectType_Avatar, "Jade")
2 result = avatar.AutoAdjustFootHeight()

RLPy.RIAvatar.ConvertTo(self, args)

Convert to actor build.

Experimental API

Returns

RLPy.RStatus.Success - Succeed
RLPy.RStatus.Failure - Fail
 1 avatar = RLPy.RScene.FindObject(RLPy.EObjectType_Avatar, "Jade")
 2 
 3 # Convert to actor build
 4 '''
 5 EConvertCharacterLevel_ActorBuild
 6 EConvertCharacterLevel_LOD1
 7 EConvertCharacterLevel_LOD2
 8 '''
 9 convert_type = RLPy.EConvertCharacterLevel_ActorBuild
10 bakeExpression = False
11 bakeTexture = False
12 '''
13 RLPy.EReduceBonePose__None
14 RLPy.EReduceBonePose_TPose
15 RLPy.EReduceBonePose_Default
16 RLPy.EReduceBonePose_Current
17 RLPy.EReduceBonePose_Custom
18 '''
19 pose = RLPy.EReduceBonePose_Default
20 result = avatar.ConvertTo(convert_type, bakeExpression, bakeTexture, pose)

RLPy.RIAvatar.GetAccessories(self, bAll = True)

Get all accessory of the object.

Experimental API

Returns

List of pointer of RIAccessory - list

1 # No example

RLPy.RIAvatar.GetAvatarParts(self, args)

Get all parts of the avatar.

Experimental API

Parameters

eType[IN] specify the type of avatar part, if eType is EAvatarPartType::None, will return all avatar parts of the avatar - RLPy.EAvatarPartType::None

Returns

List of pointer of RIAvatarPart - list

1 # No example

RLPy.RIAvatar.GetAvatarShapingComponent(self)

Get avatar shaping component of the object.

Experimental API

Returns

Pointer of the RIAvatarShapingComponent object - RLPy.RIAvatarShapingComponent

1 # No example

RLPy.RIAvatar.GetAvatarType(self)

Get the current avatar type.

Experimental API

Returns

Avatar Type - RLPy.EAvatarType

  • RLPy.EAvatarType_None
  • RLPy.EAvatarType_Standard
  • RLPy.EAvatarType_NonStandard
  • RLPy.EAvatarType_NonHuman
  • RLPy.EAvatarType_StandardSeries
  • RLPy.EAvatarType_All
1 avatar = RLPy.RScene.FindObject(RLPy.EObjectType_Avatar, "Jade")
2 avatr_type = avatar.GetAvatarType()
3 print(avatar_generation == RLPy.EAvatarType_StandardSeries)

RLPy.RIAvatar.GetClothes(self)

Get all cloth of the object.

Experimental API

Returns

List of pointer of RICloth - list

1 # No example

RLPy.RIAvatar.GetFaceComponent(self)

Get face component of the object.

Experimental API

Returns

Pointer of the RIFaceComponent object - RLPy.RIFaceComponent

1 # No example

RLPy.RIAvatar.GetFacialProfileComponent(self)

Get face component of the object.

Experimental API

Returns

Pointer of the RIFaceComponent object - RLPy.RIFacialProfileComponent

1 # No example

RLPy.RIAvatar.GetFloorContactValue(self, eType)

Get the value of the floor contact.

Experimental API

Parameters

eType[IN] specify the type of floor contect - RLPy.EFloorContactType
  • RLPy.EFloorContactType_HandBottom
  • RLPy.EFloorContactType_HandBack
  • RLPy.EFloorContactType_HandMiddle
  • RLPy.EFloorContactType_HandFront
  • RLPy.EFloorContactType_HandIn
  • RLPy.EFloorContactType_HandOut
  • RLPy.EFloorContactType_FootBottom
  • RLPy.EFloorContactType_FootBack
  • RLPy.EFloorContactType_FootMiddle
  • RLPy.EFloorContactType_FootFront
  • RLPy.EFloorContactType_FootIn
  • RLPy.EFloorContactType_FootOut
  • RLPy.EFloorContactType_All

Returns

The value of the floor contact - float

1 # No example

RLPy.RIAvatar.GetGeneration(self)

Get CharacterCreator avatar generation.

Experimental API

Returns

CharacterCreator Avatar generation - RLPy.EAvatarGeneration

  • RLPy.EAvatarGeneration_None
  • RLPy.EAvatarGeneration_CC_G1_Avatar
  • RLPy.EAvatarGeneration_CC_G3_Avatar
  • RLPy.EAvatarGeneration_CC_G3_Plus_Avatar
  • RLPy.EAvatarGeneration_CC_Game_Base_One
  • RLPy.EAvatarGeneration_CC_Game_Base_Multi
  • RLPy.EAvatarGeneration_ActorBuild
  • RLPy.EAvatarGeneration_ActorScan
1 avatar = RLPy.RScene.FindObject(RLPy.EObjectType_Avatar, "Jade")
2 avatar_generation = avatar.GetGeneration()
3 print(avatar_generation)

RLPy.RIAvatar.GetHairs(self)

Get all hair of the object.

Experimental API

Returns

List of pointer of RIHair - list

1 # No example

RLPy.RIAvatar.GetHikEffectorComponent(self)

Get human IK effector component of the object.

Returns

Pointer of the RIHikEffectorComponent object - RLPy.RIHikEffectorComponent

1 # No example

RLPy.RIAvatar.GetMaterialComponent(self)

Get material component of the object.

Returns

Pointer of the RIMaterialComponent object - RLPy.RIMaterialComponent

1 # No example

RLPy.RIAvatar.GetMorphComponent(self)

Get morph component of the object.

Returns

Pointer of the RIMorphComponent object - RLPy.RIMorphComponent

1 # No example

RLPy.RIAvatar.GetPhysicsComponent(self)

Get physics component of the object.

Returns

Pointer of the RIPhysicsComponentPtr object - RLPy.RIPhysicsComponent

1 # No example

RLPy.RIAvatar.GetSkeletonComponent(self)

Get bone component of the object.

Returns

Pointer of the RISkeletonComponent object - RLPy.RISkeletonComponent

1 # No example

RLPy.RIAvatar.GetVisemeComponent(self)

Get viseme component of the object.

Returns

Pointer of the RIVisemeComponent object - RLPy.RIVisemeComponent

1 # No example

RLPy.RIAvatar.IsVisible(self, kTime)

Check if avatar is visible.

Experimental API

Parameters

kTime[IN] Specifies the time to check if avatar is visible - RLPy.RLTime

Returns

Boolvalue true if avatar is visible; otherwise false.

1 avatar = RLPy.RScene.FindObject(RLPy.EObjectType_Avatar, "Jade")
2 isVisible = avatar.IsVisible(RLPy.RTime(600))
3 print(isVisible)

RLPy.RIAvatar.LoadAccessoryWithTransferSkinWeight(self, kFilePath, kTemplateType)

Load accessory and transfer skin weight automatically.

Experimental API

Parameters

kFilePath[IN] File path of accessory - string
kTemplateType[IN] Template type of transfer skin weight - string

Returns

RLPy.RStatus.Success - Succeed
RLPy.RStatus.Failure - Fail
1 avatar = RLPy.RScene.FindObject(RLPy.EObjectType_Avatar, "Jade")
2 
3 # Load Accessory With Transfer Skin Weight
4 input_file_path = r"C:\test\T-shirt_TPose.obj"
5 type_of_input_clothe = "Default"
6 result = avatar.LoadAccessoryWithTransferSkinWeight( input_file_path, type_of_input_clothe )
7 if result == RLPy.RStatus.Success :
8     print("Success")

RLPy.RIAvatar.LoadHikProfile(self, strPath, bApplyTpose, bApplyBoneMapping, bSendUpdateEvent)

Load humanoid ik profile from path, may cause character turn to nonstandard.

Experimental API

Returns

RLPy.RStatus.Success - Succeed
RLPy.RStatus.Failure - Fail
1 avatar = RLPy.RScene.FindObject(RLPy.EObjectType_Avatar, "Jade")
2 save_hik_path = "./test_hik_profile.3dxProfile"
3 result = avatar.LoadHikProfile(save_hik_path)

RLPy.RIAvatar.SaveHikProfile(self, strPath)

Save humanoid ik profile to path.

Experimental API

Returns

RLPy.RStatus.Success - Succeed
RLPy.RStatus.Failure - Fail
1 avatar = RLPy.RScene.FindObject(RLPy.EObjectType_Avatar, "Jade")
2 # Save humanoid ik profile
3 save_hik_path = "./test_hik_profile.3dxProfile"
4 result = avatar.SaveHikProfile(save_hik_path)

RLPy.RIAvatar.SetFloorContactValue(self, eType, fValue)

Set the value of the floor contact.

Experimental API

Parameters

eType[IN] specify the type of floor contect - RLPy.EFloorContactType
  • RLPy.EFloorContactType_HandBottom
  • RLPy.EFloorContactType_HandBack
  • RLPy.EFloorContactType_HandMiddle
  • RLPy.EFloorContactType_HandFront
  • RLPy.EFloorContactType_HandIn
  • RLPy.EFloorContactType_HandOut
  • RLPy.EFloorContactType_FootBottom
  • RLPy.EFloorContactType_FootBack
  • RLPy.EFloorContactType_FootMiddle
  • RLPy.EFloorContactType_FootFront
  • RLPy.EFloorContactType_FootIn
  • RLPy.EFloorContactType_FootOut
  • RLPy.EFloorContactType_All
fValue[IN] the value of floor contect - float

Returns

RLPy.RStatus.Success - Succeed
RLPy.RStatus.Failure - Fail
1 # No example

RLPy.RIAvatar.SetVisible(self, kTime, bVisible)

Experimental Function)Set visible status

Parameters

kTime[IN] Specifies the time to set visible - RLPy.RLTime
bVisible[IN] Visible status - bool

Returns

RLPy.RStatus.Success - Succeed
RLPy.RStatus.Failure - Fail
1 avatar = RLPy.RScene.FindObject(RLPy.EObjectType_Avatar, "Jade")
2 # set visible key
3 avatar.SetVisible(RLPy.RTime(600), False)