Magic Blend Documentation
  • 👋Welcome!
  • Quickstart
    • ❓How does it work?
    • ⚙️Prerequisites
  • Tutorial
    • 📚Setup
    • ⭐Workflow
Powered by GitBook
On this page
  • Blend Sliders
  • Animation States
  • Code Integration
  1. Tutorial

Workflow

In this section we will cover the features of Magic Blending.

PreviousSetup

Last updated 3 months ago

Blend Sliders

The Magic Blend Asset uses 3 main sliders to control the animation blending:

Base Weight controls a blend between Animator and Magic Blend pose. If set to zero, the Animator will be fully used, if set to 1 - the overlay pose will fully override this bone chain.

Additive Weight controls the dynamic additive influence. If set to zero, no additive is applied, if set to 1 - it will be added to the overlay pose.

Local Weight overrides everything with the overlay pose. It is only useful for fingers or hands. If set to zero, it will not be applied, and if set to one - it will fully override the bone chain with the overlay pose.

There are no restrictions on what sliders to use and how. You need to tweak the settings and see what works best for your character pose.

Animation States

It is possible to bind Magic Blend Assets to a specific animation state in your controller. To do so, click on the desired state and add a Magic Blend State:

Now, assign the blend asset, and the system will automatically sync it with the rest of the animator controller:

Tip: you can add multiple empty states to your animator, and set up transitions between them. You don't have to specify the animation clips, as they will be supplied from the selected Magic Blend Asset.

This is a very simple way to integrate the Magic Blending with your project without modifying the code. However, sometimes we run into situations when it is vital to change a Magic Blend Asset in runtime.

Code Integration

You can swap Magic Blend Asset by simply replacing the asset in the inspector. If you want to do a similar thing in the code, here is how you can achieve that:

YourComponent.cs
private MagicBlending _magicBlending;

private void Start()
{
    _magicBlending = GetComponent<MagicBlending>();
}

private void ChangeMagicBlendAsset(MagicBlendAsset newAsset)
{
    _magicBlending.UpdateMagicBlendAsset(newAsset, true);
}
_magicBlending.StopMagicBlending() // Use it to disable active blending.
_magicBlending.SetOverlayTime(float newTime) // Use it to force update overlay time.
_magicBlending.GetOverlayTime(bool isNormalized) // Use it to get overlay time.

That is it! Now you know how to fully use Magic Blending in your project.

⭐
Weight sliders.
Blend State component.
Choose your asset here.