IC Python API:RLPy RIAvatar

From Reallusion Wiki!
Revision as of 01:32, 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.RIObject *...")

(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 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.
avatar = RLPy.RScene.FindObject( RLPy.EObjectType_Avatar, "Jade" )

# set name
avatar.SetName("new_name")

# get Name
avatar_name = avatar.GetName()
print(avatar_name) # Jade

# set Transform key
control = avatar.GetControl("Transform")
transform = RLPy.RTransform.IDENTITY
transform.T().x = 100.0
transform.T().y = 100.0
transform.T().z = 100.0
control.SetValue(RLPy.RTime(0), transform)

# get component
skeleton = avatar.GetSkeletonComponent()
print(skeleton.GetClipCount())

# set visible key
avatar.SetVisible(RLPy.RTime(600), False)

prop2 = RLPy.RScene.FindObject(RLPy.EObjectType_Prop, "Box2")
# iClone Avatar can't set Parent

# link to & unlink
result = avatar.LinkTo(prop2, RLPy.RTime(0))
result = avatar.UnLink(RLPy.RTime(0))

#get bound
ret_max = RLPy.RVector3()
ret_center = RLPy.RVector3()
ret_min = RLPy.RVector3()
ret = avatar.GetBounds( ret_max, ret_center, ret_min )
print(ret)

#get pivot
ret_pos = RLPy.RVector3()
ret_rot = RLPy.RVector3()
avatar.GetPivot( ret_pos, ret_rot )
print(ret)

#clone object
clone_avatar = avatar.Clone()
print( clone_avatar )

#is selected
RLPy.RScene.SelectObject(avatar)
print(avatar.IsSelected()) #True

Operators

This class supports the following operators:

Member Operation Syntax Description Example
__eq__ Equality a == b If the values of two operands are equal, then the condition becomes true. (a == b) is not true.

Member Functions

GetFaceComponent

RLPy.RIAvatar.GetFaceComponent ( self )

Get face component of the object. ( Experimental API )

Returns

Pointer of the RIFaceComponent object - RLPy.RIFaceComponent

GetHikEffectorComponent

RLPy.RIAvatar.GetHikEffectorComponent ( self )

Get human IK effector component of the object.

Returns

Pointer of the RIHikEffectorComponent object - RLPy.RIHikEffectorComponent

GetMaterialComponent

RLPy.RIAvatar.GetMaterialComponent ( self )

Get material component of the object.

Returns

Pointer of the RIMaterialComponent object - RLPy.RIMaterialComponent

GetMorphComponent

RLPy.RIAvatar.GetMorphComponent ( self )

Get morph component of the object.

Returns

Pointer of the RIMorphComponent object - RLPy.RIMorphComponent

GetSkeletonComponent

RLPy.RIAvatar.GetSkeletonComponent ( self )

Get bone component of the object.

Returns

Pointer of the RISkeletonComponent object - RLPy.RISkeletonComponent

GetVisemeComponent

RLPy.RIAvatar.GetVisemeComponent ( self )

Get viseme component of the object.

Returns

Pointer of the RIVisemeComponent object - RLPy.RIVisemeComponent

SetVisible

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

( Experimental Function ) Set visible status

Parameters

kTime [IN] Specifies the time to set visible - RLPy.RTime

bVisible [IN] Visible status - bool

Return Values

RLPy.RStatus.Success Success

RLPy.RStatus.Failure Fail