AnimationMixer
Base class for AnimationPlayer
and AnimationTree
.
class AnimationMixer
Base class for AnimationPlayer
and AnimationTree
to manage animation lists. It also has general properties and methods for playback and blending.
After instantiating the playback information data within the extended class, the blending is processed by the AnimationMixer
.
This object emits the following signals:
Superclasses
class Node
Base class for all scene objects.
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol VariantRepresentable
Types that conform to VariantRepresentable can be stored directly in
Variant
with no conversion. These include all of the Variant types from Godot (for exampleGString
,Rect
,Plane
), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.protocol VariantStorable
Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
Types
enum AnimationCallbackModeDiscrete
enum AnimationCallbackModeMethod
enum AnimationCallbackModeProcess
class Signal1
Signal support.
class Signal2
Signal support.
Type members
Instance members
var active: Bool
If
true
, theAnimationMixer
will be processing.var animationFinished: Signal1
Notifies when an animation finished playing.
var animationLibrariesUpdated: SimpleSignal
Notifies when the animation libraries have changed.
var animationListChanged: SimpleSignal
Notifies when an animation list is changed.
var animationStarted: Signal2
Notifies when an animation starts playing.
var audioMaxPolyphony: Int32
The number of possible simultaneous sounds for each of the assigned AudioStreamPlayers.
var cachesCleared: SimpleSignal
Notifies when the caches have been cleared, either automatically, or manually via
clearCaches
.var callbackModeDiscrete: AnimationMixer.AnimationCallbackModeDiscrete
Ordinarily, tracks can be set to
Animation/UpdateMode/updateDiscrete
to update infrequently, usually when using nearest interpolation.var callbackModeMethod: AnimationMixer.AnimationCallbackModeMethod
The call mode used for “Call Method” tracks.
var callbackModeProcess: AnimationMixer.AnimationCallbackModeProcess
The process notification in which to update animations.
var deterministic: Bool
If
true
, the blending uses the deterministic algorithm. The total weight is not normalized and the result is accumulated with an initial value (0
or a"RESET"
animation if present).var mixerApplied: SimpleSignal
Notifies when the blending result related have been applied to the target objects.
var mixerUpdated: SimpleSignal
Notifies when the property related process have been updated.
var resetOnSave: Bool
This is used by the editor. If set to
true
, the scene will be saved with the effects of the reset animation (the animation with the key"RESET"
) applied as if it had been seeked to time 0, with the editor keeping the values that the scene had before saving.var rootMotionTrack: NodePath
The path to the Animation track used for root motion. Paths must be valid scene-tree paths to a node, and must be specified starting from the parent node of the node that will reproduce the animation. To specify a track that controls properties or bones, append its name after the path, separated by
":"
. For example,"character/skeleton:ankle"
or"character/mesh:transform/local"
.var rootNode: NodePath
The node which node path references will travel from.
func addAnimationLibrary(name: StringName, library: AnimationLibrary?
) -> GodotError Adds
library
to the animation player, under the keyname
.func advance(delta: Double
) Manually advance the animations by the specified time (in seconds).
func capture(name: StringName, duration: Double, transType: Tween.TransitionType, easeType: Tween.EaseType
) If the animation track specified by
name
has an optionAnimation/UpdateMode/updateCapture
, stores current values of the objects indicated by the track path as a cache. If there is already a captured cache, the old cache is discarded.func clearCaches(
) AnimationMixer
caches animated nodes. It may not notice if a node disappears;clearCaches
forces it to update the cache again.func findAnimation(Animation?
) -> StringName Returns the key of
animation
or an emptyStringName
if not found.func findAnimationLibrary(animation: Animation?
) -> StringName Returns the key for the
AnimationLibrary
that containsanimation
or an emptyStringName
if not found.func getAnimation(name: StringName
) -> Animation? Returns the
Animation
with the keyname
. If the animation does not exist,null
is returned and an error is logged.func getAnimationLibrary(name: StringName
) -> AnimationLibrary? Returns the first
AnimationLibrary
with keyname
ornull
if not found.func getAnimationLibraryList(
) -> VariantCollection<StringName> Returns the list of stored library keys.
func getAnimationList(
) -> PackedStringArray Returns the list of stored animation keys.
func getRootMotionPosition(
) -> Vector3 Retrieve the motion delta of position with the
rootMotionTrack
as aVector3
that can be used elsewhere.func getRootMotionPositionAccumulator(
) -> Vector3 Retrieve the blended value of the position tracks with the
rootMotionTrack
as aVector3
that can be used elsewhere.func getRootMotionRotation(
) -> Quaternion Retrieve the motion delta of rotation with the
rootMotionTrack
as aQuaternion
that can be used elsewhere.func getRootMotionRotationAccumulator(
) -> Quaternion Retrieve the blended value of the rotation tracks with the
rootMotionTrack
as aQuaternion
that can be used elsewhere.func getRootMotionScale(
) -> Vector3 Retrieve the motion delta of scale with the
rootMotionTrack
as aVector3
that can be used elsewhere.func getRootMotionScaleAccumulator(
) -> Vector3 Retrieve the blended value of the scale tracks with the
rootMotionTrack
as aVector3
that can be used elsewhere.func hasAnimation(name: StringName
) -> Bool Returns
true
if theAnimationMixer
stores anAnimation
with keyname
.func hasAnimationLibrary(name: StringName
) -> Bool Returns
true
if theAnimationMixer
stores anAnimationLibrary
with keyname
.func removeAnimationLibrary(name: StringName
) Removes the
AnimationLibrary
associated with the keyname
.func renameAnimationLibrary(name: StringName, newname: StringName
) Moves the
AnimationLibrary
associated with the keyname
to the keynewname
.
Show implementation details (1)
Hide implementation details
func _postProcessKeyValue(animation: Animation?, track: Int32, value: Variant, objectId: UInt, objectSubIdx: Int32
) -> Variant A virtual function for processing after getting a key during playback.
Subclasses
class AnimationPlayer
A node used for animation playback.
class AnimationTree
A node used for advanced animation transitions in an
AnimationPlayer
.