Make a Part as a Reference

This is a method to make the motion creation easier when combining the parts exchange by part transparency and the moc exchange.


This is effective for the following conditions.
●Model 1 has arm 1 and arm 2 for exchange.
●Model 2 has arm 1 and arm 2 for exchange as well.
There are model 3 and model 4 same as of above 2 models.
●All models are the same character and want to use the same motion.
In this case, you need to add following keys for the motion;
        ●Alpha value of arm 1 of model 1
        ●Alpha value of arm 2 of model 1    
        ●Alpha value of arm 1 of model 2   
        ●Alpha value of arm 2 of model 2
        ●will be continued for the model 3 and 4

You need a lot of operation when there are many clothes for exchange with this method.
So take another method to select a Part ID as a reference, and copy the display/hide setting of the reference to paste to other parts.
All you need to do for the motion file is to add the following keys if you take this method.

        ●Alpha value of arm 1 of a reference model
        ●Alpha value of arm 2 of a reference model

Make a setting

Decide the reference ID, and add the key of the ID for the motion. The other settings are the same as of the ordinal mtn files.
The setting is simple and easy - copy the reference value and paste it to other values.
Execute it before invoking the update function of the Live2D model after setting the parts exchange.

 The settings used in the sample code
 Reference ID ID to be copied

 The sample code

//Read from the reference ID of arm 1
 float opacity_01 = live2DModel->getPartsOpacity("PARTS_01_ARM_CLOTHES_A_01");
//Set it to the part
 live2DModel->setPartsOpacity("PARTS_01_ARM_CLOTHES_B_01", opacity_01);
 live2DModel->setPartsOpacity("PARTS_01_ARM_CLOTHES_C_01", opacity_01);

//Read from the reference ID of arm 2
 float opacity_02 = live2DModel->getPartsOpacity("PARTS_01_ARM_CLOTHES_A_02");
//Set it to the part
 live2DModel->setPartsOpacity("PARTS_01_ARM_CLOTHES_B_02", opacity_02);
 live2DModel->setPartsOpacity("PARTS_01_ARM_CLOTHES_C_02", opacity_02);