Deprecated. A node graph tool for blending multiple animations bound to an godot.AnimationPlayer
. Especially useful for animating characters or other skeleton-based rigs. It can combine several animations to form a desired pose.
It takes godot.Animation
s from an godot.AnimationPlayer
node and mixes them depending on the graph.
See godot.AnimationTree
for a more full-featured replacement of this node.
Constructor
Variables
basePath:NodePath
The node from which to relatively access other nodes.
It accesses the bones, so it should point to the same node the godot.AnimationPlayer
would point its Root Node at.
masterPlayer:NodePath
The path to the godot.AnimationPlayer
from which this godot.AnimationTreePlayer
binds animations to animation nodes.
Once set, godot.Animation
nodes can be added to the godot.AnimationTreePlayer
.
playbackProcessMode:AnimationTreePlayer_AnimationProcessMode
The thread in which to update animations.
Methods
addNode(type:AnimationTreePlayer_NodeType, id:String):Void
Adds a type
node to the graph with name id
.
advance(delta:Single):Void
Shifts position in the animation timeline. delta
is the time in seconds to shift. Events between the current frame and delta
are handled.
animationNodeGetAnimation(id:String):Animation
Returns the godot.AnimationPlayer
's godot.Animation
bound to the godot.AnimationTreePlayer
's animation node with name id
.
animationNodeGetMasterAnimation(id:String):String
Returns the name of the godot.AnimationTreePlayer.masterPlayer
's godot.Animation
bound to this animation node.
animationNodeGetPosition(id:String):Single
Returns the absolute playback timestamp of the animation node with name id
.
animationNodeSetAnimation(id:String, animation:Animation):Void
Binds a new godot.Animation
from the godot.AnimationTreePlayer.masterPlayer
to the godot.AnimationTreePlayer
's animation node with name id
.
animationNodeSetFilterPath(id:String, path:NodePath, enable:Bool):Void
If enable
is true
, the animation node with ID id
turns off the track modifying the property at path
. The modified node's children continue to animate.
animationNodeSetMasterAnimation(id:String, source:String):Void
Binds the godot.Animation
named source
from godot.AnimationTreePlayer.masterPlayer
to the animation node id
. Recalculates caches.
areNodesConnected(id:String, dstId:String, dstInputIdx:Int):Bool
Returns whether node id
and dst_id
are connected at the specified slot.
blend2NodeSetAmount(id:String, blend:Single):Void
Sets the blend amount of a Blend2 node given its name and value.
A Blend2 node blends two animations (A and B) with the amount between 0 and 1.
At 0, output is input A. Towards 1, the influence of A gets lessened, the influence of B gets raised. At 1, output is input B.
blend2NodeSetFilterPath(id:String, path:NodePath, enable:Bool):Void
If enable
is true
, the Blend2 node with name id
turns off the track modifying the property at path
. The modified node's children continue to animate.
blend3NodeSetAmount(id:String, blend:Single):Void
Sets the blend amount of a Blend3 node given its name and value.
A Blend3 Node blends three animations (A, B-, B+) with the amount between -1 and 1.
At -1, output is input B-. From -1 to 0, the influence of B- gets lessened, the influence of A gets raised and the influence of B+ is 0. At 0, output is input A. From 0 to 1, the influence of A gets lessened, the influence of B+ gets raised and the influence of B+ is 0. At 1, output is input B+.
blend4NodeSetAmount(id:String, blend:Vector2):Void
Sets the blend amount of a Blend4 node given its name and value.
A Blend4 Node blends two pairs of animations.
The two pairs are blended like Blend2 and then added together.
connectNodes(id:String, dstId:String, dstInputIdx:Int):Error
Connects node id
to dst_id
at the specified input slot.
disconnectNodes(id:String, dstInputIdx:Int):Void
Disconnects nodes connected to id
at the specified input slot.
mixNodeSetAmount(id:String, ratio:Single):Void
Sets the mix amount of a Mix node given its name and value.
A Mix node adds input b to input a by the amount given by ratio.
nodeGetInputCount(id:String):Int
Returns the input count for a given node. Different types of nodes have different amount of inputs.
nodeGetType(id:String):AnimationTreePlayer_NodeType
Gets the node type, will return from godot.AnimationTreePlayer_NodeType
enum.
nodeSetPosition(id:String, screenPosition:Vector2):Void
Sets the position of a node in the graph given its name and position.
oneshotNodeGetAutorestartDelay(id:String):Single
Returns the autostart delay of a OneShot node given its name.
oneshotNodeGetAutorestartRandomDelay(id:String):Single
Returns the autostart random delay of a OneShot node given its name.
oneshotNodeGetFadeinTime(id:String):Single
Returns the fade in time of a OneShot node given its name.
oneshotNodeGetFadeoutTime(id:String):Single
Returns the fade out time of a OneShot node given its name.
oneshotNodeHasAutorestart(id:String):Bool
Returns whether a OneShot node will auto restart given its name.
oneshotNodeSetAutorestart(id:String, enable:Bool):Void
Sets the autorestart property of a OneShot node given its name and value.
oneshotNodeSetAutorestartDelay(id:String, delaySec:Single):Void
Sets the autorestart delay of a OneShot node given its name and value in seconds.
oneshotNodeSetAutorestartRandomDelay(id:String, randSec:Single):Void
Sets the autorestart random delay of a OneShot node given its name and value in seconds.
oneshotNodeSetFadeinTime(id:String, timeSec:Single):Void
Sets the fade in time of a OneShot node given its name and value in seconds.
oneshotNodeSetFadeoutTime(id:String, timeSec:Single):Void
Sets the fade out time of a OneShot node given its name and value in seconds.
oneshotNodeSetFilterPath(id:String, path:NodePath, enable:Bool):Void
If enable
is true
, the OneShot node with ID id
turns off the track modifying the property at path
. The modified node's children continue to animate.
recomputeCaches():Void
Manually recalculates the cache of track information generated from animation nodes. Needed when external sources modify the animation nodes' state.
timescaleNodeGetScale(id:String):Single
Returns the time scale value of the TimeScale node with name id
.
timescaleNodeSetScale(id:String, scale:Single):Void
Sets the time scale of the TimeScale node with name id
to scale
.
The TimeScale node is used to speed godot.Animation
s up if the scale is above 1 or slow them down if it is below 1.
If applied after a blend or mix, affects all input animations to that blend or mix.
timeseekNodeSeek(id:String, seconds:Single):Void
Sets the time seek value of the TimeSeek node with name id
to seconds
.
This functions as a seek in the godot.Animation
or the blend or mix of godot.Animation
s input in it.
transitionNodeDeleteInput(id:String, inputIdx:Int):Void
Deletes the input at input_idx
for the transition node with name id
.
transitionNodeGetCurrent(id:String):Int
Returns the index of the currently evaluated input for the transition node with name id
.
transitionNodeGetInputCount(id:String):Int
Returns the number of inputs for the transition node with name id
. You can add inputs by right-clicking on the transition node.
transitionNodeGetXfadeTime(id:String):Single
Returns the cross fade time for the transition node with name id
.
transitionNodeHasInputAutoAdvance(id:String, inputIdx:Int):Bool
Returns true
if the input at input_idx
on the transition node with name id
is set to automatically advance to the next input upon completion.
transitionNodeSetCurrent(id:String, inputIdx:Int):Void
The transition node with name id
sets its current input at input_idx
.
transitionNodeSetInputAutoAdvance(id:String, inputIdx:Int, enable:Bool):Void
The transition node with name id
advances to its next input automatically when the input at input_idx
completes.
transitionNodeSetInputCount(id:String, count:Int):Void
Resizes the number of inputs available for the transition node with name id
.
transitionNodeSetXfadeTime(id:String, timeSec:Single):Void
The transition node with name id
sets its cross fade time to time_sec
.