Cubism SDK‎ > ‎Frameworks‎ > ‎

Pose Setting

Summary

This is an explanation about to change the pose using the parts exchanging.
Pose changing is used mainly for exchanging arm posing, same as in the sample provided.

It is basically to exchange the switching display of the parts. Refer to the library manual.
setPartsOpacity of ALive2DModel class is used.

L2DPose class

L2DPose class is used to make the pose changing smoothly in the sample.

You need to load and update the setting file.
static L2DPose load( byte[] buf )
Load the setting file.
Return the set L2DPose instance.
Its basically loads from the byte array, however it may be overloaded to be used by each platform easily.
For example, you can load it from the InputStream pattern in the same method with Java version.

void updateParam( ALive2DModel model )
Applies the change for the model.
Sets the transparency of the parts according to the setting.
You need to invoke it for each frame.


JSON setting file

The setting file is written in JSON format.
Therefore, it is easy to check it using a text editor or to expand the specification.

Specification

Principle

You can set only the Motion Parameter from the motion file.
You cannot manage the transparency of the parts even if you have set the Motion Parameter.
The L2DPose class can support it.

If you type some key for the transparency of the parts in the Animator tool, it will be exported like "VISIBLE:XXX" (XXX is a part ID).
When you play the motion, the Motion Parameter of "VISIBLE:XXX" surely changes inside, however the transparency will not be changed as it is.
You need to make settings not of the library but of the outside program to update the modeling.
Specifically, load the "VISIBLE:XXX" Motion Parameter and make setting of the transparency with setPartOpacity.
(We do not call the setting value with setPartsOpacity as a Motion Parameter.)

サブページ (2): json sample
Comments