IC Python API:RLPy RVisemeKey

From Reallusion Wiki!
Jump to: navigation, search
Main article: Modules.

Description

RVisemeKey is used to store the Viseme ID and Weight (influence over the motion).

Available VisemeIDs:

NONE = 0,      EE = 1,        ER = 2,        IH = 3,
AH = 4,        OH = 5,        W_OO = 6,      S_Z = 7,
CH_J = 8,      F_V = 9,       TH = 10,       T_L_D_N = 11,
B_M_P = 12,    AE = 14,       R = 15,        K_G_H_NG = 13

See also: RIVisemeComponent

Inheritance

RKey > RVisemeKey
 1 # Get avatar viseme component
 2 avatar_list = RLPy.RScene.GetAvatars()
 3 avatar = avatar_list[0]
 4 viseme_component = avatar.GetVisemeComponent()
 5 
 6 # Add viseme key
 7 key = RLPy.RVisemeKey()
 8 key.SetID(RLPy.EVisemeID_AE)
 9 key.SetWeight(50)
10 key.SetTime(RLPy.RTime(10))
11 result = viseme_component.AddVisemeKey(key)

Constructor

__init__ (self)

Create a new Viseme Key.

1 key = RLPy.RVisemeKey()

__init__ (self, args)

Create a new Viseme Key from an existing Key.

1 key = RLPy.RVisemeKey()
2 key.SetID(RLPy.EVisemeID_AE)
3 key.SetWeight(50)
4 key.SetTime(RLPy.RTime(10))
5 key2 = RLPy.RVisemeKey(key)

Parameters

kRhs [IN] An existing RVisemeKeyobject - RLPy.RVisemeKey

__init__ (self, eID, fWeight)

Create a new Viseme Key and initialize with a specific Key Weight.

Parameters

eID [IN] Viseme ID - RLPy.EVisemeID
fWeight [IN] Viseme motion influence value - float
1 key = RLPy.RVisemeKey(RLPy.EVisemeID_AE,50)

Member Functions

Clone ( self )

Duplicate the Key data and return a new object.

GetID( self )

Get the Key's ID.

Returns

The part type of the viseme ID - RLPy.EVisemeID
1 key = RLPy.RVisemeKey(RLPy.EVisemeID_AE,50)
2 type = key.GetID()

SetID( self, eID )

Set viseme ID of the key.

Parameters

eID [IN] Viseme ID of the key - RLPy.EVisemeID
1 key = RLPy.RVisemeKey()
2 key.SetID(RLPy.EVisemeID_OH )

GetWeight( self )

Get viseme weight of the key.

Return

Weight of the key - float

1 key = RLPy.RVisemeKey(RLPy.EVisemeID_AE,50)
2 weight = key.GetWeight()

SetWeight( self, fWeight )

Set weight of the key.

Parameters

fWeight [IN] Viseme weight of the key. - float (ranges from 0.0 to 100.0).
1 key = RLPy.RVisemeKey()
2 key.SetWeight(50)