Documentation
¶
Overview ¶
This resource holds data that can be used to animate anything in the engine. Animations are divided into tracks and each track must be linked to a node. The state of that node can be changed through time, by adding timed keys (events) to the track.
package main import "graphics.gd/classdb/Animation" func ExampleAnimation() { // This creates an animation that makes the node "Enemy" move to the right by // 100 pixels in 2.0 seconds. var animation = Animation.New() var track_index = animation.AddTrack(Animation.TypeValue) animation.TrackSetPath(track_index, "Enemy:position:x") animation.TrackInsertKey(track_index, 0.0, 0) animation.TrackInsertKey(track_index, 2.0, 100) animation.SetLength(2.0) }
Animations are just data containers, and must be added to nodes such as an graphics.gd/classdb/AnimationPlayer to be played back. Animation tracks have different types, each with its own set of dedicated methods. Check TrackType to see available types.
Note: For 3D position/rotation/scale, using the dedicated TypePosition3d, TypeRotation3d and TypeScale3d track types instead of TypeValue is recommended for performance reasons.
Index ¶
- type Advanced
- type Any
- type Expanded
- func (self Expanded) AddTrack(atype TrackType, at_position int) int
- func (self Expanded) AudioTrackInsertKey(track_idx int, time Float.X, stream Resource.Instance, start_offset Float.X, ...) int
- func (self Expanded) BezierTrackInsertKey(track_idx int, time Float.X, value Float.X, in_handle Vector2.XY, ...) int
- func (self Expanded) BezierTrackSetKeyInHandle(track_idx int, key_idx int, in_handle Vector2.XY, ...)
- func (self Expanded) BezierTrackSetKeyOutHandle(track_idx int, key_idx int, out_handle Vector2.XY, ...)
- func (self Expanded) BlendShapeTrackInterpolate(track_idx int, time_sec Float.X, backward bool) Float.X
- func (self Expanded) Compress(page_size int, fps int, split_tolerance Float.X)
- func (self Expanded) Optimize(allowed_velocity_err Float.X, allowed_angular_err Float.X, precision int)
- func (self Expanded) PositionTrackInterpolate(track_idx int, time_sec Float.X, backward bool) Vector3.XYZ
- func (self Expanded) RotationTrackInterpolate(track_idx int, time_sec Float.X, backward bool) Quaternion.IJKX
- func (self Expanded) ScaleTrackInterpolate(track_idx int, time_sec Float.X, backward bool) Vector3.XYZ
- func (self Expanded) TrackFindKey(track_idx int, time Float.X, find_mode FindMode, limit bool, backward bool) int
- func (self Expanded) TrackInsertKey(track_idx int, time Float.X, key any, transition Float.X) int
- func (self Expanded) ValueTrackInterpolate(track_idx int, time_sec Float.X, backward bool) any
- type Extension
- type FindMode
- type ID
- type Instance
- func (self Instance) AddMarker(name string, time Float.X)
- func (self Instance) AddTrack(atype TrackType) int
- func (self Instance) AnimationTrackGetKeyAnimation(track_idx int, key_idx int) string
- func (self Instance) AnimationTrackInsertKey(track_idx int, time Float.X, animation string) int
- func (self Instance) AnimationTrackSetKeyAnimation(track_idx int, key_idx int, animation string)
- func (self Instance) AsAnimation() Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) AsResource() Resource.Instance
- func (self Instance) AudioTrackGetKeyEndOffset(track_idx int, key_idx int) Float.X
- func (self Instance) AudioTrackGetKeyStartOffset(track_idx int, key_idx int) Float.X
- func (self Instance) AudioTrackGetKeyStream(track_idx int, key_idx int) Resource.Instance
- func (self Instance) AudioTrackInsertKey(track_idx int, time Float.X, stream Resource.Instance) int
- func (self Instance) AudioTrackIsUseBlend(track_idx int) bool
- func (self Instance) AudioTrackSetKeyEndOffset(track_idx int, key_idx int, offset Float.X)
- func (self Instance) AudioTrackSetKeyStartOffset(track_idx int, key_idx int, offset Float.X)
- func (self Instance) AudioTrackSetKeyStream(track_idx int, key_idx int, stream Resource.Instance)
- func (self Instance) AudioTrackSetUseBlend(track_idx int, enable bool)
- func (self Instance) BezierTrackGetKeyInHandle(track_idx int, key_idx int) Vector2.XY
- func (self Instance) BezierTrackGetKeyOutHandle(track_idx int, key_idx int) Vector2.XY
- func (self Instance) BezierTrackGetKeyValue(track_idx int, key_idx int) Float.X
- func (self Instance) BezierTrackInsertKey(track_idx int, time Float.X, value Float.X) int
- func (self Instance) BezierTrackInterpolate(track_idx int, time Float.X) Float.X
- func (self Instance) BezierTrackSetKeyInHandle(track_idx int, key_idx int, in_handle Vector2.XY)
- func (self Instance) BezierTrackSetKeyOutHandle(track_idx int, key_idx int, out_handle Vector2.XY)
- func (self Instance) BezierTrackSetKeyValue(track_idx int, key_idx int, value Float.X)
- func (self Instance) BlendShapeTrackInsertKey(track_idx int, time Float.X, amount Float.X) int
- func (self Instance) BlendShapeTrackInterpolate(track_idx int, time_sec Float.X) Float.X
- func (self Instance) CaptureIncluded() bool
- func (self Instance) Clear()
- func (self Instance) Compress()
- func (self Instance) CopyTrack(track_idx int, to_animation Instance)
- func (self Instance) FindTrack(path string, atype TrackType) int
- func (self Instance) GetMarkerAtTime(time Float.X) string
- func (self Instance) GetMarkerColor(name string) Color.RGBA
- func (self Instance) GetMarkerNames() []string
- func (self Instance) GetMarkerTime(name string) Float.X
- func (self Instance) GetNextMarker(time Float.X) string
- func (self Instance) GetPrevMarker(time Float.X) string
- func (self Instance) GetTrackCount() int
- func (self Instance) HasMarker(name string) bool
- func (self Instance) ID() ID
- func (self Instance) Length() Float.X
- func (self Instance) LoopMode() LoopMode
- func (self Instance) MethodTrackGetName(track_idx int, key_idx int) string
- func (self Instance) MethodTrackGetParams(track_idx int, key_idx int) []any
- func (self Instance) Optimize()
- func (self Instance) PositionTrackInsertKey(track_idx int, time Float.X, position Vector3.XYZ) int
- func (self Instance) PositionTrackInterpolate(track_idx int, time_sec Float.X) Vector3.XYZ
- func (self Instance) RemoveMarker(name string)
- func (self Instance) RemoveTrack(track_idx int)
- func (self Instance) RotationTrackInsertKey(track_idx int, time Float.X, rotation Quaternion.IJKX) int
- func (self Instance) RotationTrackInterpolate(track_idx int, time_sec Float.X) Quaternion.IJKX
- func (self Instance) ScaleTrackInsertKey(track_idx int, time Float.X, scale Vector3.XYZ) int
- func (self Instance) ScaleTrackInterpolate(track_idx int, time_sec Float.X) Vector3.XYZ
- func (self Instance) SetLength(value Float.X)
- func (self Instance) SetLoopMode(value LoopMode)
- func (self Instance) SetMarkerColor(name string, color Color.RGBA)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetStep(value Float.X)
- func (self Instance) Step() Float.X
- func (self Instance) TrackFindKey(track_idx int, time Float.X) int
- func (self Instance) TrackGetInterpolationLoopWrap(track_idx int) bool
- func (self Instance) TrackGetInterpolationType(track_idx int) InterpolationType
- func (self Instance) TrackGetKeyCount(track_idx int) int
- func (self Instance) TrackGetKeyTime(track_idx int, key_idx int) Float.X
- func (self Instance) TrackGetKeyTransition(track_idx int, key_idx int) Float.X
- func (self Instance) TrackGetKeyValue(track_idx int, key_idx int) any
- func (self Instance) TrackGetPath(track_idx int) string
- func (self Instance) TrackGetType(track_idx int) TrackType
- func (self Instance) TrackInsertKey(track_idx int, time Float.X, key any) int
- func (self Instance) TrackIsCompressed(track_idx int) bool
- func (self Instance) TrackIsEnabled(track_idx int) bool
- func (self Instance) TrackIsImported(track_idx int) bool
- func (self Instance) TrackMoveDown(track_idx int)
- func (self Instance) TrackMoveTo(track_idx int, to_idx int)
- func (self Instance) TrackMoveUp(track_idx int)
- func (self Instance) TrackRemoveKey(track_idx int, key_idx int)
- func (self Instance) TrackRemoveKeyAtTime(track_idx int, time Float.X)
- func (self Instance) TrackSetEnabled(track_idx int, enabled bool)
- func (self Instance) TrackSetImported(track_idx int, imported bool)
- func (self Instance) TrackSetInterpolationLoopWrap(track_idx int, interpolation bool)
- func (self Instance) TrackSetInterpolationType(track_idx int, interpolation InterpolationType)
- func (self Instance) TrackSetKeyTime(track_idx int, key_idx int, time Float.X)
- func (self Instance) TrackSetKeyTransition(track_idx int, key_idx int, transition Float.X)
- func (self Instance) TrackSetKeyValue(track_idx int, key int, value any)
- func (self Instance) TrackSetPath(track_idx int, path string)
- func (self Instance) TrackSwap(track_idx int, with_idx int)
- func (self Instance) ValueTrackGetUpdateMode(track_idx int) UpdateMode
- func (self Instance) ValueTrackInterpolate(track_idx int, time_sec Float.X) any
- func (self Instance) ValueTrackSetUpdateMode(track_idx int, mode UpdateMode)
- func (self Instance) Virtual(name string) reflect.Value
- type InterpolationType
- type LoopMode
- type LoopedFlag
- type TrackType
- type UpdateMode
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 Expanded ¶
func (Expanded) AudioTrackInsertKey ¶
func (self Expanded) AudioTrackInsertKey(track_idx int, time Float.X, stream Resource.Instance, start_offset Float.X, end_offset Float.X) int
Inserts an Audio Track key at the given 'time' in seconds. The 'track_idx' must be the index of an Audio Track.
'stream' is the graphics.gd/classdb/AudioStream resource to play. 'start_offset' is the number of seconds cut off at the beginning of the audio stream, while 'end_offset' is at the ending.
func (Expanded) BezierTrackInsertKey ¶
func (self Expanded) BezierTrackInsertKey(track_idx int, time Float.X, value Float.X, in_handle Vector2.XY, out_handle Vector2.XY) int
Inserts a Bezier Track key at the given 'time' in seconds. The 'track_idx' must be the index of a Bezier Track.
'in_handle' is the left-side weight of the added Bezier curve point, 'out_handle' is the right-side one, while 'value' is the actual value at this point.
func (Expanded) BezierTrackSetKeyInHandle ¶
func (self Expanded) BezierTrackSetKeyInHandle(track_idx int, key_idx int, in_handle Vector2.XY, balanced_value_time_ratio Float.X)
Sets the in handle of the key identified by 'key_idx' to value 'in_handle'. The 'track_idx' must be the index of a Bezier Track.
func (Expanded) BezierTrackSetKeyOutHandle ¶
func (self Expanded) BezierTrackSetKeyOutHandle(track_idx int, key_idx int, out_handle Vector2.XY, balanced_value_time_ratio Float.X)
Sets the out handle of the key identified by 'key_idx' to value 'out_handle'. The 'track_idx' must be the index of a Bezier Track.
func (Expanded) BlendShapeTrackInterpolate ¶
func (self Expanded) BlendShapeTrackInterpolate(track_idx int, time_sec Float.X, backward bool) Float.X
Returns the interpolated blend shape value at the given time (in seconds). The 'track_idx' must be the index of a blend shape track.
func (Expanded) Compress ¶
Compress the animation and all its tracks in-place. This will make Instance.TrackIsCompressed return true once called on this graphics.gd/classdb/Animation. Compressed tracks require less memory to be played, and are designed to be used for complex 3D animations (such as cutscenes) imported from external 3D software. Compression is lossy, but the difference is usually not noticeable in real world conditions.
Note: Compressed tracks have various limitations (such as not being editable from the editor), so only use compressed animations if you actually need them.
func (Expanded) Optimize ¶
func (self Expanded) Optimize(allowed_velocity_err Float.X, allowed_angular_err Float.X, precision int)
Optimize the animation and all its tracks in-place. This will preserve only as many keys as are necessary to keep the animation within the specified bounds.
func (Expanded) PositionTrackInterpolate ¶
func (self Expanded) PositionTrackInterpolate(track_idx int, time_sec Float.X, backward bool) Vector3.XYZ
Returns the interpolated position value at the given time (in seconds). The 'track_idx' must be the index of a 3D position track.
func (Expanded) RotationTrackInterpolate ¶
func (self Expanded) RotationTrackInterpolate(track_idx int, time_sec Float.X, backward bool) Quaternion.IJKX
Returns the interpolated rotation value at the given time (in seconds). The 'track_idx' must be the index of a 3D rotation track.
func (Expanded) ScaleTrackInterpolate ¶
func (self Expanded) ScaleTrackInterpolate(track_idx int, time_sec Float.X, backward bool) Vector3.XYZ
Returns the interpolated scale value at the given time (in seconds). The 'track_idx' must be the index of a 3D scale track.
func (Expanded) TrackFindKey ¶
func (self Expanded) TrackFindKey(track_idx int, time Float.X, find_mode FindMode, limit bool, backward bool) int
Finds the key index by time in a given track. Optionally, only find it if the approx/exact time is given.
If 'limit' is true, it does not return keys outside the animation range.
If 'backward' is true, the direction is reversed in methods that rely on one directional processing.
For example, in case 'find_mode' is FindModeNearest, if there is no key in the current position just after seeked, the first key found is retrieved by searching before the position, but if 'backward' is true, the first key found is retrieved after the position.
func (Expanded) TrackInsertKey ¶
Inserts a generic key in a given track. Returns the key index.
func (Expanded) ValueTrackInterpolate ¶
Returns the interpolated value at the given time (in seconds). The 'track_idx' must be the index of a value track.
A 'backward' mainly affects the direction of key retrieval of the track with UpdateDiscrete converted by [Animationmixer.AnimationCallbackModeDiscreteForceContinuous] to match the result with Instance.TrackFindKey.
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
func (*Extension[T]) AsAnimation ¶
func (*Extension[T]) AsRefCounted ¶
func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted
func (*Extension[T]) AsResource ¶
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 Instance ¶
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) AnimationTrackGetKeyAnimation ¶
Returns the animation name at the key identified by 'key_idx'. The 'track_idx' must be the index of an Animation Track.
func (Instance) AnimationTrackInsertKey ¶
Inserts a key with value 'animation' at the given 'time' (in seconds). The 'track_idx' must be the index of an Animation Track.
func (Instance) AnimationTrackSetKeyAnimation ¶
Sets the key identified by 'key_idx' to value 'animation'. The 'track_idx' must be the index of an Animation Track.
func (Instance) AsAnimation ¶
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) AsResource ¶
func (Instance) AudioTrackGetKeyEndOffset ¶
Returns the end offset of the key identified by 'key_idx'. The 'track_idx' must be the index of an Audio Track.
End offset is the number of seconds cut off at the ending of the audio stream.
func (Instance) AudioTrackGetKeyStartOffset ¶
Returns the start offset of the key identified by 'key_idx'. The 'track_idx' must be the index of an Audio Track.
Start offset is the number of seconds cut off at the beginning of the audio stream.
func (Instance) AudioTrackGetKeyStream ¶
Returns the audio stream of the key identified by 'key_idx'. The 'track_idx' must be the index of an Audio Track.
func (Instance) AudioTrackInsertKey ¶
Inserts an Audio Track key at the given 'time' in seconds. The 'track_idx' must be the index of an Audio Track.
'stream' is the graphics.gd/classdb/AudioStream resource to play. 'start_offset' is the number of seconds cut off at the beginning of the audio stream, while 'end_offset' is at the ending.
func (Instance) AudioTrackIsUseBlend ¶
Returns true if the track at 'track_idx' will be blended with other animations.
func (Instance) AudioTrackSetKeyEndOffset ¶
Sets the end offset of the key identified by 'key_idx' to value 'offset'. The 'track_idx' must be the index of an Audio Track.
func (Instance) AudioTrackSetKeyStartOffset ¶
Sets the start offset of the key identified by 'key_idx' to value 'offset'. The 'track_idx' must be the index of an Audio Track.
func (Instance) AudioTrackSetKeyStream ¶
Sets the stream of the key identified by 'key_idx' to value 'stream'. The 'track_idx' must be the index of an Audio Track.
func (Instance) AudioTrackSetUseBlend ¶
Sets whether the track will be blended with other animations. If true, the audio playback volume changes depending on the blend value.
func (Instance) BezierTrackGetKeyInHandle ¶
Returns the in handle of the key identified by 'key_idx'. The 'track_idx' must be the index of a Bezier Track.
func (Instance) BezierTrackGetKeyOutHandle ¶
Returns the out handle of the key identified by 'key_idx'. The 'track_idx' must be the index of a Bezier Track.
func (Instance) BezierTrackGetKeyValue ¶
Returns the value of the key identified by 'key_idx'. The 'track_idx' must be the index of a Bezier Track.
func (Instance) BezierTrackInsertKey ¶
Inserts a Bezier Track key at the given 'time' in seconds. The 'track_idx' must be the index of a Bezier Track.
'in_handle' is the left-side weight of the added Bezier curve point, 'out_handle' is the right-side one, while 'value' is the actual value at this point.
func (Instance) BezierTrackInterpolate ¶
Returns the interpolated value at the given 'time' (in seconds). The 'track_idx' must be the index of a Bezier Track.
func (Instance) BezierTrackSetKeyInHandle ¶
Sets the in handle of the key identified by 'key_idx' to value 'in_handle'. The 'track_idx' must be the index of a Bezier Track.
func (Instance) BezierTrackSetKeyOutHandle ¶
Sets the out handle of the key identified by 'key_idx' to value 'out_handle'. The 'track_idx' must be the index of a Bezier Track.
func (Instance) BezierTrackSetKeyValue ¶
Sets the value of the key identified by 'key_idx' to the given value. The 'track_idx' must be the index of a Bezier Track.
func (Instance) BlendShapeTrackInsertKey ¶
Inserts a key in a given blend shape track. Returns the key index.
func (Instance) BlendShapeTrackInterpolate ¶
Returns the interpolated blend shape value at the given time (in seconds). The 'track_idx' must be the index of a blend shape track.
func (Instance) CaptureIncluded ¶
func (Instance) Clear ¶
func (self Instance) Clear()
Clear the animation (clear all tracks and reset all).
func (Instance) Compress ¶
func (self Instance) Compress()
Compress the animation and all its tracks in-place. This will make Instance.TrackIsCompressed return true once called on this graphics.gd/classdb/Animation. Compressed tracks require less memory to be played, and are designed to be used for complex 3D animations (such as cutscenes) imported from external 3D software. Compression is lossy, but the difference is usually not noticeable in real world conditions.
Note: Compressed tracks have various limitations (such as not being editable from the editor), so only use compressed animations if you actually need them.
func (Instance) CopyTrack ¶
Adds a new track to 'to_animation' that is a copy of the given track from this animation.
func (Instance) FindTrack ¶
Returns the index of the specified track. If the track is not found, return -1.
func (Instance) GetMarkerAtTime ¶
Returns the name of the marker located at the given time.
func (Instance) GetMarkerColor ¶
Returns the given marker's color.
func (Instance) GetMarkerNames ¶
Returns every marker in this Animation, sorted ascending by time.
func (Instance) GetMarkerTime ¶
Returns the given marker's time.
func (Instance) GetNextMarker ¶
Returns the closest marker that comes after the given time. If no such marker exists, an empty string is returned.
func (Instance) GetPrevMarker ¶
Returns the closest marker that comes before the given time. If no such marker exists, an empty string is returned.
func (Instance) GetTrackCount ¶
Returns the amount of tracks in the animation.
func (Instance) MethodTrackGetName ¶
Returns the method name of a method track.
func (Instance) MethodTrackGetParams ¶
Returns the arguments values to be called on a method track for a given key in a given track.
func (Instance) Optimize ¶
func (self Instance) Optimize()
Optimize the animation and all its tracks in-place. This will preserve only as many keys as are necessary to keep the animation within the specified bounds.
func (Instance) PositionTrackInsertKey ¶
Inserts a key in a given 3D position track. Returns the key index.
func (Instance) PositionTrackInterpolate ¶
Returns the interpolated position value at the given time (in seconds). The 'track_idx' must be the index of a 3D position track.
func (Instance) RemoveMarker ¶
Removes the marker with the given name from this Animation.
func (Instance) RemoveTrack ¶
Removes a track by specifying the track index.
func (Instance) RotationTrackInsertKey ¶
func (self Instance) RotationTrackInsertKey(track_idx int, time Float.X, rotation Quaternion.IJKX) int
Inserts a key in a given 3D rotation track. Returns the key index.
func (Instance) RotationTrackInterpolate ¶
Returns the interpolated rotation value at the given time (in seconds). The 'track_idx' must be the index of a 3D rotation track.
func (Instance) ScaleTrackInsertKey ¶
Inserts a key in a given 3D scale track. Returns the key index.
func (Instance) ScaleTrackInterpolate ¶
Returns the interpolated scale value at the given time (in seconds). The 'track_idx' must be the index of a 3D scale track.
func (Instance) SetLoopMode ¶
func (Instance) SetMarkerColor ¶
Sets the given marker's color.
func (Instance) TrackFindKey ¶
Finds the key index by time in a given track. Optionally, only find it if the approx/exact time is given.
If 'limit' is true, it does not return keys outside the animation range.
If 'backward' is true, the direction is reversed in methods that rely on one directional processing.
For example, in case 'find_mode' is FindModeNearest, if there is no key in the current position just after seeked, the first key found is retrieved by searching before the position, but if 'backward' is true, the first key found is retrieved after the position.
func (Instance) TrackGetInterpolationLoopWrap ¶
Returns true if the track at 'track_idx' wraps the interpolation loop. New tracks wrap the interpolation loop by default.
func (Instance) TrackGetInterpolationType ¶
func (self Instance) TrackGetInterpolationType(track_idx int) InterpolationType
Returns the interpolation type of a given track.
func (Instance) TrackGetKeyCount ¶
Returns the number of keys in a given track.
func (Instance) TrackGetKeyTime ¶
Returns the time at which the key is located.
func (Instance) TrackGetKeyTransition ¶
Returns the transition curve (easing) for a specific key (see the built-in math function [graphics.gd/classdb/@GlobalScope.Instance.Ease]).
func (Instance) TrackGetKeyValue ¶
Returns the value of a given key in a given track.
func (Instance) TrackGetPath ¶
Gets the path of a track. For more information on the path format, see Instance.TrackSetPath.
func (Instance) TrackGetType ¶
Gets the type of a track.
func (Instance) TrackInsertKey ¶
Inserts a generic key in a given track. Returns the key index.
func (Instance) TrackIsCompressed ¶
Returns true if the track is compressed, false otherwise. See also Instance.Compress.
func (Instance) TrackIsEnabled ¶
Returns true if the track at index 'track_idx' is enabled.
func (Instance) TrackIsImported ¶
Returns true if the given track is imported. Else, return false.
func (Instance) TrackMoveDown ¶
Moves a track down.
func (Instance) TrackMoveTo ¶
Changes the index position of track 'track_idx' to the one defined in 'to_idx'.
func (Instance) TrackRemoveKey ¶
Removes a key by index in a given track.
func (Instance) TrackRemoveKeyAtTime ¶
Removes a key at 'time' in a given track.
func (Instance) TrackSetEnabled ¶
Enables/disables the given track. Tracks are enabled by default.
func (Instance) TrackSetImported ¶
Sets the given track as imported or not.
func (Instance) TrackSetInterpolationLoopWrap ¶
If true, the track at 'track_idx' wraps the interpolation loop.
func (Instance) TrackSetInterpolationType ¶
func (self Instance) TrackSetInterpolationType(track_idx int, interpolation InterpolationType)
Sets the interpolation type of a given track.
func (Instance) TrackSetKeyTime ¶
Sets the time of an existing key.
func (Instance) TrackSetKeyTransition ¶
Sets the transition curve (easing) for a specific key (see the built-in math function [graphics.gd/classdb/@GlobalScope.Instance.Ease]).
func (Instance) TrackSetKeyValue ¶
Sets the value of an existing key.
func (Instance) TrackSetPath ¶
Sets the path of a track. Paths must be valid scene-tree paths to a node and must be specified starting from the graphics.gd/classdb/AnimationMixer.Instance.RootNode that will reproduce the animation. Tracks that control properties or bones must append their name after the path, separated by ":".
For example, "character/skeleton:ankle" or "character/mesh:transform/local".
func (Instance) ValueTrackGetUpdateMode ¶
func (self Instance) ValueTrackGetUpdateMode(track_idx int) UpdateMode
Returns the update mode of a value track.
func (Instance) ValueTrackInterpolate ¶
Returns the interpolated value at the given time (in seconds). The 'track_idx' must be the index of a value track.
A 'backward' mainly affects the direction of key retrieval of the track with UpdateDiscrete converted by [Animationmixer.AnimationCallbackModeDiscreteForceContinuous] to match the result with Instance.TrackFindKey.
func (Instance) ValueTrackSetUpdateMode ¶
func (self Instance) ValueTrackSetUpdateMode(track_idx int, mode UpdateMode)
Sets the update mode (see UpdateMode) of a value track.
type InterpolationType ¶
type InterpolationType int //gd:Animation.InterpolationType
const ( // No interpolation (nearest value). InterpolationNearest InterpolationType = 0 // Linear interpolation. InterpolationLinear InterpolationType = 1 // Cubic interpolation. This looks smoother than linear interpolation, but is more expensive to interpolate. Stick to [InterpolationLinear] for complex 3D animations imported from external software, even if it requires using a higher animation framerate in return. InterpolationCubic InterpolationType = 2 // Linear interpolation with shortest path rotation. // // Note: The result value is always normalized and may not match the key value. InterpolationLinearAngle InterpolationType = 3 // Cubic interpolation with shortest path rotation. // // Note: The result value is always normalized and may not match the key value. InterpolationCubicAngle InterpolationType = 4 )
type LoopMode ¶
type LoopMode int //gd:Animation.LoopMode
const ( // At both ends of the animation, the animation will stop playing. LoopNone LoopMode = 0 // At both ends of the animation, the animation will be repeated without changing the playback direction. LoopLinear LoopMode = 1 // Repeats playback and reverse playback at both ends of the animation. LoopPingpong LoopMode = 2 )
type LoopedFlag ¶
type LoopedFlag int //gd:Animation.LoopedFlag
const ( // This flag indicates that the animation proceeds without any looping. LoopedFlagNone LoopedFlag = 0 // This flag indicates that the animation has reached the end of the animation and just after loop processed. LoopedFlagEnd LoopedFlag = 1 // This flag indicates that the animation has reached the start of the animation and just after loop processed. LoopedFlagStart LoopedFlag = 2 )
type TrackType ¶
type TrackType int //gd:Animation.TrackType
const ( // Value tracks set values in node properties, but only those which can be interpolated. For 3D position/rotation/scale, using the dedicated [TypePosition3d], [TypeRotation3d] and [TypeScale3d] track types instead of [TypeValue] is recommended for performance reasons. TypeValue TrackType = 0 // 3D position track (values are stored in [Vector3.XYZ]s). TypePosition3d TrackType = 1 // 3D rotation track (values are stored in [Quaternion.IJKX]s). TypeRotation3d TrackType = 2 // 3D scale track (values are stored in [Vector3.XYZ]s). TypeScale3d TrackType = 3 // Blend shape track. TypeBlendShape TrackType = 4 // Method tracks call functions with given arguments per key. TypeMethod TrackType = 5 // Bezier tracks are used to interpolate a value using custom curves. They can also be used to animate sub-properties of vectors and colors (e.g. alpha value of a [Color.RGBA]). TypeBezier TrackType = 6 // Audio tracks are used to play an audio stream with either type of [graphics.gd/classdb/AudioStreamPlayer]. The stream can be trimmed and previewed in the animation. TypeAudio TrackType = 7 // Animation tracks play animations in other [graphics.gd/classdb/AnimationPlayer] nodes. TypeAnimation TrackType = 8 )
type UpdateMode ¶
type UpdateMode int //gd:Animation.UpdateMode
const ( // Update between keyframes and hold the value. UpdateContinuous UpdateMode = 0 // Update at the keyframes. UpdateDiscrete UpdateMode = 1 // Same as [UpdateContinuous] but works as a flag to capture the value of the current object and perform interpolation in some methods. See also [graphics.gd/classdb/AnimationMixer.Instance.Capture], [graphics.gd/classdb/AnimationPlayer.Instance.PlaybackAutoCapture], and [graphics.gd/classdb/AnimationPlayer.Instance.PlayWithCapture]. UpdateCapture UpdateMode = 2 )