Animation
A resource containing tracks, keys, duration and loop mode.
Animation stores clip data. Add it to an AnimationLibrary and assign the library to AnimationPlayer, or use it through AnimationTree. The resource alone is not running playback.
Track type defines key format and target. Value paths include a property; specialized 3D tracks target an Entity3D or bone. Method tracks need explicit handling of seeking and repeated events.
Clips and keys · Tracks and events
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
AnimationConstructor
public Animation();Properties4
CaptureIncludedProperty
public bool CaptureIncluded { get; }Returns true if the capture track is included. This is a cached readonly value for performance.
LengthProperty
public double Length { get; set; }The total length of the animation (in seconds). Note: Length is not delimited by the last key, as this one may be before or after the end to ensure correct interpolation and looping.
LoopModeProperty
public Animation.LoopModeEnum LoopMode { get; set; }Determines the behavior of both ends of the animation timeline during animation playback. This indicates whether and how the animation should be restarted, and is also used to correctly interpolate animation cycles.
StepProperty
public float Step { get; set; }The animation step value.
Methods91
AddMarkervoid
public void AddMarker(StringName name, double time);Adds a marker to this Animation.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
time | double | — |
AddTrackint
public int AddTrack(Animation.TrackType type, int atPosition = -1);Adds a track to the Animation.
| Name | Type | Default |
|---|---|---|
type | Animation.TrackType | — |
atPosition | int | -1 |
intAnimationTrackGetKeyAnimationStringName
public StringName AnimationTrackGetKeyAnimation(int trackIdx, int keyIdx);Returns the animation name at the key identified by key_idx. The track_idx must be the index of an Animation Track.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
keyIdx | int | — |
StringNameAnimationTrackInsertKeyint
public int AnimationTrackInsertKey(int trackIdx, double time, StringName animation);Inserts a key with value animation at the given time (in seconds). The track_idx must be the index of an Animation Track.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
time | double | — |
animation | StringName | — |
intAnimationTrackSetKeyAnimationvoid
public void AnimationTrackSetKeyAnimation(int trackIdx, int keyIdx, StringName animation);Sets the key identified by key_idx to value animation. The track_idx must be the index of an Animation Track.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
keyIdx | int | — |
animation | StringName | — |
AudioTrackGetKeyEndOffsetfloat
public float AudioTrackGetKeyEndOffset(int trackIdx, int keyIdx);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.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
keyIdx | int | — |
floatAudioTrackGetKeyStartOffsetfloat
public float AudioTrackGetKeyStartOffset(int trackIdx, int keyIdx);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.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
keyIdx | int | — |
floatAudioTrackGetKeyStreamResource
public Resource AudioTrackGetKeyStream(int trackIdx, int keyIdx);Returns the audio stream of the key identified by key_idx. The track_idx must be the index of an Audio Track.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
keyIdx | int | — |
ResourceAudioTrackInsertKeyint
public int AudioTrackInsertKey(int trackIdx, double time, Resource stream, float startOffset = 0f, float endOffset = 0f);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 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.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
time | double | — |
stream | Resource | — |
startOffset | float | 0f |
endOffset | float | 0f |
intAudioTrackIsUseBlendbool
public bool AudioTrackIsUseBlend(int trackIdx);Returns true if the track at track_idx will be blended with other animations.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
boolAudioTrackSetKeyEndOffsetvoid
public void AudioTrackSetKeyEndOffset(int trackIdx, int keyIdx, float offset);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.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
keyIdx | int | — |
offset | float | — |
AudioTrackSetKeyStartOffsetvoid
public void AudioTrackSetKeyStartOffset(int trackIdx, int keyIdx, float offset);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.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
keyIdx | int | — |
offset | float | — |
AudioTrackSetKeyStreamvoid
public void AudioTrackSetKeyStream(int trackIdx, int keyIdx, Resource stream);Sets the stream of the key identified by key_idx to value stream. The track_idx must be the index of an Audio Track.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
keyIdx | int | — |
stream | Resource | — |
AudioTrackSetUseBlendvoid
public void AudioTrackSetUseBlend(int trackIdx, bool enable);Sets whether the track will be blended with other animations. If true, the audio playback volume changes depending on the blend value.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
enable | bool | — |
BezierTrackGetKeyInHandleVector2
public Vector2 BezierTrackGetKeyInHandle(int trackIdx, int keyIdx);Returns the in handle of the key identified by key_idx. The track_idx must be the index of a Bezier Track.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
keyIdx | int | — |
Vector2BezierTrackGetKeyOutHandleVector2
public Vector2 BezierTrackGetKeyOutHandle(int trackIdx, int keyIdx);Returns the out handle of the key identified by key_idx. The track_idx must be the index of a Bezier Track.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
keyIdx | int | — |
Vector2BezierTrackGetKeyValuefloat
public float BezierTrackGetKeyValue(int trackIdx, int keyIdx);Returns the value of the key identified by key_idx. The track_idx must be the index of a Bezier Track.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
keyIdx | int | — |
floatBezierTrackInsertKeyint
public int BezierTrackInsertKey(int trackIdx, double time, float value, Vector2? inHandle = default, Vector2? outHandle = default);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.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
time | double | — |
value | float | — |
inHandle | Vector2? | default |
outHandle | Vector2? | default |
inHandleIf the parameter is null, then the default value is new Vector2(0.0f, 0.0f).
outHandleIf the parameter is null, then the default value is new Vector2(0.0f, 0.0f).
intBezierTrackInterpolatefloat
public float BezierTrackInterpolate(int trackIdx, double time);Returns the interpolated value at the given time (in seconds). The track_idx must be the index of a Bezier Track.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
time | double | — |
floatBezierTrackSetKeyInHandlevoid
public void BezierTrackSetKeyInHandle(int trackIdx, int keyIdx, Vector2 inHandle, float balancedValueTimeRatio = 1f);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.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
keyIdx | int | — |
inHandle | Vector2 | — |
balancedValueTimeRatio | float | 1f |
BezierTrackSetKeyOutHandlevoid
public void BezierTrackSetKeyOutHandle(int trackIdx, int keyIdx, Vector2 outHandle, float balancedValueTimeRatio = 1f);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.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
keyIdx | int | — |
outHandle | Vector2 | — |
balancedValueTimeRatio | float | 1f |
BezierTrackSetKeyValuevoid
public void BezierTrackSetKeyValue(int trackIdx, int keyIdx, float value);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.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
keyIdx | int | — |
value | float | — |
BlendShapeTrackInsertKeyint
public int BlendShapeTrackInsertKey(int trackIdx, double time, float amount);Inserts a key in a given blend shape track. Returns the key index.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
time | double | — |
amount | float | — |
intBlendShapeTrackInterpolate2 overloads
public float BlendShapeTrackInterpolate(int trackIdx, double timeSec);Returns the interpolated blend shape value at the given time (in seconds). The track_idx must be the index of a blend shape track.
Note: If backward is true, the keys are retrieved on the reversed timeline. See also Animation.ValueTrackInterpolate.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
timeSec | double | — |
floatpublic float BlendShapeTrackInterpolate(int trackIdx, double timeSec, bool backward = false);Returns the interpolated blend shape value at the given time (in seconds). The track_idx must be the index of a blend shape track.
Note: If backward is true, the keys are retrieved on the reversed timeline. See also Animation.ValueTrackInterpolate.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
timeSec | double | — |
backward | bool | false |
floatClearvoid
public void Clear();Clear the animation (clear all tracks and reset all).
Compressvoid
public void Compress(uint pageSize = 8192, uint fps = 120, float splitTolerance = 4f);Compress the animation and all its tracks in-place. This will make Animation.TrackIsCompressed return true once called on this 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.
| Name | Type | Default |
|---|---|---|
pageSize | uint | 8192 |
fps | uint | 120 |
splitTolerance | float | 4f |
CopyTrackvoid
public void CopyTrack(int trackIdx, Animation toAnimation);Adds a new track to to_animation that is a copy of the given track from this animation.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
toAnimation | Animation | — |
FindTrackint
public int FindTrack(EntityPath path, Animation.TrackType type);Returns the index of the specified track. If the track is not found, return -1.
| Name | Type | Default |
|---|---|---|
path | EntityPath | — |
type | Animation.TrackType | — |
intGetLengthdouble
public double GetLength();doubleGetLoopModeAnimation.LoopModeEnum
public Animation.LoopModeEnum GetLoopMode();Animation.LoopModeEnumGetMarkerAtTimeStringName
public StringName GetMarkerAtTime(double time);Returns the name of the marker located at the given time.
| Name | Type | Default |
|---|---|---|
time | double | — |
StringNameGetMarkerColorColor
public Color GetMarkerColor(StringName name);Returns the given marker's color.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
ColorGetMarkerNamesstring[]
public string[] GetMarkerNames();Returns every marker in this Animation, sorted ascending by time.
string[]GetMarkerTimedouble
public double GetMarkerTime(StringName name);Returns the given marker's time.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
doubleGetNextMarkerStringName
public StringName GetNextMarker(double time);Returns the closest marker that comes after the given time. If no such marker exists, an empty string is returned.
| Name | Type | Default |
|---|---|---|
time | double | — |
StringNameGetPrevMarkerStringName
public StringName GetPrevMarker(double time);Returns the closest marker that comes before the given time. If no such marker exists, an empty string is returned.
| Name | Type | Default |
|---|---|---|
time | double | — |
StringNameGetStepfloat
public float GetStep();floatGetTrackCountint
public int GetTrackCount();Returns the amount of tracks in the animation.
intHasMarkerbool
public bool HasMarker(StringName name);Returns true if this Animation contains a marker with the given name.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
boolIsCaptureIncludedbool
public bool IsCaptureIncluded();boolMethodTrackGetNameStringName
public StringName MethodTrackGetName(int trackIdx, int keyIdx);Returns the method name of a method track.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
keyIdx | int | — |
StringNameMethodTrackGetParamsReckfell.Collections.Array
public Reckfell.Collections.Array MethodTrackGetParams(int trackIdx, int keyIdx);Returns the arguments values to be called on a method track for a given key in a given track.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
keyIdx | int | — |
Reckfell.Collections.ArrayOptimizevoid
public void Optimize(float allowedVelocityErr = 0.01f, float allowedAngularErr = 0.01f, int precision = 3);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.
| Name | Type | Default |
|---|---|---|
allowedVelocityErr | float | 0.01f |
allowedAngularErr | float | 0.01f |
precision | int | 3 |
PositionTrackInsertKeyint
public int PositionTrackInsertKey(int trackIdx, double time, Vector3 position);Inserts a key in a given 3D position track. Returns the key index.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
time | double | — |
position | Vector3 | — |
intPositionTrackInterpolate2 overloads
public Vector3 PositionTrackInterpolate(int trackIdx, double timeSec);Returns the interpolated position value at the given time (in seconds). The track_idx must be the index of a 3D position track.
Note: If backward is true, the keys are retrieved on the reversed timeline. See also Animation.ValueTrackInterpolate.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
timeSec | double | — |
Vector3public Vector3 PositionTrackInterpolate(int trackIdx, double timeSec, bool backward = false);Returns the interpolated position value at the given time (in seconds). The track_idx must be the index of a 3D position track.
Note: If backward is true, the keys are retrieved on the reversed timeline. See also Animation.ValueTrackInterpolate.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
timeSec | double | — |
backward | bool | false |
Vector3RemoveMarkervoid
public void RemoveMarker(StringName name);Removes the marker with the given name from this Animation.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
RemoveTrackvoid
public void RemoveTrack(int trackIdx);Removes a track by specifying the track index.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
RotationTrackInsertKeyint
public int RotationTrackInsertKey(int trackIdx, double time, Quaternion rotation);Inserts a key in a given 3D rotation track. Returns the key index.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
time | double | — |
rotation | Quaternion | — |
intRotationTrackInterpolate2 overloads
public Quaternion RotationTrackInterpolate(int trackIdx, double timeSec);Returns the interpolated rotation value at the given time (in seconds). The track_idx must be the index of a 3D rotation track.
Note: If backward is true, the keys are retrieved on the reversed timeline. See also Animation.ValueTrackInterpolate.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
timeSec | double | — |
Quaternionpublic Quaternion RotationTrackInterpolate(int trackIdx, double timeSec, bool backward = false);Returns the interpolated rotation value at the given time (in seconds). The track_idx must be the index of a 3D rotation track.
Note: If backward is true, the keys are retrieved on the reversed timeline. See also Animation.ValueTrackInterpolate.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
timeSec | double | — |
backward | bool | false |
QuaternionScaleTrackInsertKeyint
public int ScaleTrackInsertKey(int trackIdx, double time, Vector3 scale);Inserts a key in a given 3D scale track. Returns the key index.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
time | double | — |
scale | Vector3 | — |
intScaleTrackInterpolate2 overloads
public Vector3 ScaleTrackInterpolate(int trackIdx, double timeSec);Returns the interpolated scale value at the given time (in seconds). The track_idx must be the index of a 3D scale track.
Note: If backward is true, the keys are retrieved on the reversed timeline. See also Animation.ValueTrackInterpolate.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
timeSec | double | — |
Vector3public Vector3 ScaleTrackInterpolate(int trackIdx, double timeSec, bool backward = false);Returns the interpolated scale value at the given time (in seconds). The track_idx must be the index of a 3D scale track.
Note: If backward is true, the keys are retrieved on the reversed timeline. See also Animation.ValueTrackInterpolate.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
timeSec | double | — |
backward | bool | false |
Vector3SetLengthvoid
public void SetLength(double timeSec);| Name | Type | Default |
|---|---|---|
timeSec | double | — |
SetLoopModevoid
public void SetLoopMode(Animation.LoopModeEnum loopMode);| Name | Type | Default |
|---|---|---|
loopMode | Animation.LoopModeEnum | — |
SetMarkerColorvoid
public void SetMarkerColor(StringName name, Color color);Sets the given marker's color.
| Name | Type | Default |
|---|---|---|
name | StringName | — |
color | Color | — |
SetStepvoid
public void SetStep(float sizeSec);| Name | Type | Default |
|---|---|---|
sizeSec | float | — |
TrackFindKey2 overloads
public int TrackFindKey(int trackIdx, double time, Animation.FindMode findMode);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 Animation.FindMode.Nearest, 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.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
time | double | — |
findMode | Animation.FindMode | — |
intpublic int TrackFindKey(int trackIdx, double time, Animation.FindMode findMode = Animation.FindMode.Nearest, bool limit = false, bool backward = false);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 Animation.FindMode.Nearest, 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.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
time | double | — |
findMode | Animation.FindMode | Animation.FindMode.Nearest |
limit | bool | false |
backward | bool | false |
intTrackGetInterpolationLoopWrapbool
public bool TrackGetInterpolationLoopWrap(int trackIdx);Returns true if the track at track_idx wraps the interpolation loop. New tracks wrap the interpolation loop by default.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
boolTrackGetInterpolationTypeAnimation.InterpolationType
public Animation.InterpolationType TrackGetInterpolationType(int trackIdx);Returns the interpolation type of a given track.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
Animation.InterpolationTypeTrackGetKeyCountint
public int TrackGetKeyCount(int trackIdx);Returns the number of keys in a given track.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
intTrackGetKeyTimedouble
public double TrackGetKeyTime(int trackIdx, int keyIdx);Returns the time at which the key is located.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
keyIdx | int | — |
doubleTrackGetKeyTransitionfloat
public float TrackGetKeyTransition(int trackIdx, int keyIdx);Returns the transition curve (easing) for a specific key (see the built-in math function @GlobalScope.ease).
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
keyIdx | int | — |
floatTrackGetKeyValueVariant
public Variant TrackGetKeyValue(int trackIdx, int keyIdx);Returns the value of a given key in a given track.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
keyIdx | int | — |
VariantTrackGetPathEntityPath
public EntityPath TrackGetPath(int trackIdx);Gets the path of a track. For more information on the path format, see Animation.TrackSetPath.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
EntityPathTrackGetTypeAnimation.TrackType
public Animation.TrackType TrackGetType(int trackIdx);Gets the type of a track.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
Animation.TrackTypeTrackInsertKeyint
public int TrackInsertKey(int trackIdx, double time, Variant key, float transition = 1f);Inserts a generic key in a given track. Returns the key index.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
time | double | — |
key | Variant | — |
transition | float | 1f |
intTrackIsCompressedbool
public bool TrackIsCompressed(int trackIdx);Returns true if the track is compressed, false otherwise. See also Animation.Compress.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
boolTrackIsEnabledbool
public bool TrackIsEnabled(int trackIdx);Returns true if the track at index track_idx is enabled.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
boolTrackIsImportedbool
public bool TrackIsImported(int trackIdx);Returns true if the given track is imported. Else, return false.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
boolTrackMoveDownvoid
public void TrackMoveDown(int trackIdx);Moves a track down.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
TrackMoveTovoid
public void TrackMoveTo(int trackIdx, int toIdx);Changes the index position of track track_idx to the one defined in to_idx.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
toIdx | int | — |
TrackMoveUpvoid
public void TrackMoveUp(int trackIdx);Moves a track up.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
TrackRemoveKeyvoid
public void TrackRemoveKey(int trackIdx, int keyIdx);Removes a key by index in a given track.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
keyIdx | int | — |
TrackRemoveKeyAtTimevoid
public void TrackRemoveKeyAtTime(int trackIdx, double time);Removes a key at time in a given track.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
time | double | — |
TrackSetEnabledvoid
public void TrackSetEnabled(int trackIdx, bool enabled);Enables/disables the given track. Tracks are enabled by default.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
enabled | bool | — |
TrackSetImportedvoid
public void TrackSetImported(int trackIdx, bool imported);Sets the given track as imported or not.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
imported | bool | — |
TrackSetInterpolationLoopWrapvoid
public void TrackSetInterpolationLoopWrap(int trackIdx, bool interpolation);If true, the track at track_idx wraps the interpolation loop.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
interpolation | bool | — |
TrackSetInterpolationTypevoid
public void TrackSetInterpolationType(int trackIdx, Animation.InterpolationType interpolation);Sets the interpolation type of a given track.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
interpolation | Animation.InterpolationType | — |
TrackSetKeyTimevoid
public void TrackSetKeyTime(int trackIdx, int keyIdx, double time);Sets the time of an existing key.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
keyIdx | int | — |
time | double | — |
TrackSetKeyTransitionvoid
public void TrackSetKeyTransition(int trackIdx, int keyIdx, float transition);Sets the transition curve (easing) for a specific key (see the built-in math function @GlobalScope.ease).
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
keyIdx | int | — |
transition | float | — |
TrackSetKeyValuevoid
public void TrackSetKeyValue(int trackIdx, int key, Variant value);Sets the value of an existing key.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
key | int | — |
value | Variant | — |
TrackSetPathvoid
public void TrackSetPath(int trackIdx, EntityPath path);Sets the track target relative to the mixer RootEntity. Value tracks include a property, such as Visual:position. Specialized Position3D/Rotation3D/Scale3D tracks target an Entity3D or bone path without the property suffix. Engine property strings can differ from C# names.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
path | EntityPath | — |
TrackSwapvoid
public void TrackSwap(int trackIdx, int withIdx);Swaps the track track_idx's index position with the track with_idx.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
withIdx | int | — |
ValueTrackGetUpdateModeAnimation.UpdateMode
public Animation.UpdateMode ValueTrackGetUpdateMode(int trackIdx);Returns the update mode of a value track.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
Animation.UpdateModeValueTrackInterpolate2 overloads
public Variant ValueTrackInterpolate(int trackIdx, double timeSec);Returns the interpolated value at the given time (in seconds). The track_idx must be the index of a value track.
If backward is true, the keys are retrieved on the reversed timeline, so the base key is the key after time_sec. This changes the result only for Animation.UpdateMode.Discrete and Animation.InterpolationType.Nearest; the other interpolation types give the same result as forward.
Note: AnimationMixer always passes false for continuous tracks with playback API.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
timeSec | double | — |
Variantpublic Variant ValueTrackInterpolate(int trackIdx, double timeSec, bool backward = false);Returns the interpolated value at the given time (in seconds). The track_idx must be the index of a value track.
If backward is true, the keys are retrieved on the reversed timeline, so the base key is the key after time_sec. This changes the result only for Animation.UpdateMode.Discrete and Animation.InterpolationType.Nearest; the other interpolation types give the same result as forward.
Note: AnimationMixer always passes false for continuous tracks with playback API.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
timeSec | double | — |
backward | bool | false |
VariantValueTrackSetUpdateModevoid
public void ValueTrackSetUpdateMode(int trackIdx, Animation.UpdateMode mode);Sets the update mode of a value track.
| Name | Type | Default |
|---|---|---|
trackIdx | int | — |
mode | Animation.UpdateMode | — |
Animation.FindMode
| Value | Description |
|---|---|
Approx = 1 | Finds only the key with approximating the time. |
Exact = 2 | Finds only the key with matching the time. |
Nearest = 0 | Finds the nearest time key. |
Animation.InterpolationType
| Value | Description |
|---|---|
Cubic = 2 | Cubic interpolation. This looks smoother than linear interpolation, but is more expensive to interpolate. Stick to |
CubicAngle = 4 | Cubic interpolation with shortest path rotation. Note: The result value is always normalized and may not match the key value. |
Linear = 1 | Linear interpolation. |
LinearAngle = 3 | Linear interpolation with shortest path rotation. Note: The result value is always normalized and may not match the key value. |
Makima = 5 | Modified Akima interpolation. Like |
MakimaAngle = 6 | Modified Akima interpolation with shortest path rotation. Note: The result value is always normalized and may not match the key value. |
Nearest = 0 | No interpolation (nearest value). |
Animation.LoopModeEnum
| Value | Description |
|---|---|
Linear = 1 | At both ends of the animation, the animation will be repeated without changing the playback direction. |
None = 0 | At both ends of the animation, the animation will stop playing. |
Pingpong = 2 | Repeats playback and reverse playback at both ends of the animation. |
Animation.LoopedFlag
| Value | Description |
|---|---|
End = 1 | This flag indicates that the animation has reached the end of the animation and just after loop processed. |
None = 0 | This flag indicates that the animation proceeds without any looping. |
Start = 2 | This flag indicates that the animation has reached the start of the animation and just after loop processed. |
Animation.TrackType
| Value | Description |
|---|---|
Animation = 8 | Animation tracks play animations in other |
Audio = 7 | Audio tracks are used to play an audio stream with either type of |
Bezier = 6 | 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 |
BlendShape = 4 | Blend shape track. |
Method = 5 | Method tracks call functions with given arguments per key. |
Position3D = 1 | 3D position track (values are stored in |
Rotation3D = 2 | 3D rotation track (values are stored in |
Scale3D = 3 | 3D scale track (values are stored in |
Value = 0 | Value tracks set values in node properties, but only those which can be interpolated. For 3D position/rotation/scale, using the dedicated |
Animation.UpdateMode
| Value | Description |
|---|---|
Capture = 2 | Same as |
Continuous = 0 | Update between keyframes and hold the value. |
Discrete = 1 | Update at the keyframes. |