Drag[en]gine Script Module DragonScript 1.35
Loading...
Searching...
No Matches
Dragengine.Scenery.AnimatorInstance Class Reference

Animator instance. More...

Inheritance diagram for Dragengine.Scenery.AnimatorInstance:

Public Member Functions

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

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.

References getProtectDynamicBones(), and setEnableRetargeting().

Referenced by storeFrame().

◆ applyDirect()

void Dragengine.Scenery.AnimatorInstance.applyDirect ( )

Apply animator immediately.

Calculates animator state and waits for calculation to complete.

References setProtectDynamicBones().

Referenced by getControllerCount().

◆ captureState()

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

Capture current state into snapshot rules matching identifier.

Referenced by getControllerCount().

◆ 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.

Referenced by copyNamedControllerStates().

◆ 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.

References getControllerAt().

◆ copyNamedControllerStates()

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

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

Non-matching controllers are ignored.

References copyControllerStates(), copyNamedControllerStates(), getControllerNamed(), and indexOfControllerNamed().

Referenced by copyNamedControllerStates().

◆ getAnimation()

Animation Dragengine.Scenery.AnimatorInstance.getAnimation ( )

Animation or null if not set.

Referenced by getBlendMode().

◆ getAnimator()

Animator Dragengine.Scenery.AnimatorInstance.getAnimator ( )

animator or null if not set.

References getAnimator().

Referenced by getAnimator().

◆ getBlendFactor()

float Dragengine.Scenery.AnimatorInstance.getBlendFactor ( )

Blend factor in the range from 0 to 1.

Referenced by getProtectDynamicBones().

◆ getBlendMode()

AnimatorRuleBlendMode Dragengine.Scenery.AnimatorInstance.getBlendMode ( )

Blend mode.

References getAnimation().

Referenced by setBlendFactor().

◆ getComponent()

Component Dragengine.Scenery.AnimatorInstance.getComponent ( )

Component or null if not set.

References setAnimator().

Referenced by setComponent().

◆ 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().

References storeFrame().

Referenced by copyControllerStates().

◆ getControllerCount()

int Dragengine.Scenery.AnimatorInstance.getControllerCount ( )

Nnumber of controllers.

References applyDirect(), and captureState().

Referenced by indexOfControllerNamed().

◆ 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.

Referenced by copyNamedControllerStates().

◆ getEnableRetargeting()

bool Dragengine.Scenery.AnimatorInstance.getEnableRetargeting ( )

Retargeting is enabled.

Referenced by setProtectDynamicBones().

◆ getProtectDynamicBones()

bool Dragengine.Scenery.AnimatorInstance.getProtectDynamicBones ( )

Protect dynamic bones from being animated.

References getBlendFactor().

Referenced by apply().

◆ indexOfControllerNamed()

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

Index of named controller or -1 if not found.

References getControllerCount().

Referenced by copyNamedControllerStates().

◆ new()

AnimatorInstance Dragengine.Scenery.AnimatorInstance.new ( )

Create animator instance.

References new().

Referenced by new().

◆ setAnimation()

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

Set animation or null if not set.

References setComponent().

Referenced by setBlendMode().

◆ 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.

References setAnimator().

Referenced by getComponent(), and setAnimator().

◆ 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.

References getBlendMode().

Referenced by setProtectDynamicBones().

◆ setBlendMode()

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

Set blend mode.

References setAnimation().

Referenced by setEnableRetargeting().

◆ setComponent()

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

Set component or null if not set.

References getComponent().

Referenced by setAnimation().

◆ setEnableRetargeting()

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

Set if retargeting is enabled.

References setBlendMode().

Referenced by apply().

◆ setProtectDynamicBones()

void Dragengine.Scenery.AnimatorInstance.setProtectDynamicBones ( bool protectDynamicBones)

Set if dynamic bones ar protected from being animated.

References getEnableRetargeting(), and setBlendFactor().

Referenced by applyDirect().

◆ 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.

References apply().

Referenced by getControllerAt().


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