reckfellENGINE

AnimationNodeBlendSpace2D

A set of AnimationRootNodes placed on 2D coordinates, crossfading between the three adjacent ones. Used by AnimationTree.

On this page
class AnimationNodeBlendSpace2DReckfellSharpInherits AnimationRootNode

A set of AnimationRootNodes placed on 2D coordinates, crossfading between the three adjacent ones. Used by AnimationTree.

A resource used by AnimationNodeBlendTree. AnimationNodeBlendSpace2D represents a virtual 2D space on which AnimationRootNodes are placed. Outputs the linear blend of the three adjacent animations using a Vector2 weight. Adjacent in this context means the three AnimationRootNodes making up the triangle that contains the current value. You can add vertices to the blend space with AnimationNodeBlendSpace2D.AddBlendPoint and automatically triangulate it by setting AnimationNodeBlendSpace2D.AutoTriangles to true. Otherwise, use AnimationNodeBlendSpace2D.AddTriangle and AnimationNodeBlendSpace2D.RemoveTriangle to triangulate the blend space by hand.

Optionally, signals can be used by setting an AnimationNodeObserverBlendSpace through AnimationTree.

C#
var observer = animationTree.Get("parameters/BlendSpace/observer").As<AnimationNodeObserverBlendSpace>();
observer.ClosestPointChanged += OnClosestPointChanged;

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

AnimationNodeBlendSpace2DConstructor
# AnimationNodeBlendSpace2D
C#
public AnimationNodeBlendSpace2D();

Properties10

AutoTrianglesProperty
# AutoTriangles
C#
public bool AutoTriangles { get; set; }

If true, the blend space is triangulated automatically. The mesh updates every time you add or remove points with AnimationNodeBlendSpace2D.AddBlendPoint and AnimationNodeBlendSpace2D.RemoveBlendPoint.

BlendModeProperty
# BlendMode
C#
public AnimationNodeBlendSpace2D.BlendModeEnum BlendMode { get; set; }

Controls the interpolation between animations.

CyclicLengthProperty
# CyclicLength
C#
public double CyclicLength { get; set; }

The cycle length in seconds used by AnimationNodeBlendSpace2D.SyncModeEnum.CyclicConstant. All animations are time-scaled so they complete one full cycle in this duration. Must be greater than 0 for cyclic sync to take effect.

MaxSpaceProperty
# MaxSpace
C#
public Vector2 MaxSpace { get; set; }

The blend space's X and Y axes' upper limit for the points' position. See AnimationNodeBlendSpace2D.AddBlendPoint.

MinSpaceProperty
# MinSpace
C#
public Vector2 MinSpace { get; set; }

The blend space's X and Y axes' lower limit for the points' position. See AnimationNodeBlendSpace2D.AddBlendPoint.

SnapProperty
# Snap
C#
public Vector2 Snap { get; set; }

Position increment to snap to when moving a point.

SyncProperty · Deprecated
# Sync
C#
public bool Sync { get; set; }

If true, sync mode is enabled (equivalent to AnimationNodeBlendSpace2D.SyncModeEnum.Independent). This property is kept for backward compatibility.

SyncModeProperty
# SyncMode
C#
public AnimationNodeBlendSpace2D.SyncModeEnum SyncMode { get; set; }

Controls how animations are synced when blended. See AnimationNodeBlendSpace2D.SyncModeEnum for available options.

XLabelProperty
# XLabel
C#
public string XLabel { get; set; }

Name of the blend space's X axis.

YLabelProperty
# YLabel
C#
public string YLabel { get; set; }

Name of the blend space's Y axis.

Methods36

AddBlendPoint2 overloads
# AddBlendPoint · 1/2
C#
public void AddBlendPoint(AnimationRootNode node, Vector2 pos, int atIndex);

Adds a new point with name that represents a node at the position set by pos. You can insert it at a specific index using the at_index argument. If you use the default value for at_index, the point is inserted at the end of the blend points array. Note: If no name is provided, safe index is used as reference. In the future, empty names will be deprecated, so explicitly passing a name is recommended.

Parameters
NameTypeDefault
nodeAnimationRootNode—
posVector2—
atIndexint—
# AddBlendPoint · 2/2
C#
public void AddBlendPoint(AnimationRootNode node, Vector2 pos, int atIndex = -1, StringName name = null);

Adds a new point with name that represents a node at the position set by pos. You can insert it at a specific index using the at_index argument. If you use the default value for at_index, the point is inserted at the end of the blend points array. Note: If no name is provided, safe index is used as reference. In the future, empty names will be deprecated, so explicitly passing a name is recommended.

Parameters
NameTypeDefault
nodeAnimationRootNode—
posVector2—
atIndexint-1
nameStringNamenull
AddTrianglevoid
# AddTriangle
C#
public void AddTriangle(int x, int y, int z, int atIndex = -1);

Creates a new triangle using three points x, y, and z. Triangles can overlap. You can insert the triangle at a specific index using the at_index argument. If you use the default value for at_index, the point is inserted at the end of the blend points array.

Parameters
NameTypeDefault
xint—
yint—
zint—
atIndexint-1
FindBlendPointByNameint
# FindBlendPointByName
C#
public int FindBlendPointByName(StringName name);

Returns the index of the blend point with the given name. Returns -1 if no blend point with that name is found.

Parameters
NameTypeDefault
nameStringName—
Returns int
GetAutoTrianglesbool
# GetAutoTriangles
C#
public bool GetAutoTriangles();
Returns bool
GetBlendModeAnimationNodeBlendSpace2D.BlendModeEnum
# GetBlendMode
C#
public AnimationNodeBlendSpace2D.BlendModeEnum GetBlendMode();
Returns AnimationNodeBlendSpace2D.BlendModeEnum
GetBlendPointCountint
# GetBlendPointCount
C#
public int GetBlendPointCount();

Returns the number of points in the blend space.

Returns int
GetBlendPointNameStringName
# GetBlendPointName
C#
public StringName GetBlendPointName(int point);

Returns the name of the blend point at index point.

Parameters
NameTypeDefault
pointint—
Returns StringName
GetBlendPointNodeAnimationRootNode
# GetBlendPointNode
C#
public AnimationRootNode GetBlendPointNode(int point);

Returns the AnimationRootNode referenced by the point at index point.

Parameters
NameTypeDefault
pointint—
Returns AnimationRootNode
GetBlendPointPositionVector2
# GetBlendPointPosition
C#
public Vector2 GetBlendPointPosition(int point);

Returns the position of the point at index point.

Parameters
NameTypeDefault
pointint—
Returns Vector2
GetCyclicLengthdouble
# GetCyclicLength
C#
public double GetCyclicLength();
Returns double
GetMaxSpaceVector2
# GetMaxSpace
C#
public Vector2 GetMaxSpace();
Returns Vector2
GetMinSpaceVector2
# GetMinSpace
C#
public Vector2 GetMinSpace();
Returns Vector2
GetSnapVector2
# GetSnap
C#
public Vector2 GetSnap();
Returns Vector2
GetSyncModeAnimationNodeBlendSpace2D.SyncModeEnum
# GetSyncMode
C#
public AnimationNodeBlendSpace2D.SyncModeEnum GetSyncMode();
Returns AnimationNodeBlendSpace2D.SyncModeEnum
GetTriangleCountint
# GetTriangleCount
C#
public int GetTriangleCount();

Returns the number of triangles in the blend space.

Returns int
GetTrianglePointint
# GetTrianglePoint
C#
public int GetTrianglePoint(int triangle, int point);

Returns the position of the point at index point in the triangle of index triangle.

Parameters
NameTypeDefault
triangleint—
pointint—
Returns int
GetXLabelstring
# GetXLabel
C#
public string GetXLabel();
Returns string
GetYLabelstring
# GetYLabel
C#
public string GetYLabel();
Returns string
IsUsingSyncbool
# IsUsingSync
C#
public bool IsUsingSync();
Returns bool
RemoveBlendPointvoid
# RemoveBlendPoint
C#
public void RemoveBlendPoint(int point);

Removes the point at index point from the blend space.

Parameters
NameTypeDefault
pointint—
RemoveTrianglevoid
# RemoveTriangle
C#
public void RemoveTriangle(int triangle);

Removes the triangle at index triangle from the blend space.

Parameters
NameTypeDefault
triangleint—
ReorderBlendPointvoid
# ReorderBlendPoint
C#
public void ReorderBlendPoint(int fromIndex, int toIndex);

Swaps the blend points at indices from_index and to_index, exchanging their positions and properties.

Parameters
NameTypeDefault
fromIndexint—
toIndexint—
SetAutoTrianglesvoid
# SetAutoTriangles
C#
public void SetAutoTriangles(bool enable);
Parameters
NameTypeDefault
enablebool—
SetBlendModevoid
# SetBlendMode
C#
public void SetBlendMode(AnimationNodeBlendSpace2D.BlendModeEnum mode);
Parameters
NameTypeDefault
modeAnimationNodeBlendSpace2D.BlendModeEnum—
SetBlendPointNamevoid
# SetBlendPointName
C#
public void SetBlendPointName(int point, StringName name);

Sets the name of the blend point at index point. If the name conflicts with an existing point, a unique name will be generated automatically.

Parameters
NameTypeDefault
pointint—
nameStringName—
SetBlendPointNodevoid
# SetBlendPointNode
C#
public void SetBlendPointNode(int point, AnimationRootNode node);

Changes the AnimationNode referenced by the point at index point.

Parameters
NameTypeDefault
pointint—
nodeAnimationRootNode—
SetBlendPointPositionvoid
# SetBlendPointPosition
C#
public void SetBlendPointPosition(int point, Vector2 pos);

Updates the position of the point at index point in the blend space.

Parameters
NameTypeDefault
pointint—
posVector2—
SetCyclicLengthvoid
# SetCyclicLength
C#
public void SetCyclicLength(double length);
Parameters
NameTypeDefault
lengthdouble—
SetMaxSpacevoid
# SetMaxSpace
C#
public void SetMaxSpace(Vector2 maxSpace);
Parameters
NameTypeDefault
maxSpaceVector2—
SetMinSpacevoid
# SetMinSpace
C#
public void SetMinSpace(Vector2 minSpace);
Parameters
NameTypeDefault
minSpaceVector2—
SetSnapvoid
# SetSnap
C#
public void SetSnap(Vector2 snap);
Parameters
NameTypeDefault
snapVector2—
SetSyncModevoid
# SetSyncMode
C#
public void SetSyncMode(AnimationNodeBlendSpace2D.SyncModeEnum syncMode);
Parameters
NameTypeDefault
syncModeAnimationNodeBlendSpace2D.SyncModeEnum—
SetUseSyncvoid
# SetUseSync
C#
public void SetUseSync(bool enable);
Parameters
NameTypeDefault
enablebool—
SetXLabelvoid
# SetXLabel
C#
public void SetXLabel(string text);
Parameters
NameTypeDefault
textstring—
SetYLabelvoid
# SetYLabel
C#
public void SetYLabel(string text);
Parameters
NameTypeDefault
textstring—

Signals and events1

TrianglesUpdatedEvent
# TrianglesUpdated
C#
public event Action TrianglesUpdated;

Emitted every time the blend space's triangles are created, removed, or when one of their vertices changes position.

AnimationNodeBlendSpace2D.BlendModeEnum

ValueDescription
Discrete = 1

The blend space plays the animation of the animation node which blending position is closest to. Useful for frame-by-frame 2D animations.

DiscreteCarry = 2

Similar to AnimationNodeBlendSpace2D.BlendModeEnum.Discrete, but starts the new animation at the last animation's playback position.

Interpolated = 0

The interpolation between animations is linear.

AnimationNodeBlendSpace2D.SyncModeEnum

ValueDescription
CyclicConstant = 3

All animations are time-scaled so they complete one cycle in AnimationNodeBlendSpace2D.CyclicLength seconds, keeping them in sync regardless of their individual lengths. Note: If you apply AnimationNodeTimeSeek to the result when handling animations of different lengths, synchronization will be broken. In such cases, it is recommended to use AnimationNodeAnimation.UseCustomTimeline to align the animation lengths.

CyclicMutable = 2

All animations are time-scaled so they stay in sync, with the cycle length dynamically computed from active blend weights. This is self-normalizing: a solo animation plays at normal speed. Note: If you apply AnimationNodeTimeSeek to the result when handling animations of different lengths, synchronization will be broken. In such cases, it is recommended to use AnimationNodeAnimation.UseCustomTimeline to align the animation lengths.

Independent = 1

Inactive animations advance with a weight of 0. This is equivalent to the previous sync = true behavior.

None = 0

Inactive animations are frozen and do not advance.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.