[Last updated 09/03/2019]
Pose is a function that manages the display state of a group of parts described in the Pose configuration format .pose3.json.
Using Pose, you can manage parts that you do not want to be displayed on the screen at the same time, such as “arms in a lowered position” and “arms in a crossed position”.
Pose can also be used to support models with different Part IDs (e.g., costume changes).
The .pose3.json can be configured in Cubism Viewer for OW.
For more information on how to set up parts, please click here.
When comparing a model imported by the OW method with a model imported by the conventional method, the following three points change depending on Pose.
- CubismPosePart is attached to the GameObject under [Prefab root]/Parts/.
- If the curve of PartOpacity in the AnimationClip matches Stepped, it is processed into a Linear curve.
- Opacity curves not described in pose3.json are removed from AnimationClip.
Pose performs the following processes.
- Processing the Opacity curve of the Parts set in Stepped in the Pose motion
- Identify parts for Pose
- Save Opacity of the part to determine which Pose part to display
- Calculation and application of Pose
- Interlocking opacity
Processing the Opacity curve of the Parts set in Stepped in the Pose motion
As described in the Pose Settings section of the Editor manual, the curve for PartOpacity handled by Pose assumes that the curve type is Stepped.
Cubism SDK for Unity processes this curve to linear and exports it to AnimationClip.
If you set a curve of a type other than Stepped, the curve will not be processed and will be exported directly to AnimationClip.
if(shouldImportAsOriginalWorkflow && poseJson ! = null && poseJson.FadeInTime ! = 0.0f)
animationCurve = ConvertSteppedCurveToLinerCurver(curve, poseJson.FadeInTime);
The processing of this Opacity curve is done by CubismMotion3Json.ToAnimationClip().
Identify parts for Pose
CubismPosePart is attached when a model is imported using the OW method.
The GameObject to be attached will be the one with the same name as the ID described in .pose3.json, placed under [Prefab root]/Parts/.
// Get Parts for Pose
var part = parts.FindById(group[partIndex].Id);
// Attach CubismPosePart
posePart = part.gameObject.AddComponent<CubismPosePart>();
// Set Pose information to CubismPosePart
posePart.GroupIndex = groupIndex;
posePart.PartIndex = partIndex;
posePart.Link = group[partIndex].Link;
This is done by CubismPoseMotionImporter.InitializePosePart().
Save Opacity of the part to determine which Pose part to display
The current CubismPart.Opacity value is compared with the value cached in the previous frame to determine the parts displayed in the group described in .pose3.json.
Values are cached by CubismPoseController.SavePartOpacities().
Calculation and application of Pose
Display parts are applied by AnimatinoClip.
Apply hidden parts with CubismPoseController.DoFade ().
CubismPoseController.DoFade() looks for a visible part and then sets the hidden part Opacity.
The Opacity of the hidden part reduces the opacity to a level that does not allow the background to show through in relation to the opacity of the part to be displayed.
Opacity is set to Opacity in CubismPoseController.CopyPartOpacities for interlocking parts written in CubismPosePart.Link after Pose is applied.