Drag[en]gine Script Module DragonScript  1.7
Dragengine.Scenery.AnimatorInstance Class Reference

Animator instance. More...

Inheritance diagram for Dragengine.Scenery.AnimatorInstance:

Public Member Functions

Constructors
AnimatorInstance new ()
 Create animator instance. More...
 
Management
Animator getAnimator ()
 animator or null if not set. More...
 
void setAnimator (Animator animator)
 Set animator or null if not set. More...
 
void setAnimator (Animator animator, bool keepValues)
 Set animator or null if not set. More...
 
Component getComponent ()
 Component or null if not set. More...
 
void setComponent (Component component)
 Set component or null if not set. More...
 
Animation getAnimation ()
 Animation or null if not set. More...
 
void setAnimation (Animation animation)
 Set animation or null if not set. More...
 
AnimatorRuleBlendMode getBlendMode ()
 Blend mode. More...
 
void setBlendMode (AnimatorRuleBlendMode mode)
 Set blend mode. More...
 
float getBlendFactor ()
 Blend factor in the range from 0 to 1. More...
 
void setBlendFactor (float factor)
 Set blend factor clamped to the range from 0 to 1. More...
 
bool getEnableRetargeting ()
 Retargeting is enabled. More...
 
void setEnableRetargeting (bool enableRetargeting)
 Set if retargeting is enabled. More...
 
void apply ()
 Apply animator. More...
 
void applyDirect ()
 Apply animator immediately. More...
 
void captureState (int identifier)
 Capture current state into snapshot rules matching identifier. More...
 
void storeFrame (int identifier, String moveName, float moveTime)
 Store animation frame from animation into into rules matching identifier. More...
 
Controllers
int getControllerCount ()
 Nnumber of controllers. More...
 
AnimatorController getControllerAt (int index)
 Get wrapper for controller. More...
 
AnimatorController getControllerNamed (String name)
 Get wrapper for controller if present. More...
 
int indexOfControllerNamed (String name)
 Index of named controller or -1 if not found. More...
 
void copyControllerStates (AnimatorInstance instance, int count)
 Copy the first count controller values and vectors from another animator instance. More...
 
void copyControllerStates (AnimatorInstance instance, int offset, int count)
 Copy the first count controller values and vectors from another animator instance. More...
 
void copyNamedControllerStates (AnimatorInstance instance)
 Copy name matching controller values and vectors from another animator instance. More...
 

Detailed Description

Animator instance.

Animators define how animation states are calculated. Animator instances carry out the actual calculation of animation states for a specific world element.

Animator instances have a component and animation set. If the component is not null the animation state can be applied to the set component using apply(). If animation is null the animation set in the animator is used. Otherwise the animation set in the animator instance replaces the one defined in the animator. This allows to reuse an animator with different animations.

This is a native class. It can not be subclassed.

Member Function Documentation

◆ apply()

void Dragengine.Scenery.AnimatorInstance.apply ( )

Apply animator.

Starts calculating animator state in a parallel task. Once completed the animation state is applied to the component. You can access the component state any time after this call. If the calculation is not finished by then the affected call waits until it is finished.

◆ applyDirect()

void Dragengine.Scenery.AnimatorInstance.applyDirect ( )

Apply animator immediately.

Calculates animator state and waits for calculation to complete.

◆ captureState()

void Dragengine.Scenery.AnimatorInstance.captureState ( int  identifier)

Capture current state into snapshot rules matching identifier.

◆ copyControllerStates() [1/2]

void Dragengine.Scenery.AnimatorInstance.copyControllerStates ( AnimatorInstance  instance,
int  count 
)

Copy the first count controller values and vectors from another animator instance.

Bones outside the number of controllers are ignored.

Exceptions
EInvalidParamcount is less than 0.

◆ copyControllerStates() [2/2]

void Dragengine.Scenery.AnimatorInstance.copyControllerStates ( AnimatorInstance  instance,
int  offset,
int  count 
)

Copy the first count controller values and vectors from another animator instance.

Offset index of controller to copy from other animator. Bones outside the number of controllers are ignored.

Exceptions
EInvalidParamcount is less than 0.

◆ copyNamedControllerStates()

void Dragengine.Scenery.AnimatorInstance.copyNamedControllerStates ( AnimatorInstance  instance)

Copy name matching controller values and vectors from another animator instance.

Non-matching controllers are ignored.

◆ getAnimation()

Animation Dragengine.Scenery.AnimatorInstance.getAnimation ( )

Animation or null if not set.

◆ getAnimator()

Animator Dragengine.Scenery.AnimatorInstance.getAnimator ( )

animator or null if not set.

◆ getBlendFactor()

float Dragengine.Scenery.AnimatorInstance.getBlendFactor ( )

Blend factor in the range from 0 to 1.

◆ getBlendMode()

AnimatorRuleBlendMode Dragengine.Scenery.AnimatorInstance.getBlendMode ( )

Blend mode.

◆ getComponent()

Component Dragengine.Scenery.AnimatorInstance.getComponent ( )

Component or null if not set.

◆ getControllerAt()

AnimatorController Dragengine.Scenery.AnimatorInstance.getControllerAt ( int  index)

Get wrapper for controller.

Warning
The wrapper is only valid as long as the animator is not changed and the controller structure in the animator instance is not changed.
Parameters
indexIndex of controller. If index is negative controller count is added to it. This allows to get controllers starting from the last controller.
Exceptions
EOutOfBoundarycontroller is less than -getControllerCount() or larger than or equal to getControllerCount().

◆ getControllerCount()

int Dragengine.Scenery.AnimatorInstance.getControllerCount ( )

Nnumber of controllers.

◆ getControllerNamed()

AnimatorController Dragengine.Scenery.AnimatorInstance.getControllerNamed ( String  name)

Get wrapper for controller if present.

Warning
The wrapper is only valid as long as the animator is not changed and the controller structure in the animator instance is not changed.
Parameters
nameName of controller. If no controller with this name is present null is returned.

◆ getEnableRetargeting()

bool Dragengine.Scenery.AnimatorInstance.getEnableRetargeting ( )

Retargeting is enabled.

◆ indexOfControllerNamed()

int Dragengine.Scenery.AnimatorInstance.indexOfControllerNamed ( String  name)

Index of named controller or -1 if not found.

◆ new()

AnimatorInstance Dragengine.Scenery.AnimatorInstance.new ( )

Create animator instance.

◆ setAnimation()

void Dragengine.Scenery.AnimatorInstance.setAnimation ( Animation  animation)

Set animation or null if not set.

◆ setAnimator() [1/2]

void Dragengine.Scenery.AnimatorInstance.setAnimator ( Animator  animator)

Set animator or null if not set.

Initializes all controllers to the value of the animator.

◆ setAnimator() [2/2]

void Dragengine.Scenery.AnimatorInstance.setAnimator ( Animator  animator,
bool  keepValues 
)

Set animator or null if not set.

If keepValues is true keeps all controller values unchanged which have the same name in the old and new animator. Otherwise initializes all controllers to the value of the new animator.

◆ setBlendFactor()

void Dragengine.Scenery.AnimatorInstance.setBlendFactor ( float  factor)

Set blend factor clamped to the range from 0 to 1.

◆ setBlendMode()

void Dragengine.Scenery.AnimatorInstance.setBlendMode ( AnimatorRuleBlendMode  mode)

Set blend mode.

◆ setComponent()

void Dragengine.Scenery.AnimatorInstance.setComponent ( Component  component)

Set component or null if not set.

◆ setEnableRetargeting()

void Dragengine.Scenery.AnimatorInstance.setEnableRetargeting ( bool  enableRetargeting)

Set if retargeting is enabled.

◆ storeFrame()

void Dragengine.Scenery.AnimatorInstance.storeFrame ( int  identifier,
String  moveName,
float  moveTime 
)

Store animation frame from animation into into rules matching identifier.

If moveName does not exist in the animation a default state is captured.

Exceptions
EInvalidParammoveName is NULL.

The documentation for this class was generated from the following file: