AnimationNode
Base class for AnimationTree
nodes. Not related to scene nodes.
class AnimationNode
Base resource for AnimationTree
nodes. In general, it’s not used directly, but you can create custom ones with custom blending formulas.
Inherit this when creating animation nodes mainly for use in AnimationNodeBlendTree
, otherwise AnimationRootNode
should be used instead.
This object emits the following signals:
Superclasses
class Resource
Base class for serializable 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 FilterAction
class Signal1
Signal support.
class Signal2
Signal support.
Type members
Instance members
var animationNodeRemoved: Signal2
Emitted by nodes that inherit from this class and that have an internal tree when one of their animation nodes removes. The animation nodes that emit this signal are
AnimationNodeBlendSpace1D
,AnimationNodeBlendSpace2D
,AnimationNodeStateMachine
, andAnimationNodeBlendTree
.var animationNodeRenamed: Signal1
Emitted by nodes that inherit from this class and that have an internal tree when one of their animation node names changes. The animation nodes that emit this signal are
AnimationNodeBlendSpace1D
,AnimationNodeBlendSpace2D
,AnimationNodeStateMachine
, andAnimationNodeBlendTree
.var filterEnabled: Bool
If
true
, filtering is enabled.var treeChanged: SimpleSignal
Emitted by nodes that inherit from this class and that have an internal tree when one of their animation nodes changes. The animation nodes that emit this signal are
AnimationNodeBlendSpace1D
,AnimationNodeBlendSpace2D
,AnimationNodeStateMachine
,AnimationNodeBlendTree
andAnimationNodeTransition
.func addInput(name: String
) -> Bool Adds an input to the animation node. This is only useful for animation nodes created for use in an
AnimationNodeBlendTree
. If the addition fails, returnsfalse
.func blendAnimation(StringName, time: Double, delta: Double, seeked: Bool, isExternalSeeking: Bool, blend: Double, loopedFlag: Animation.LoopedFlag
) Blend an animation by
blend
amount (name must be valid in the linkedAnimationPlayer
). Atime
anddelta
may be passed, as well as whetherseeked
happened.func blendInput(inputIndex: Int32, time: Double, seek: Bool, isExternalSeeking: Bool, blend: Double, filter: AnimationNode.FilterAction, sync: Bool, testOnly: Bool
) -> Double Blend an input. This is only useful for animation nodes created for an
AnimationNodeBlendTree
. Thetime
parameter is a relative delta, unlessseek
istrue
, in which case it is absolute. A filter mode may be optionally passed (seeFilterAction
for options).func blendNode(name: StringName, node: AnimationNode?, time: Double, seek: Bool, isExternalSeeking: Bool, blend: Double, filter: AnimationNode.FilterAction, sync: Bool, testOnly: Bool
) -> Double Blend another animation node (in case this animation node contains children animation nodes). This function is only useful if you inherit from
AnimationRootNode
instead, else editors will not display your animation node for addition.func findInput(name: String
) -> Int32 Returns the input index which corresponds to
name
. If not found, returns-1
.func getInputCount(
) -> Int32 Amount of inputs in this animation node, only useful for animation nodes that go into
AnimationNodeBlendTree
.func getInputName(input: Int32
) -> String Gets the name of an input by index.
func getParameter(name: StringName
) -> Variant Gets the value of a parameter. Parameters are custom local memory used for your animation nodes, given a resource can be reused in multiple trees.
func isPathFiltered(path: NodePath
) -> Bool Returns whether the given path is filtered.
func removeInput(index: Int32
) Removes an input, call this only when inactive.
func setFilterPath(NodePath, enable: Bool
) Adds or removes a path for the filter.
func setInputName(input: Int32, name: String
) -> Bool Sets the name of the input at the given
input
index. If the setting fails, returnsfalse
.func setParameter(name: StringName, value: Variant
) Sets a custom parameter. These are used as local memory, because resources can be reused across the tree or scenes.
Show implementation details (8)
Hide implementation details
func _getCaption(
) -> String When inheriting from
AnimationRootNode
, implement this virtual method to override the text caption for this animation node.func _getChildByName(StringName
) -> AnimationNode? When inheriting from
AnimationRootNode
, implement this virtual method to return a child animation node by itsname
.func _getChildNodes(
) -> GDictionary When inheriting from
AnimationRootNode
, implement this virtual method to return all children animation nodes in order as aname: node
dictionary.func _getParameterDefaultValue(parameter: StringName
) -> Variant When inheriting from
AnimationRootNode
, implement this virtual method to return the default value of aparameter
. Parameters are custom local memory used for your animation nodes, given a resource can be reused in multiple trees.func _getParameterList(
) -> GArray When inheriting from
AnimationRootNode
, implement this virtual method to return a list of the properties on this animation node. Parameters are custom local memory used for your animation nodes, given a resource can be reused in multiple trees. Format is similar togetPropertyList
.func _hasFilter(
) -> Bool When inheriting from
AnimationRootNode
, implement this virtual method to return whether the blend tree editor should display filter editing on this animation node.func _isParameterReadOnly(parameter: StringName
) -> Bool When inheriting from
AnimationRootNode
, implement this virtual method to return whether theparameter
is read-only. Parameters are custom local memory used for your animation nodes, given a resource can be reused in multiple trees.func _process(time: Double, seek: Bool, isExternalSeeking: Bool, testOnly: Bool
) -> Double When inheriting from
AnimationRootNode
, implement this virtual method to run some code when this animation node is processed. Thetime
parameter is a relative delta, unlessseek
istrue
, in which case it is absolute.
Subclasses
class AnimationNodeOutput
The animation output node of an
AnimationNodeBlendTree
.class AnimationNodeSync
Base class for
AnimationNode
s with more than two input ports that must be synchronized.class AnimationNodeTimeScale
A time-scaling animation node used in
AnimationTree
.class AnimationNodeTimeSeek
A time-seeking animation node used in
AnimationTree
.class AnimationRootNode
Base class for
AnimationNode
s that hold one or multiple composite animations. Usually used fortreeRoot
.