AnimationNode

package
v0.0.0-...-029f470 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2025 License: MIT Imports: 20 Imported by: 0

Documentation

Overview

Package AnimationNode provides methods for working with AnimationNode object instances.

Index

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 Any

type Any interface {
	gd.IsClass
	AsAnimationNode() Instance
}

type FilterAction

type FilterAction = gdclass.AnimationNodeFilterAction //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 Implementation

type Implementation = implementation

Implementation implements Interface with empty methods.

type Instance

type Instance [1]gdclass.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. You can access the time information as read-only parameter which is processed and stored in the previous frame for all nodes except [AnimationNodeOutput]. [b]Note:[/b] If multiple inputs exist in the [AnimationNode], which time information takes precedence depends on the type of [AnimationNode]. [codeblock] var current_length = $AnimationTree[parameters/AnimationNodeName/current_length] var current_position = $AnimationTree[parameters/AnimationNodeName/current_position] var current_delta = $AnimationTree[parameters/AnimationNodeName/current_delta] [/codeblock]

See [Interface] for methods that can be overridden by a [Class] that extends it.

%!(EXTRA string=AnimationNode)

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AddInput

func (self Instance) 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, returns [code]false[/code].

func (Instance) AsAnimationNode

func (self Instance) AsAnimationNode() Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsRefCounted

func (self Instance) AsRefCounted() [1]gd.RefCounted

func (Instance) AsResource

func (self Instance) AsResource() Resource.Instance

func (Instance) BlendAnimation

func (self Instance) BlendAnimation(animation string, time Float.X, delta Float.X, seeked bool, is_external_seeking bool, blend Float.X)

Blend an animation by [param blend] amount (name must be valid in the linked [AnimationPlayer]). A [param time] and [param delta] may be passed, as well as whether [param seeked] happened. A [param looped_flag] is used by internal processing immediately after the loop. See also [enum Animation.LoopedFlag].

func (Instance) BlendInput

func (self Instance) BlendInput(input_index int, time Float.X, seek bool, is_external_seeking bool, blend Float.X) Float.X

Blend an input. This is only useful for animation nodes created for an [AnimationNodeBlendTree]. The [param time] parameter is a relative delta, unless [param seek] is [code]true[/code], in which case it is absolute. A filter mode may be optionally passed (see [enum FilterAction] for options).

func (Instance) BlendNode

func (self Instance) BlendNode(name string, node [1]gdclass.AnimationNode, 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 (self Instance) FilterEnabled() bool

func (Instance) FindInput

func (self Instance) FindInput(name string) int

Returns the input index which corresponds to [param name]. If not found, returns [code]-1[/code].

func (Instance) GetInputCount

func (self Instance) GetInputCount() int

Amount of inputs in this animation node, only useful for animation nodes that go into [AnimationNodeBlendTree].

func (Instance) GetInputName

func (self Instance) GetInputName(input int) string

Gets the name of an input by index.

func (Instance) GetParameter

func (self Instance) GetParameter(name string) any

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) IsPathFiltered

func (self Instance) IsPathFiltered(path string) bool

Returns whether the given path is filtered.

func (Instance) OnAnimationNodeRemoved

func (self Instance) OnAnimationNodeRemoved(cb func(object_id int, name string))

func (Instance) OnAnimationNodeRenamed

func (self Instance) OnAnimationNodeRenamed(cb func(object_id int, old_name string, new_name string))

func (Instance) OnTreeChanged

func (self Instance) OnTreeChanged(cb func())

func (Instance) RemoveInput

func (self Instance) RemoveInput(index int)

Removes an input, call this only when inactive.

func (Instance) SetFilterEnabled

func (self Instance) SetFilterEnabled(value bool)

func (Instance) SetFilterPath

func (self Instance) SetFilterPath(path string, enable bool)

Adds or removes a path for the filter.

func (Instance) SetInputName

func (self Instance) SetInputName(input int, name string) bool

Sets the name of the input at the given [param input] index. If the setting fails, returns [code]false[/code].

func (Instance) SetParameter

func (self Instance) SetParameter(name string, value any)

Sets a custom parameter. These are used as local memory, because resources can be reused across the tree or scenes.

func (*Instance) UnsafePointer

func (self *Instance) UnsafePointer() unsafe.Pointer

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

type Interface

type Interface interface {
	//When inheriting from [AnimationRootNode], implement this virtual method to return all child animation nodes in order as a [code]name: node[/code] dictionary.
	GetChildNodes() map[any]any
	//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 [method Object.get_property_list].
	GetParameterList() []any
	//When inheriting from [AnimationRootNode], implement this virtual method to return a child animation node by its [param name].
	GetChildByName(name string) [1]gdclass.AnimationNode
	//When inheriting from [AnimationRootNode], implement this virtual method to return the default value of a [param parameter]. Parameters are custom local memory used for your animation nodes, given a resource can be reused in multiple trees.
	GetParameterDefaultValue(parameter string) any
	//When inheriting from [AnimationRootNode], implement this virtual method to return whether the [param parameter] is read-only. Parameters are custom local memory used for your animation nodes, given a resource can be reused in multiple trees.
	IsParameterReadOnly(parameter string) bool
	//When inheriting from [AnimationRootNode], implement this virtual method to run some code when this animation node is processed. The [param time] parameter is a relative delta, unless [param seek] is [code]true[/code], in which case it is absolute.
	//Here, call the [method blend_input], [method blend_node] or [method blend_animation] functions. You can also use [method get_parameter] and [method set_parameter] to modify local memory.
	//This function should return the delta.
	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.
	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.
	HasFilter() bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL