How to operate parameters cyclically
[Last 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
Configure settings 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 configuration items in the CustomHarmonicMotionController.cs.
– Blend Mode: Specifies how to calculate for the value currently set for the specified parameter.
Override: Overwrites the currently set value with a numerical value.
Additive: Adds 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 configuration 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 moves from the center of the parameter.
– Normalized Origin: Sets 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: Adjusts 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.