🔹Curve-blending

In this section you will learn more about curves

Tip: curves are a great tool to control the blending of procedural animations. CoreAnimGraph comes with a special system for curves, which allows you to add custom curves to the animation and use them in runtime to control the layer blending.

As Playables API does not support curve blending out of the box, CoreAnimGraph has its own system for curve blending.

The curve names are specified in the Runtime/Core/Types/CurveLib.cs:

CurveLib.cs
public static readonly List<string> AnimCurveNames = new()
{
    "MaskLeftHand", 
    "MaskLookLayer", 
    "WeaponBone", 
    "Overlay"
};
  • MaskLeftHand - used to disable Left Hand IK Layer. If 1 - layer is disabled, 0 - enabled.

  • MaskLookLayer - used to disable Look Layer. If 1 - layer is disabled, 0 - enabled.

  • WeaponBone - defines the object the weapon will move along with. This will be later explained in IK Animation System.

  • Overlay - controls the weight of the animation graph. If it's 1 - the graph is enabled, and 0 otherwise.

These curves are used for animation layers (e.g. Locomotion Layer or Left Hand IK Layer) to have a better control over the IK blending. Such curves are attached to an AnimSequence.

It's also possible to use curves from the Animator Controller, let's take a look at the example to understand the difference:

YourCustomLayer.cs
// Will select a curve for the CoreAnimGraph
[AnimCurveName(false)] [SerializeField] private string graphCurveName;

// Will select a curve from your Animator Controller
[AnimCurveName(true)] [SerializeField] private string animatorCurveName;

public override void OnAnimUpdate()
{
    //... Your implementation
    float graphCurveValue = GetCurveValue(graphCurveName);
    float animatorCurveValue = GetAnimator().GetFloat(animatorCurveName);
}
AnimCurveName(bool isAnimator) //false by default.  

Last updated