Differences in Motion Creation by Workflow

Updated: 12/08/2022

Features Related to Motion of Each SDK

  Workflow for Unity Original Workflow (Native, Web, Unity, Java)
Actuator Mecanim CubismMotionManager (Native, Web, Java),
CubismMotionController (Unity),
Mecanim (Unity)
Behavior of unspecified elements after motion ends Reset to initial value Value at end of motion
Part-to-part integrity protection None Available
Motion switching Switching by linear interpolation
Motion units as specified in Mecanim
Parameters are used to apply the easing type of interpolation
Part opacity is linearly interpolated
Fade values can be registered in 3 separate frames

Unity and Mecanim Features

Motion control in Workflow for Unity is done with Mecanim, a built-in feature of Unity.
The component used is Animator, which creates motion controls in the form of state transitions in a graphical environment.
To control the switching of state transitions, use parameters that can be set in Animator.
To control these parameters, use scripts, AnimationClip with Animator control curves, etc.

BlendTree allows blending between motions, which is not available in OWSDK.
This feature is powerful when used to blend facial expressions.

For more information on Mecanim, see Animation in the Unity Official Manual.

Notes on Creating Motion with the Unity SDK

Part consistency

The most important thing to keep in mind is the consistency of the switching parts.
Even in Unity, the Original Workflow method automatically maintains consistency with the Pose function,
but Workflow for Unity requires attention from motion to state transitions in Animator to maintain part consistency.

• Enter consistent values for all switching parts.

Unspecified parameter or part values may cause unexpected behavior because they will return to their default values if Write Defaults is set.

Also, when using the layer function, other layers may be affected.

• Do not include motion with switching in the BlendTree.

The value of the part may affect the display in some way.

Linear interpolation during motion switching

The interpolation method used when switching between motions is linear interpolation provided by Unity’s Mecanim, while the Native SDK uses an easing (EaseInOutSine) interpolation.

This interpolation method appears natural for transparency, etc., but looks mechanical for linear interpolation such as rotation deformers.

Original Workflow Features

In Original Workflow, motion is controlled by registration in .model3.json using Cubism Viewer (for OW) and by code calls.
Instead of a graphical environment, the pose function maintains the integrity of the switched parts automatically and in real time.
Because of the property of remaining values after the end of a motion, the final motion can also be used as a state transition.
Expression motions are also available, where the compositing method can be individually specified.

Program Modifications

All the items listed as features of Original Workflow are characteristics when using the Framework and samples included in the SDK as they are.
If you use the Framework as-is or create a program based on the sample, it will inherit the characteristics listed above.
However, since all programs other than Core are publicly available in the Cubism SDK, it is possible to modify the SDK implementation to suit the application specifications.
Follow the specifications of the program that will ultimately use the Live2D model.

To Make the Pose Function Work Correctly

The Pose function monitors the designations from motion to the corresponding part and recognizes the first non-zero operation it finds as the displayed part.
It is necessary to hit values for all switching parts as when operating in Workflow for Unity.
It is also important to ensure that the value is set to 0 for hide, as it will react if even a small value is left behind.

No Part Opacity Operation in Motion except by the Pose Function

Due to the opacity of the part being manipulated via the Pose function,
parts that do not have a part manipulation specification will not reflect the manipulation, even if it is specified in the motion.
When manipulating the visibility of a single part, it is necessary to provide a pair of empty parts.

Motion Call Characteristics

Priority

When using CubismMotionManager to play back motion, there is an item to set the priority of playback.
You can also reserve priority for future playback.
During playback, playback can be sorted by comparing the priority of the motion’s playback request with the priority of the reservation.

csmBool CubismMotionManager::ReserveMotion(csmInt32 priority)
{
    if ((priority <= _reservePriority) || (priority <= _currentPriority))
    {
        return false;
    }

    _reservePriority = priority;

    return true;
}

Priority order of fade designation

The Original Workflow method allows the fade time specification to be registered in three separate frames.

Priority 1 2 3 4
Designation Parameter unit Registering motion to the model Motion standard Unspecified standard value (1 sec)
Setup method “Setting Fade Values” “Motion Settings” “Setting Fade Values”  

Loop configuration

Currently, Cubism Animator does not allow loop settings, so the loop setting when importing Motion files is typically set to False.

CubismMotion* CubismMotion::Create(const csmByte* buffer, csmSizeInt size)
{
    CubismMotion* ret = CSM_NEW CubismMotion();

    ret->Parse(buffer, size);
    ret->_sourceFrameRate = ret->_motionData->Fps;
    ret->_loopDurationSeconds = ret->_motionData->Duration;

    // NOTE: Exporting motion with loops is not supported in the Editor.
    // ret->_loop = (ret->_motionData->Loop > 0);

    return ret;
}

To load the settings from the motion file, change the commented out part above to the following to restore the settings.

    ret->_isLoop = (ret->_motionData->Loop > 0);
Attention

ret->_loop is not a correct variable name, so uncomment it and change the description to ret->_isLoop.

Also, since Editor settings are not currently available, you must process the .motion3.json file directly in a text editor to change the motion file settings.

In addition, specifying false for the fade-in setting during looping will result in editor-like behavior.
To change the fade-in setting for looping, add the following to the loop setting specified earlier.

    ret->IsLoopFadeIn(false);

Note that there is currently no setting item in the motion file for fade-in during looping.

The Loop setting is useful when you want to use a fade for switching but do not want the fade to work during idle.

The idle motion for samples that do not use the Loop setting is designed to begin playing idle motion only when there is no motion that is running.
For this reason, when creating a program in the form of a direct derivation from the sample, it is necessary to consider idle motion switching so that it is not noticeable.

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