Set the Physics Computation


You can make settings of the physics computation with which you can create the real-time movement like hair swinging at the timing of turning the face, and export it.


Add the physics computation settings

From the "File" menu, click "Add" - "Physics".


A physics computation setting with the name of "physics" is added.



We are going to make settings in details in this example, so clear the "Easy Mode" check box.


Refer to the Easy Mode Settings of Physics Computation page about the details of Easy Mode.


Settings of the physics computation


We are going to create swinging of Bangs in this example.

First, change the label names to recognize them easily.

Right-click the label "p00" of the pull-down menu to display "Rename" and click it.


Enter "hair_front" in the text box and click "OK".

Use only alphanumeric characters and do not use Japanese.


The label becomes "hair_front" as below;



Make settings of "Basic", "Input", and "Output" tabs.

If you place the cursor over the setting item, you can see each explanation for your reference.



"Basic" tab settings

You can make settings in "Basic" tab as below;



The physics computation set here is based on the movement of the swing of the pendulum, so you better to make settings of the value with picturing it.

Mass

The mass of part swinging.

(It is like the mass of weight with the pendulum.)

The bigger the value is, the larger it swings.


Length
The length of the part swinging from end to end.
(It is like the length of the string with the pendulum.)
The bigger the value is, the slower it swings.

Air Resistance
Air resistance rate of swinging.
The bigger the value is, the earlier the swinging stops.



"Input" tab settings

You can make settings of "Input" tab as below;

Click "+" button to display the setting window.


Make settings as below;



ID
This Parameter affects swinging.
Specify the horizontal movement "PARAM_ANGLE_X" (Angle X) to set the Bangs swings along to the movement of the face.

type
This is the type of the movement of the Parameter.
Specify "X" to set the parameter of the X axis movement of the face.

Movement (m)
This refers to movement (distance in meters) for every additional parameter unit in the program.

This value is when the Parameter value of Angle X of the face changes 1, so make it "5mm=0.005m" comparing with the real movement of the face.
If you have made it in the range from -30 to 30 supposing to move the Parameter of Angle X of face in 30 degrees, it will be the amount of movement of face in 1 degree.

For example, if the movement is set to 0.005 m, then for every 1 unit change, the parameter is specified to move by a distance of 0.005 m.

When "Angle" is selected for "type", the unit is "°".

Weight
This is the degree which the Parameter change affects swinging.
Set it as "1" basically and you may change it during adjustment.


Click "OK" to add the setting item.


You want to make the hair swing even Angle Z of face is changed, so add the settings as below;



Angle Z of face is the Parameter of angle to incline the face, so "Angle" is selected for "type".


Then the setting which the Bangs swing according to Angle X and Angle Z of face is completed.


"Output" tab settings

Let's make settings of "Output" tab in the end.

You can make settings by clicking "+" button like in "Input" tab.


Make settings as below;


ID

Set a Parameter which you want to move by the physics computation.

Here you want to move "hair_front", so specify "PARAM_HAIR_FRONT" ("hair_front").


type
Set a type of movement of the physics computation.

You want to make a movement of bangs with changing its angle like a pendulum, so specify "Angle".


Movement (m)

Set the value to compensate the result of the physics computation for the Parameter's scale.
The value will be a rough estimate which the amplitude of the Parameter (when it is with the bangs, they are from -1 to 1 = 1) divided by the value from 30° to 45° (it is 40 here) which is the usual amplitude for the virtual pendulum, so specify "0.025".


Weight
Set the degree of influence of the Parameter's change by swinging.

Set "1" basically, and you may change it in the process of adjustment.



The output setting is completed.

After all the settings are completed, execute the validation.


It will be OK if the bangs swing by dragging the model view, or changing the Parameter of Angle.



Add the settings

Add the physics computation of back hair.


Click "+" button to add a new setting of the physics computation.



Enter the label name in the "label" text box and click "OK".

Add a check mark to "Copy" and select the item to copy the setting of the physics computation from the pull down menu.



Make settings for the back hair as below.



As the length is longer for the back hair, make the values of "Mass" and "Length" twice in "Basic" tab, and rename the ID as "PARAM_HAIR_BACK" in "Output" tab, then make settings for the rest of items same as of the bangs.


It is recommended to reuse the basic settings and adjust some of them in need if there are several physics computations with same elements.

You can adjust the input or output settings if you need more adjustments.




Export a JSON setting file

You can export a JSON setting file from the "File" menu, select "Write" - "Physics".
If there are several items which swings differently according to the clothes like accessories or skirts, export them in each clothe with using the same name as of the moc file.

JSON setting file exportation is completed.



Tips

Here are some examples that are often used.

Swing of Bangs (which swing by the Face Angle X and Y)

It is recommended to add this setting and adjust the swinging range in the basic setting.

This is the setting value which is an assumption of amplitude of the following Parameter values, so you need to adjust the value of "Movement" if it is different.

Face Angle X : from -30 to 30
Face Angle Z : from -30 to 30
Hair Swing : from -1 to 1




Swing of Bangs (which swing by the Face Angle X and Z + the Body Rotation X and Z)

This is the setting which makes the hair swing not only by the rotation of the face, but also the rotation of the body.

This is the setting value which is an assumption of amplitude of the following Parameter values.

Face Angle X : from -30 to 30
Face Angle Z : from -30 to 30
Body Rotation X : from -10 to 10
Body Rotation Z : from -10 to 10
Bangs Swing : from -1 to 1



If there are several items which are the same type in the Input setting, take notice on the value of the Weight.

The Weight is "1" if there is only one type.



*About the Weight

You need to adjust the value of the Weight if there are several types.

The physics computation is on the assumption that is calculated from the item in the bottom of the chart of the input setting.

Here we are going to explain how it is calculated using a example of type X above.


(i) When the Weight of PARAM_ANGLE_X is 1, and the Weight of PARAM_BODY_ANGLE_X is 1.

First, the swinging range is calculated from Face Angle X (PARAM_ANGLE_X) in the chart below. We treat its result as A.
A will affect in 100% since the Weight is 1,

1 * A = A

so the calculation of PARAM_ANGLE_X will be resulted in A.

Next, the swinging range is calculated from the Body Angle X (PARAM_BODY_ANGLE_X). We treat its result as B.

B will affect in 100% since the Weight is 1, and the previous result A will affect with the rest of 0%,


1 * B + ( 1 - 1 ) * A = B

Accordingly, the final result of this physics computation is resulted in B.

A is overwritten by B which is calculated later, so the Face Direction X will be resulted to be no effect for swinging.

This setting is you SHOULD NOT DO.

Instead, try to change the values of the Weight.


(ii) When the Weight of PARAM_ANGLE_X is 1, and the Weight of PARAM_BODY_ANGLE_X is 0.5.

First, the swing range is calculated from the Face Angle X (PARAM_ANGLE_X) in the chart below. We treat its result as A.

A will affect in 100% since the Weight is 1,


1 * A = A

so the calculation of PARAM_ANGLE_X will be resulted in A.


Next, the swinging range is calculated from the Body Angle X (PARAM_BODY_ANGLE_X). We treat its result as B.

B will affect in 50% since the Weight is 0.5 and the previous result A will affect in 50%,


0.5 * B + ( 1 - 0.5 ) * A = 0.5 A + 0.5 B

The final result of this physics computation is resulted in 0.5A + 0.5B.

Accordingly, the weight of calculated results of A and B becomes 50% each.

You may think that the result is OK, however if you set this value and execute the validation to find that the swinging of the hair is rather small.
As you can see from the calculated result, this is because the movement of swinging of the hair is caused half by the movement of turning the face, and half by the body.

The movement of swinging of the hair by turning the face is very important movement, and the movement of turning the face is the great majority in the general motions or in "Track Mouse" in the Animation. 

Let's think about when the value of the Weight for the hair swinging is changed not only by the movement of turning the face but also by the movement of turning the body.

(iii)
When the Weight of PARAM_ANGLE_X is 2, and the Weight of PARAM_BODY_ANGLE_X is 0.5.

First, the swing range is calculated from the Face Angle X (PARAM_ANGLE_X) in the chart below. We treat its result as A.
A will affect in 200% since the Weight is 2,

2 * A = A

so the calculation of PARAM_ANGLE_X will be resulted in 2A.


Next, the swinging range is calculated from the Body Angle X (PARAM_BODY_ANGLE_X). We treat its result as B.

B will affect in 50% since the Weight is 0.5 and the previous result 2A will affect in 50%,


0.5 * B + ( 1 - 0.5 ) * 2 A = A + 0.5 B

The final result of this physics computation is resulted in A + 0.5B.

Accordingly, the calculated result of A is no effect, and the calculated results of B affect in 50%.

Thus, the swinging of the hair by the movement of turning the face stays the same, adding the degree of swinging by the movement of the body.

However the calculated result of 150% is by adding the values of two Parameters, so remember to adjust the settings not to make hair swinging scale out when these two Parameters are in the maximum amplitude.


We took the method of (iii) to adjust the hair swinging here, however you may take the method of (ii) which affect evenly depending on the parts you want to move.
It is recommended to try to find out each setting value depending on the purpose of the physics computation.


Comments