class AnimationNode
package godot
extends Resource › Reference › Object
extended by AnimationNodeAdd2, AnimationNodeAdd3, AnimationNodeBlend2, AnimationNodeBlend3, AnimationNodeOneShot, AnimationNodeOutput, AnimationNodeTimeScale, AnimationNodeTimeSeek, AnimationNodeTransition, AnimationRootNode
Base resource for godot.AnimationTree
nodes. In general, it's not used directly, but you can create custom ones with custom blending formulas.
Inherit this when creating nodes mainly for use in godot.AnimationNodeBlendTree
, otherwise godot.AnimationRootNode
should be used instead.
Constructor
Variables
Methods
addInput(name:String):Void
Adds an input to the node. This is only useful for nodes created for use in an godot.AnimationNodeBlendTree
.
blendAnimation(animation:String, time:Single, delta:Single, seeked:Bool, blend:Single):Void
Blend an animation by blend
amount (name must be valid in the linked godot.AnimationPlayer
). A time
and delta
may be passed, as well as whether seek
happened.
blendInput(inputIndex:Int, time:Single, seek:Bool, blend:Single, ?filter:AnimationNode_FilterAction, ?optimize:Bool):Single
Blend an input. This is only useful for nodes created for an godot.AnimationNodeBlendTree
. The time
parameter is a relative delta, unless seek
is true
, in which case it is absolute. A filter mode may be optionally passed (see godot.AnimationNode_FilterAction
for options).
blendNode(name:String, node:AnimationNode, time:Single, seek:Bool, blend:Single, ?filter:AnimationNode_FilterAction, ?optimize:Bool):Single
Blend another animation node (in case this node contains children animation nodes). This function is only useful if you inherit from godot.AnimationRootNode
instead, else editors will not display your node for addition.
getChildByName(name:String):Object
Gets a child node by index (used by editors inheriting from godot.AnimationRootNode
).
getChildNodes():Dictionary
Gets all children nodes in order as a name: node
dictionary. Only useful when inheriting godot.AnimationRootNode
.
getInputCount():Int
Amount of inputs in this node, only useful for nodes that go into godot.AnimationNodeBlendTree
.
getParameter(name:String):Dynamic
Gets the value of a parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees.
getParameterDefaultValue(name:String):Dynamic
Gets the default value of a parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees.
getParameterList():Array
Gets the property information for parameter. Parameters are custom local memory used for your nodes, given a resource can be reused in multiple trees. Format is similar to godot.Object.getPropertyList
.
hasFilter():String
Returns true
whether you want the blend tree editor to display filter editing on this node.
process(time:Single, seek:Bool):Void
User-defined callback called when a custom node is processed. The time
parameter is a relative delta, unless seek
is true
, in which case it is absolute.
Here, call the godot.AnimationNode.blendInput
, godot.AnimationNode.blendNode
or godot.AnimationNode.blendAnimation
functions. You can also use godot.AnimationNode.getParameter
and godot.AnimationNode.setParameter
to modify local memory.
This function should return the time left for the current animation to finish (if unsure, pass the value from the main blend being called).
setParameter(name:String, value:Dynamic):Void
Sets a custom parameter. These are used as local memory, because resources can be reused across the tree or scenes.