# Curve-blending

{% hint style="success" %}
**Tip:** curves are a great tool to control the blending of procedural animations. <mark style="color:purple;">**CoreAnimGraph**</mark> 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.
{% endhint %}

As Playables API does not support curve blending out of the box, <mark style="color:purple;">**CoreAnimGraph**</mark> has its own system for curve blending.&#x20;

The curve names are specified in the <mark style="background-color:blue;">**Runtime/Core/Types/CurveLib.cs**</mark>:

{% code title="CurveLib.cs" overflow="wrap" %}

```csharp
public static readonly List<string> AnimCurveNames = new()
{
    "MaskLeftHand", 
    "MaskLookLayer", 
    "WeaponBone", 
    "Overlay"
};
```

{% endcode %}

* **MaskLeftHand** - used to disable [left-hand-ik-layer](https://kinemation.gitbook.io/fps-animation-framework/fundamentals/animation-layers/left-hand-ik-layer "mention"). If 1 - layer is disabled, 0 - enabled.
* **MaskLookLayer** - used to disable [look-layer](https://kinemation.gitbook.io/fps-animation-framework/fundamentals/animation-layers/look-layer "mention"). 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](https://kinemation.gitbook.io/fps-animation-framework/fundamentals/animation-system/ik-animation-system "mention").
* **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](https://kinemation.gitbook.io/fps-animation-framework/fundamentals/animation-layers/locomotion-layer "mention") or [left-hand-ik-layer](https://kinemation.gitbook.io/fps-animation-framework/fundamentals/animation-layers/left-hand-ik-layer "mention")) to have a better control over the IK blending. Such curves are attached to an [animsequence](https://kinemation.gitbook.io/fps-animation-framework/fundamentals/animation-system/animsequence "mention").

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

{% code title="YourCustomLayer.cs" overflow="wrap" %}

```csharp
// 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);
}
```

{% endcode %}

{% code overflow="wrap" %}

```csharp
AnimCurveName(bool isAnimator) //false by default.  
```

{% endcode %}
