Framework Changes from Cubism 2.1 to 3.0
[Last updated: 09/03/2019]
In the SDK of 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.
- Specify output destination
- Input values to be processed by the 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.
If used, 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.
If you use this component, attach it to parameters under [model root]/Parameters/, the parts under [model root]/Parts/, or
GameObject of the mesh under [model root]/Drawables/.
Since this component has the names “Cubism[feature name]Parameter”, “Cubism[feature name]Part”, and “Cubism[feature name]able”,
so you can guess from the name which object to attach to.
Input values to be processed by the controller
This component inputs values for the controller to process, such as volume for use in lip-sync, coordinates for eye-tracking, etc.
It was hard-coded in 2.1, but from 3.0 it has a high degree of freedom because it implements and handles the interface.
It is very easy to customize by the user.
/// Target to look at.
public interface ICubismLookTarget
/// Gets the position of the target.
/// <returns>The position of the target in world space.</returns>
/// Gets whether the target is active.
/// <returns><see langword="true"/> if the target is active; <see langword="false"/> otherwise.</returns>
To use this component, attach it to any GameObject and set its reference to a property on the controller for input.