Documentation
¶
Overview ¶
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.
You can access the time information as read-only parameter which is processed and stored in the previous frame for all nodes except AnimationNodeOutput.
Note: If multiple inputs exist in the AnimationNode, which time information takes precedence depends on the type of AnimationNode.
package main import ( "fmt" "graphics.gd/classdb/AnimationTree" "graphics.gd/variant/Object" ) func ExampleAnimationNode(tree AnimationTree.Instance) { var current_length = Object.Get(tree, "parameters/AnimationNodeName/current_length") var current_position = Object.Get(tree, "parameters/AnimationNodeName/current_position") var current_delta = Object.Get(tree, "parameters/AnimationNodeName/current_delta") fmt.Print(current_length, current_position, current_delta) }
Index ¶
- type Advanced
- type Any
- type Expanded
- type Extension
- type FilterAction
- type ID
- type Implementation
- type Instance
- func (self Instance) AddInput(name string) bool
- func (self Instance) AsAnimationNode() Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) AsResource() Resource.Instance
- func (self Instance) BlendAnimation(animation string, time Float.X, delta Float.X, seeked bool, ...)
- func (self Instance) BlendInput(input_index int, time Float.X, seek bool, is_external_seeking bool, ...) Float.X
- func (self Instance) BlendNode(name string, node Instance, time Float.X, seek bool, is_external_seeking bool, ...) Float.X
- func (self Instance) FilterEnabled() bool
- func (self Instance) FindInput(name string) int
- func (self Instance) GetInputCount() int
- func (self Instance) GetInputName(input int) string
- func (self Instance) GetParameter(name string) any
- func (self Instance) GetProcessingAnimationTreeInstanceId() int
- func (self Instance) ID() ID
- func (self Instance) IsPathFiltered(path string) bool
- func (self Instance) IsProcessTesting() bool
- func (self Instance) MoreArgs() MoreArgs
- func (self Instance) OnAnimationNodeRemoved(cb func(object_id int, name string), flags ...Signal.Flags)
- func (self Instance) OnAnimationNodeRenamed(cb func(object_id int, old_name string, new_name string), ...)
- func (self Instance) OnTreeChanged(cb func(), flags ...Signal.Flags)
- func (self Instance) RemoveInput(index int)
- func (self Instance) SetFilterEnabled(value bool)
- func (self Instance) SetFilterPath(path string, enable bool)
- func (self Instance) SetInputName(input int, name string) bool
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetParameter(name string, value any)
- func (self Instance) Virtual(name string) reflect.Value
- type Interface
- type MoreArgs
- func (self MoreArgs) BlendAnimation(animation string, time Float.X, delta Float.X, seeked bool, ...)
- func (self MoreArgs) BlendInput(input_index int, time Float.X, seek bool, is_external_seeking bool, ...) Float.X
- func (self MoreArgs) BlendNode(name string, node Instance, time Float.X, seek bool, is_external_seeking bool, ...) Float.X
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this [Extension]See Interface for methods that can be overridden by T.
func (*Extension[T]) AsAnimationNode ¶
func (*Extension[T]) AsRefCounted ¶
func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted
func (*Extension[T]) AsResource ¶
type FilterAction ¶
type FilterAction int //gd:AnimationNode.FilterAction
const ( // Do not use filtering. FilterIgnore FilterAction = 0 // Paths matching the filter will be allowed to pass. FilterPass FilterAction = 1 // Paths matching the filter will be discarded. FilterStop FilterAction = 2 // Paths matching the filter will be blended (by the blend value). FilterBlend FilterAction = 3 )
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Implementation ¶
type Implementation = implementation
Implementation implements Interface with empty methods.
type Instance ¶
type Instance [1]gdclass.AnimationNode
Instance of the class with convieniently typed arguments and results.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AddInput ¶
Adds an input to the animation node. This is only useful for animation nodes created for use in an AnimationNodeBlendTree. If the addition fails, returns false.
func (Instance) AsAnimationNode ¶
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) AsResource ¶
func (Instance) BlendAnimation ¶
func (self Instance) BlendAnimation(animation string, time Float.X, delta Float.X, seeked bool, is_external_seeking bool, blend Float.X)
Blends an animation by 'blend' amount (name must be valid in the linked AnimationPlayer). A 'time' and 'delta' may be passed, as well as whether 'seeked' happened.
A 'looped_flag' is used by internal processing immediately after the loop.
func (Instance) BlendInput ¶
func (self Instance) BlendInput(input_index int, time Float.X, seek bool, is_external_seeking bool, blend Float.X) Float.X
Blends an input. This is only useful for animation nodes created for an 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.
func (Instance) BlendNode ¶
func (self Instance) BlendNode(name string, node Instance, time Float.X, seek bool, is_external_seeking bool, blend Float.X) Float.X
Blend another animation node (in case this animation node contains child animation nodes). This function is only useful if you inherit from AnimationRootNode instead, otherwise editors will not display your animation node for addition.
func (Instance) FilterEnabled ¶
func (Instance) FindInput ¶
Returns the input index which corresponds to 'name'. If not found, returns -1.
func (Instance) GetInputCount ¶
Amount of inputs in this animation node, only useful for animation nodes that go into AnimationNodeBlendTree.
func (Instance) GetInputName ¶
Gets the name of an input by index.
func (Instance) GetParameter ¶
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 (Instance) GetProcessingAnimationTreeInstanceId ¶
Returns the object id of the AnimationTree that owns this node.
Note: This method should only be called from within the AnimationNodeExtension.ProcessAnimationNode method, and will return an invalid id otherwise.
func (Instance) IsPathFiltered ¶
Returns true if the given path is filtered.
func (Instance) IsProcessTesting ¶
Returns true if this animation node is being processed in test-only mode.
func (Instance) MoreArgs ¶
MoreArgs enables certain functions to be called with additional 'optional' arguments.
func (Instance) OnAnimationNodeRemoved ¶
func (Instance) OnAnimationNodeRenamed ¶
func (Instance) OnTreeChanged ¶
func (Instance) RemoveInput ¶
Removes an input, call this only when inactive.
func (Instance) SetFilterEnabled ¶
func (Instance) SetFilterPath ¶
Adds or removes a path for the filter.
func (Instance) SetInputName ¶
Sets the name of the input at the given 'input' index. If the setting fails, returns false.
func (Instance) SetParameter ¶
Sets a custom parameter. These are used as local memory, because resources can be reused across the tree or scenes.
type Interface ¶
type Interface interface { // When inheriting from [AnimationRootNode], implement this virtual method to return all child animation nodes in order as a name: node dictionary. // // [AnimationRootNode]: https://pkg.go.dev/graphics.gd/classdb/AnimationRootNode GetChildNodes() map[string]struct{} // 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 to [Object.GetPropertyList]. // // [AnimationRootNode]: https://pkg.go.dev/graphics.gd/classdb/AnimationRootNode // [Object.GetPropertyList]: https://pkg.go.dev/graphics.gd/variant/Object#GetPropertyList GetParameterList() []Object.PropertyInfo // When inheriting from [AnimationRootNode], implement this virtual method to return a child animation node by its 'name'. // // [AnimationRootNode]: https://pkg.go.dev/graphics.gd/classdb/AnimationRootNode GetChildByName(name string) Instance // When inheriting from [AnimationRootNode], implement this virtual method to return the default value of a 'parameter'. Parameters are custom local memory used for your animation nodes, given a resource can be reused in multiple trees. // // [AnimationRootNode]: https://pkg.go.dev/graphics.gd/classdb/AnimationRootNode GetParameterDefaultValue(parameter string) any // When inheriting from [AnimationRootNode], implement this virtual method to return whether the 'parameter' is read-only. Parameters are custom local memory used for your animation nodes, given a resource can be reused in multiple trees. // // [AnimationRootNode]: https://pkg.go.dev/graphics.gd/classdb/AnimationRootNode IsParameterReadOnly(parameter string) bool // When inheriting from [AnimationRootNode], implement this virtual method to run some code when this animation node is processed. The 'time' parameter is a relative delta, unless 'seek' is true, in which case it is absolute. // // Here, call the [BlendInput], [BlendNode] or [BlendAnimation] functions. You can also use [GetParameter] and [SetParameter] to modify local memory. // // This function should return the delta. // // [AnimationRootNode]: https://pkg.go.dev/graphics.gd/classdb/AnimationRootNode // [BlendAnimation]: https://pkg.go.dev/graphics.gd/classdb/AnimationNode#Instance.BlendAnimation // [BlendInput]: https://pkg.go.dev/graphics.gd/classdb/AnimationNode#Instance.BlendInput // [BlendNode]: https://pkg.go.dev/graphics.gd/classdb/AnimationNode#Instance.BlendNode // [GetParameter]: https://pkg.go.dev/graphics.gd/classdb/AnimationNode#Instance.GetParameter // [SetParameter]: https://pkg.go.dev/graphics.gd/classdb/AnimationNode#Instance.SetParameter Process(time Float.X, seek bool, is_external_seeking bool, test_only bool) Float.X // When inheriting from [AnimationRootNode], implement this virtual method to override the text caption for this animation node. // // [AnimationRootNode]: https://pkg.go.dev/graphics.gd/classdb/AnimationRootNode GetCaption() string // When inheriting from [AnimationRootNode], implement this virtual method to return whether the blend tree editor should display filter editing on this animation node. // // [AnimationRootNode]: https://pkg.go.dev/graphics.gd/classdb/AnimationRootNode HasFilter() bool }
type MoreArgs ¶
type MoreArgs [1]gdclass.AnimationNode
MoreArgs is a container for Instance functions with additional 'optional' arguments.
func (MoreArgs) BlendAnimation ¶
func (self MoreArgs) BlendAnimation(animation string, time Float.X, delta Float.X, seeked bool, is_external_seeking bool, blend Float.X, looped_flag Animation.LoopedFlag)
Blends an animation by 'blend' amount (name must be valid in the linked AnimationPlayer). A 'time' and 'delta' may be passed, as well as whether 'seeked' happened.
A 'looped_flag' is used by internal processing immediately after the loop.
func (MoreArgs) BlendInput ¶
func (self MoreArgs) BlendInput(input_index int, time Float.X, seek bool, is_external_seeking bool, blend Float.X, filter FilterAction, sync bool, test_only bool) Float.X
Blends an input. This is only useful for animation nodes created for an 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.
func (MoreArgs) BlendNode ¶
func (self MoreArgs) BlendNode(name string, node Instance, time Float.X, seek bool, is_external_seeking bool, blend Float.X, filter FilterAction, sync bool, test_only bool) Float.X
Blend another animation node (in case this animation node contains child animation nodes). This function is only useful if you inherit from AnimationRootNode instead, otherwise editors will not display your animation node for addition.