Unity pinches the face of Blender

Received the demand of father A, to make a face pinching demo.
Pinching face is divided into pinching bones and pinching mesh. After careful consideration, I found that pinching mesh with Blender is the fastest way to get the effect.
1. Download Blender and install Blender official website: https: //www.blender.org/download/
2. Open Blender, create a regular window, and import an FBX file
3. Shift + mouse wheel to adjust the view window
4. Click Preferences
insert image description here
5. Check 3DView
insert image description here

6. As shown in the picture, select Move, and check Rotate if necessary
insert image description here

7. Select the attenuation to edit the object
insert image description here
8. Turn on the automatic frame insertion
insert image description here
9. In the edit mode, select the topology mirror
insert image description here

10. In object mode, add shape keys and rename them.
insert image description here
insert image description here
11. In edit mode, adjust the value of each shape key.
12. Save the .blend file.
13. Import the blend file, and you can see that the shape keys just created are all in the properties The panel is up, drag the progress bar to see the effect we just adjusted.
insert image description here
14. Create several sliders in unity, and associate the sliders with the shape keys

	public Slider[] sliders;
	public SkinnedMeshRenderer sm;

	void Start()
    {
    
    
		for(int i = 0;i < sliders.Length;++i)
		{
    
    
			int temp = i;
			sliders[i].onValueChanged.AddListener((v) => OnSliderChanged(temp, v));
		}
    }

	void OnSliderChanged(int index,float v)
	{
    
    
		sm.SetBlendShapeWeight(index, v * 100);
	}

Guess you like

Origin blog.csdn.net/u014481027/article/details/125486178