FBCharacter Class Reference


Detailed Description

A character is the link between a motion source and a character model.

These classes are under development and may change dramatically between versions. This class exposes part of the functionality associated with a Character. A character can possess a number of potential sources at the same time, such as an actor and another character, but with only one active at any given time. Before setting the InputType to the desired value, one must make sure to have previously set either the InputCharacter or the InputActor.

To obtain the list of characters present in a scene, you need to create an instance of class FBSystem, to obtain the current scene. The FBScene object holds the list of characters in the property Characters.

       FBSystem lSystem;
       FBScene* lScene = lSystem.Scene;
       for( int lIdx = 0; lIdx < lScene->Characters.GetCount(); ++lIdx )
       {
           FBTrace( "Character[%d]: '%s'\n", lIdx, (char*)lScene->Characters[lIdx] );
       }

The current character selected in the Character tool can be obtained via the FBApplication object.

       FBApplication lApplication;
       FBCharacter* lCharacter = lApplication.CurrentCharacter;
       if( lCharacter )
       {
           FBTrace( "Current character is: '%s'\n", (char*)lCharacter->Name );
       }
       else
       {
           FBTrace( "No character currently selected\n" );
       }
Examples
Tasks/EnableGameModeOnSelectedCharacters_Z.py, Tasks/MirrorPoseOverTime.py, Tasks/PlotNonSelectedCharStoryTracks.py, Tasks/PlotSelectedCharStoryTracks.py, Samples/Character/CharacterMarkerSet.py, Samples/Character/CharacterMarkerSetFromActor.py
Inheritance diagram for FBCharacter:

List of all members.

Public Member Functions

 __init__ (str pName, object pObject=None)
 Constructor.
 IObject_Declare (K_IMPLEMENTATION)
 FBDelete ()
 Actual Character destructor.
FBCharacter Clone ()
 Clone the character.
 AddCharacterExtension (FBCharacterExtension pExt)
 AddCharacterExtension.
 RemoveCharacterExtension (FBCharacterExtension pExt)
 Get the model associated with each body part of the character.
FBModel GetModel (FBBodyNodeId pBodyNodeId)
 Get the model associated with each body part of the character.
 GetSkinModelList (tuple pSkinModelList)
 Get the skin model associated with character bones.
FBBodyNodeId GetIndexByModel (FBModel pModel)
 Get the index associated with Given Model.
FBModel GetCtrlRigModel (FBBodyNodeId pBodyNodeId)
 Get the model associated with each body part in the Control Rig of the character.
FBBodyNodeId GetCtrlRigIndexByModel (FBModel pModel)
 Get the index of the model associated with each body part in the Control Rig of the character.
FBModel GetEffectorModel (FBEffectorId pEffectorId, FBEffectorSetID pEffectorSetID=FBEffectorSetDefault)
 Get the model associated with each effector in the Control Rig of the character.
FBModel GetFloorContactModel (FBFloorContactID pMemberIndex)
 Get the model associated with the floor contact ID.
FBModel GetGoalModel (FBBodyNodeId pBodyNodeId)
 Get the goal model associated with each body part in the Character Marker Set of the character.
 GetTOffset (FBBodyNodeId pBodyNodeId, FBVector4 pTVector)
 GetROffset (FBBodyNodeId pBodyNodeId, FBVector3 pRVector)
 GetSOffset (FBBodyNodeId pBodyNodeId, FBSVector pSVector)
 GetTransformOffset (FBBodyNodeId pBodyNodeId, FBMatrix pOffsetMatrix)
 GetParentROffset (FBBodyNodeId pBodyNodeId, FBVector3 pRVector)
bool PlotAnimation (FBCharacterPlotWhere pPlotWhere, FBPlotOptions pPlotOptions)
 Plot the animation of the character.
bool ReadyForRetarget ()
 Test if character is ready for the Retarget operation (basically, is it in character input ?).
 Retarget (bool pOnBaseLayer)
 Retarget the animation from the input character to us.
 CopyAnimation ()
 Copy the animation from the input character to us.
 ResetProperties (FBCharacterResetProperties pType)
 Reset the properties of the character.
 SelectModels (bool pSelect, bool pApplyToCharacter, bool pApplyToRig, bool pApplyToExtensions)
 Select the objects that make a character.
 GoToStancePose (bool pPushUndo=False, bool pIncludeCharacterExtensions=True)
 Set the character in stance pose.
bool SetCharacterizeOn (bool pSetAsBiped)
 Set the Characterize flag on.
str GetCharacterizeError ()
 Get error message for the previous SetCharacterizeOn operation.
 SetCharacterizeOff ()
 Set Characterize flag off.
bool GetCharacterize ()
 Get Characterize flag.
bool CreateControlRig (bool pSetFKIK)
 Create the Control-Rig.
 ConnectControlRig (FBControlSet pControlSet, bool pUpdateLimit, bool pResetHierarchy)
 Connect a Control-Rig to the character.
 DisconnectControlRig ()
 Disconnect the Control-Rig from the character.
bool CreateAuxiliary (FBEffectorId pEffectorId, bool pPivot, float pAuxReachT=100, float pAuxReachR=100)
 Create auxiliary on effector.
FBControlSet GetCurrentControlSet (bool pForce=False)
 Obtain Input ControlSet.
bool CreateCharacterMarkerSet (bool pSetActive)
 Create the Character Marker Set.
FBCharacterMarkerSet GetCharacterMarkerSet (bool pForce=False)
 Obtain Input CharacterMarkerSet.
bool IsParentNodeOffset (FBBodyNodeId pNodeId)
 Check if there is an offset on Parent.
FBCharacterSolver GetExternalSolver ()
 Get a pointer to the external solver of a character, or NULL is no external solver is used on the character.
 SetExternalSolver (int pIndex)
 Set character external solver.
 SetExternalSolver (FBCharacterSolver pSolver)
 Set character solver.
 GetActiveBodyPart (bool pActivePart)
 Get the active body part array.
bool IsRotationPin (FBEffectorId pEffectorIndex)
 Return true if the object is Pinned in Rotation (Manipulation).
bool IsTranslationPin (FBEffectorId pEffectorIndex)
 Return true if the object is Pinned in Translation (Manipulation).
bool IsCtrlSetReady ()
 Return true Ctrl Set is Ready to be used.
bool IsPlottingActorToCtrlRig ()
 Return true if the Actor is currently being plot to the Control Rig.
FBControlSetState GetControlSetEvaluationCache (FBEvaluateInfo pEvaluateInfo)
 Return pointer to evaluation cache that is dedicated for control set and given pEvaluateInfo.
FBEffectorSetState GetEffectorEvaluationCache (FBEvaluateInfo pEvaluateInfo)
 Return pointer to evaluation cache that is dedicated for effector set and given pEvaluateInfo.

Public Attributes

FBPropertyCharacterInputType InputType
 Read Write Property: The input type for the character (ex: Actor).
FBPropertyCharacterKeyingMode KeyingMode
 Read Write Property: The current keying mode.
FBPropertyActor InputActor
 Read Write Property: The index of the actor used for the input.
FBPropertyCharacter InputCharacter
 Read Write Property: The index of the character used for the input.
FBPropertyBase ActiveInput
 Read Write Property: Is the character input active?.
FBPropertyListCharacterExtension CharacterExtensions
 List: Character Extensions in the character.
str mCharacterizeError
 Used to store SetCharacterizeOn errors and warnings.
FBPropertyBase MirrorMode
 Read Write Property: is in mirror mode.
FBPropertyBaseAnimatable ShoulderCorrection
 Read Write Property: shoulder correction values.
FBPropertyBase LeftKneeKillPitch
 Read Write Property: is Pitch used for Left knee.
FBPropertyBase RightKneeKillPitch
 Read Write Property: is Pitch used for Right knee.
FBPropertyBase LeftElbowKillPitch
 Read Write Property: is Pitch used for Left elbow.
FBPropertyBase RightElbowKillPitch
 Read Write Property: is Pitch used for Right elbow.
FBPropertyCharacterHipsTranslationMode HipsTranslationMode
 Read Write Property: Hips Translation Mode.
FBPropertyBase WriteReference
 Read Write Property: are we writing back on reference.
FBPropertyBase SyncMode
 Read Write Property: is character in sync mode.
FBPropertyBase InverseLeftKnee
 Read Write Property: Is left knee inverted.
FBPropertyBase InverseRightKnee
 Read Write Property: Is right knee inverted.
FBPropertyBase InverseLeftElbow
 Read Write Property: Is left elbow inverted.
FBPropertyBase InverseRightElbow
 Read Write Property: Is right elbow inverted.
FBPropertyCharacterRollSolver RollSolver
 Read Write Property: Roll Solver selection.
FBPropertyCharacterContactBehaviour ContactBehaviour
 Read Write Property: Contact Behavior selection.
FBPropertyBaseAnimatable ScaleCompensation
FBPropertyBaseAnimatable HipsHeightCompensation
FBPropertyBaseAnimatable AnkleHeightCompensation
FBPropertyBaseAnimatable AnkleProximityCompensation
FBPropertyBase LockX
 Read Write Property: Lock character skeleton in place on X axis.
FBPropertyBase LockY
 Read Write Property: Lock character skeleton in place on Y axis.
FBPropertyBase LockZ
 Read Write Property: Lock character skeleton in place on Z axis.

Member Function Documentation

__init__ ( str  pName,
object  pObject = None 
)

Constructor.

Parameters:
pNameName of new character.
pObjectFor internal use only. This parameter does not need to be specified by the developer.
Examples
Tasks/EnableGameModeOnSelectedCharacters_Z.py, Tasks/MirrorPoseOverTime.py, Tasks/PlotNonSelectedCharStoryTracks.py, Tasks/PlotSelectedCharStoryTracks.py, Samples/Character/CharacterMarkerSet.py, Samples/Character/CharacterMarkerSetFromActor.py

Reimplemented from FBConstraint.

IObject_Declare ( K_IMPLEMENTATION  )
FBDelete ( )

Actual Character destructor.

This method is used to delete the actual character object represented by an instance of FBCharacter.

Examples
Tasks/DeleteHierarchy.py

Reimplemented from FBComponent.

FBCharacter Clone ( )

Clone the character.

Reimplemented from FBConstraint.

AddCharacterExtension ( FBCharacterExtension  pExt)

AddCharacterExtension.

Parameters:
pExtextension to be added to the character.
RemoveCharacterExtension ( FBCharacterExtension  pExt)

Get the model associated with each body part of the character.

Parameters:
pExtextension to be removed to the character.
FBModel GetModel ( FBBodyNodeId  pBodyNodeId)

Get the model associated with each body part of the character.

Returns:
The model linked to the specified body part.
GetSkinModelList ( tuple  pSkinModelList)

Get the skin model associated with character bones.

Could be deformable model connected to bone via cluster, or non deformable model parented directly under the bones.

Parameters:
pSkinModelListList to be filled up. (will not be cleared)
FBBodyNodeId GetIndexByModel ( FBModel  pModel)

Get the index associated with Given Model.

Returns:
The model linked to the specified body part.
FBModel GetCtrlRigModel ( FBBodyNodeId  pBodyNodeId)

Get the model associated with each body part in the Control Rig of the character.

Returns:
The model in the Control Rig corresponding to the specified body part.
FBBodyNodeId GetCtrlRigIndexByModel ( FBModel  pModel)

Get the index of the model associated with each body part in the Control Rig of the character.

Returns:
The Index if the model in the Control Rig corresponding to the specified body part.
FBModel GetEffectorModel ( FBEffectorId  pEffectorId,
FBEffectorSetID  pEffectorSetID = FBEffectorSetDefault 
)

Get the model associated with each effector in the Control Rig of the character.

Parameters:
pEffectorIdThe effector ID.
pEffectorSetIDId of the ControlSet to obtain, if not specified the current one is taken.
Returns:
The model in the Control Rig corresponding to the specified Effector.
FBModel GetFloorContactModel ( FBFloorContactID  pMemberIndex)

Get the model associated with the floor contact ID.

Parameters:
pMemberIndexId of the floor contact
Returns:
The model associated with the floor contact ID
FBModel GetGoalModel ( FBBodyNodeId  pBodyNodeId)

Get the goal model associated with each body part in the Character Marker Set of the character.

Returns:
The model in the Character Marker Set corresponding to the specified body part.
GetTOffset ( FBBodyNodeId  pBodyNodeId,
FBVector4  pTVector 
)
GetROffset ( FBBodyNodeId  pBodyNodeId,
FBVector3  pRVector 
)
GetSOffset ( FBBodyNodeId  pBodyNodeId,
FBSVector  pSVector 
)
GetTransformOffset ( FBBodyNodeId  pBodyNodeId,
FBMatrix  pOffsetMatrix 
)
GetParentROffset ( FBBodyNodeId  pBodyNodeId,
FBVector3  pRVector 
)
bool PlotAnimation ( FBCharacterPlotWhere  pPlotWhere,
FBPlotOptions  pPlotOptions 
)

Plot the animation of the character.

Parameters:
pPlotWhereWhere to plot a character, control rig or Skeleton
pPlotOptionsOption parameters for plotting
Returns:
True if the operation completed successfully.
bool ReadyForRetarget ( )

Test if character is ready for the Retarget operation (basically, is it in character input ?).

Returns:
True if the character is ready.
Retarget ( bool  pOnBaseLayer)

Retarget the animation from the input character to us.

Parameters:
pOnBaseLayerif true, keys corrections will be made on base layer; else they will be made on another layer.
CopyAnimation ( )

Copy the animation from the input character to us.

ResetProperties ( FBCharacterResetProperties  pType)

Reset the properties of the character.

Parameters:
pTypeSpeficy which properties will be reset.
SelectModels ( bool  pSelect,
bool  pApplyToCharacter,
bool  pApplyToRig,
bool  pApplyToExtensions 
)

Select the objects that make a character.

Parameters:
pSelectTrue to select, false to deselect.
pApplyToCharacterTSould the character contraint be selected ?
pApplyToRigshould The rig (and its children) be selected ?
pApplyToExtensionsShould the character extensions (and their children) be selected ?
GoToStancePose ( bool  pPushUndo = False,
bool  pIncludeCharacterExtensions = True 
)

Set the character in stance pose.

Parameters:
pPushUndoShould we push an undo transaction on the undo stack? Don't push undo in non UI thread.
pIncludeCharacterExtensionsShould the character extensions go to stance pose too?
bool SetCharacterizeOn ( bool  pSetAsBiped)

Set the Characterize flag on.

Parameters:
pSetAsBipedtrue to use biped characterization or false to use quadruped.
Returns:
current state of the flag after the operation (true if it did succeed).
str GetCharacterizeError ( )

Get error message for the previous SetCharacterizeOn operation.

Returns:
The string containing all errors and warnings.
SetCharacterizeOff ( )

Set Characterize flag off.

bool GetCharacterize ( )

Get Characterize flag.

Returns:
Current state of the Characterize flag.
bool CreateControlRig ( bool  pSetFKIK)

Create the Control-Rig.

Parameters:
pSetFKIKtrue to use FK/IK or false to use IK only.
Returns:
current state of the flag after the operation (true if it did succeed).
ConnectControlRig ( FBControlSet  pControlSet,
bool  pUpdateLimit,
bool  pResetHierarchy 
)

Connect a Control-Rig to the character.

Parameters:
pControlSetThe control set to connect. NULL will disconnect the Control-Rig from the character.
pUpdateLimitWhether to update the models' limit for a character. E.g. the Pre rotation and post rotation.
pResetHierarchyWhether to reset hierarchy for a character.
DisconnectControlRig ( )

Disconnect the Control-Rig from the character.

bool CreateAuxiliary ( FBEffectorId  pEffectorId,
bool  pPivot,
float  pAuxReachT = 100,
float  pAuxReachR = 100 
)

Create auxiliary on effector.

Parameters:
pEffectorIdThe effector ID.
pPivotCreate effector or pivot (pivot offset should be set on IKPivot property, at creation default values are set).
pAuxReachTDefault auxiliary effector reach for translation (IK Blend T since MotionBuilder 2013).
pAuxReachRDefault auxiliary effector reach for rotation (IK Blend R since MotionBuilder 2013).
Returns:
True if auxiliary was created (can fail if FBLastEffectorSetIndex limit reached).
FBControlSet GetCurrentControlSet ( bool  pForce = False)

Obtain Input ControlSet.

Parameters:
pForceIf True, will return the current ControlSet even if the character is not in ControlSet Input.
Returns:
Return current Active ControlSet, NULL if none.
bool CreateCharacterMarkerSet ( bool  pSetActive)

Create the Character Marker Set.

Parameters:
pSetActiveTrue when new input should be set and active.
Returns:
True when marker got created and connected to character.
FBCharacterMarkerSet GetCharacterMarkerSet ( bool  pForce = False)

Obtain Input CharacterMarkerSet.

Parameters:
pForceIf True, will return the current CharacterMarkerSet even if the character is not in CharacterMarkerSet Input.
Returns:
Return current Active CharacterMarkerSet, NULL if none.
bool IsParentNodeOffset ( FBBodyNodeId  pNodeId)

Check if there is an offset on Parent.

Parameters:
pNodeIdNode Id to Check.
Returns:
True if there is an offset on Parent.
FBCharacterSolver GetExternalSolver ( )

Get a pointer to the external solver of a character, or NULL is no external solver is used on the character.

Returns:
The pointer of the current External Solver, NULL if it's the internal solver.
SetExternalSolver ( int  pIndex)

Set character external solver.

Parameters:
pIndexIndex of external solver.
SetExternalSolver ( FBCharacterSolver  pSolver)

Set character solver.

Parameters:
pSolverCharacter solver that will be used by the character.
GetActiveBodyPart ( bool  pActivePart)

Get the active body part array.

Parameters:
pActivePartA pointer to an array of bool. On return, the index with a "true" value are active part.
bool IsRotationPin ( FBEffectorId  pEffectorIndex)

Return true if the object is Pinned in Rotation (Manipulation).

Parameters:
pEffectorIndexGiven Index to obtain Model
Returns:
True if the effector is pinned in Rotation
bool IsTranslationPin ( FBEffectorId  pEffectorIndex)

Return true if the object is Pinned in Translation (Manipulation).

Parameters:
pEffectorIndexGiven Index to obtain Model
Returns:
True if the effector is pinned in Translation
bool IsCtrlSetReady ( )

Return true Ctrl Set is Ready to be used.

Returns:
return true if character is active, characterized and is in input control rig
bool IsPlottingActorToCtrlRig ( )

Return true if the Actor is currently being plot to the Control Rig.

Returns:
return true if the Actor is currently being plot to the Control Rig.
FBControlSetState GetControlSetEvaluationCache ( FBEvaluateInfo  pEvaluateInfo)

Return pointer to evaluation cache that is dedicated for control set and given pEvaluateInfo.

Returns:
valid pointer to evaluation cache.
FBEffectorSetState GetEffectorEvaluationCache ( FBEvaluateInfo  pEvaluateInfo)

Return pointer to evaluation cache that is dedicated for effector set and given pEvaluateInfo.

Returns:
valid pointer to evaluation cache.

Member Data Documentation

FBPropertyCharacterInputType InputType

Read Write Property: The input type for the character (ex: Actor).

FBPropertyCharacterKeyingMode KeyingMode

Read Write Property: The current keying mode.

FBPropertyActor InputActor

Read Write Property: The index of the actor used for the input.

FBPropertyCharacter InputCharacter

Read Write Property: The index of the character used for the input.

FBPropertyBase ActiveInput

Read Write Property: Is the character input active?.

Used to store SetCharacterizeOn errors and warnings.

FBPropertyBase MirrorMode

Read Write Property: is in mirror mode.

FBPropertyBaseAnimatable ShoulderCorrection

Read Write Property: shoulder correction values.

FBPropertyBase LeftKneeKillPitch

Read Write Property: is Pitch used for Left knee.

FBPropertyBase RightKneeKillPitch

Read Write Property: is Pitch used for Right knee.

FBPropertyBase LeftElbowKillPitch

Read Write Property: is Pitch used for Left elbow.

FBPropertyBase RightElbowKillPitch

Read Write Property: is Pitch used for Right elbow.

FBPropertyCharacterHipsTranslationMode HipsTranslationMode

Read Write Property: Hips Translation Mode.

FBPropertyBase WriteReference

Read Write Property: are we writing back on reference.

FBPropertyBase SyncMode

Read Write Property: is character in sync mode.

FBPropertyBase InverseLeftKnee

Read Write Property: Is left knee inverted.

FBPropertyBase InverseRightKnee

Read Write Property: Is right knee inverted.

FBPropertyBase InverseLeftElbow

Read Write Property: Is left elbow inverted.

FBPropertyBase InverseRightElbow

Read Write Property: Is right elbow inverted.

FBPropertyCharacterRollSolver RollSolver

Read Write Property: Roll Solver selection.

FBPropertyCharacterContactBehaviour ContactBehaviour

Read Write Property: Contact Behavior selection.

FBPropertyBase LockX

Read Write Property: Lock character skeleton in place on X axis.

FBPropertyBase LockY

Read Write Property: Lock character skeleton in place on Y axis.

FBPropertyBase LockZ

Read Write Property: Lock character skeleton in place on Z axis.


FBCharacter FBCharacter FBCharacter FBCharacter FBCharacter FBCharacter FBCharacter FBCharacter FBCharacter FBCharacter
FBCharacter FBCharacter FBCharacter FBCharacter FBCharacter FBCharacter FBCharacter FBCharacter FBCharacter FBCharacter