How to Operate Parameters Cyclically

Updated: 01/30/2020

This section describes how to set up periodic movement of parameter values, like breathing or a pendulum.


If you want to move any parameter cyclically, you can do so by using the CubismHarmonicMotionController.cs and CubismHarmonicMotionParameter.cs files.

Implementation involves two things.
1. Set up to control parameters
2. Specify parameters to be moved

Set Up to Control Parameters

First, attach a script to the model’s foremost parent to control the motion.
The name is CubismHarmonicMotionController.cs.

There are two setting items in the CustomHarmonicMotionController.cs.
– Blend Mode: Specifies how to calculate for the value currently set for the specified parameter.

Override: Overwrite the currently set value with a numerical value.
Additive: Add a numerical value to the currently set value.
Mutiply: Multiply the currently set value by a numerical value.

– Channel Timescales: You can optionally create multiple timescales and resize the timescales.

In this case, the Blend Mode settings are as follows.
– Blend Mode: Override

Specify Parameters to Be Moved

Then, select the parameters you want to move and attach the file CubismHarmonicMotionParameter.cs.
Here, it attaches to angle X.
Angle X will be in [root]/Parameters/ParamAngleX.

There are five setting items in the CustomHarmonicMotionParameter.cs.

– Channel: Specify the Channel Timescale set in CustomHarmonicMotionController.cs.
– Direction: Specifies the width of the movement with respect to the center of the parameter.

Left: Only the left half moves from the center of the parameter.
Right: Only the right half moves from the center of the parameter.
Centric: The whole object moves from the center of the parameter.

– Normalized Origin: Set the position of the parameter to be centered.
– Normalized Range: Set the maximum distance to be moved from the center point based on the center determined by Normalized Origin.
– Duration: Adjust the parameter cycle.

In this case, the settings are as follows:
– Channel: 0
– Direction: Centric
– Normalized Origin: 0.5
– Normalized Range: 0.5
– Duration: 3

With the above settings, the parameters can be moved periodically as shown in the video below.

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