# 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](/fps-animation-framework/fundamentals/animation-layers/left-hand-ik-layer.md). If 1 - layer is disabled, 0 - enabled.
* **MaskLookLayer** - used to disable [Look Layer](/fps-animation-framework/fundamentals/animation-layers/look-layer.md). 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](/fps-animation-framework/fundamentals/animation-system/ik-animation-system.md).
* **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](/fps-animation-framework/fundamentals/animation-layers/locomotion-layer.md) or [Left Hand IK Layer](/fps-animation-framework/fundamentals/animation-layers/left-hand-ik-layer.md)) to have a better control over the IK blending. Such curves are attached to an [AnimSequence](/fps-animation-framework/fundamentals/animation-system/animsequence.md).

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 %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kinemation.gitbook.io/fps-animation-framework/fundamentals/animation-system/curve-blending.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
