Framework Changes from Cubism 2.1 to 3.0

Updated: 09/03/2019

In the SDK of version 2.1, functions such as physics and eye tracking were hard-coded into classes in the framework and in the model class Update.
In CubismComponents 3.0 and later, the structure of those functions has been completely revised, and each of them has been reworked as a single component for each function.
Property values can be visually configured in Inspector, and individual functions can be easily added or removed at run-time.

The components of each function within CubismComponents are basically structured as follows.

  • Controller
  • Specify output destination
  • Input values to be processed by the controller

Controller

This is the component at the root of each function that controls CubismComponents.
The name “Cubism [function name] Controller” is set.
Various settings related to the function are configured in this component, and the source of input for values to be processed by the controller, described below, is also specified here.

At the time of controller initialization, a reference to the component is obtained for specifying the output destination, as described below.
Therefore, if the retrieval of references can be called externally, components for output destinations can be added and removed during execution.

To use, attach a GameObject at the root of the generated model.

Specify output destination

This is an output component that reflects the results of the controller’s processing.

To use this component, attach it to parameters under [model root]/Parameters/, parts under [model root]/Parts/, or GameObjects in meshes under [model root]/Drawables/.

Since this component has the names “Cubism [feature name] Parameter,” “Cubism [feature name] Part,” and “Cubism [feature name] able,” you can deduce from the name which object to attach to.

Input values to be processed by the controller

This component is where you enter values for the controller to process, such as volume for use in lip-sync and coordinates for eye tracking.

It was hard-coded in version 2.1, but starting in version 3.0 it has a high degree of freedom because it implements and handles the interface, making it very easy for users to make customizations.

using UnityEngine;


namespace Live2D.Cubism.Framework.LookAt
{
    /// <summary>
    /// Target to look at.
    /// </summary>
    public interface ICubismLookTarget
    {
        /// <summary>
        /// Gets the position of the target.
        /// </summary>
        /// <returns>The position of the target in world space.</returns>
        Vector3 GetPosition();


        /// <summary>
        /// Gets whether the target is active.
        /// </summary>
        /// <returns><see langword="true"/> if the target is active; <see langword="false"/> otherwise.</returns>
        bool IsActive();
    }
}

To use this component, attach it to any GameObject and set its reference to a property in the controller for input.

Was this article helpful?
YesNo
Please let us know what you think about this article.