Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the facial expression Animation of characters in Unity

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

How to achieve the expression animation of the character in Unity, many novices are not very clear about this. In order to help you solve this problem, the following editor will explain it in detail. People with this need can come and learn. I hope you can get something.

Some time ago, when I was studying 3D intelligent voice assistant, I studied the facial expressions of characters in Unity, and now I share the implementation with you.

Software preparation

When I did the research at that time, I used the following software:

FaceGen Modeller: a gadget used to make a model of a character's head, and it can pinch the face, make a variety of expressions, and is easy to use.

Maya: everyone is familiar with this, so there is no need to introduce it. It is mainly used to make Blend Shape (I'll talk about it below).

Unity: needless to say, the final result is the effect achieved in Unity.

Realization logic

It is mentioned above that using Maya is mainly used to make Blend Shape, so what is Blend Shape?

Blend Shape is an animation that drives one model to another, causing vertices to have linear interpolation displacements. It is also called Morph Target in other game engines. For example, the facial expression animation of a character drives a normal model through a series of models with different facial expressions, resulting in facial expression animation. The logical structure is as follows:

It is important to note that all expression models must be based on the same model.

Model making process

First, export a normal head model in FaceGen Modeller, and then export a series of head models of other expressions (pay attention to a good name, otherwise it will be messy).

After the models are ready, they are all imported into Maya. Here are some of the models I used (specially arranged for easy viewing). You can see that there are all kinds of models with various expressions.

Expression model

Then is to make Blend Shape, first select all the models with facial expressions, and finally select the model in the normal state, and click the menu deformation > Fusion deformation settings button pop-up menu.

Set the name in the pop-up window, and other settings are fine by default.

Set up pop-up window

After you have created the Blend Shape, you can continue to view these emoticons and click window > Animation Editor > Morph Editor to open the pop-up window.

In the pop-up window, you can see all the facial models we have set, and the name displayed is the name of the model in the outline. If the name is very messy, you can continue to modify it in this pop-up window.

Drag the weights / drivers of different expressions to preview the facial expressions of the model.

Blend Shape pop-up window

After checking that there is no problem, you can export the model. The model remembers to export the fbx format, and make sure that the Blend Shape check box is selected when exporting.

Import Unity

After importing Unity, if there is Blend Shape information in the model, Import Blend Shape will be automatically checked in the model settings.

Drag the model into the scene and you will see an extra column of Skinned Mesh Rendered in the property settings panel. The settings in the Blend Shape below are all our expressions.

Facial expression setting

We can manually drag the slider to test the effect, and then we need to write a script to control these facial animations.

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report