1. ホーム
  2. Web プログラミング
  3. 関連情報

ブレンドシェイプスイッチによるUnityの表情変化 アニメーションチュートリアル

2022-01-01 14:29:19

I. 前書き

クリックで迷わずフォロー、連続出力 Unity 乾燥した記事
みなさんこんにちは、ニューヘアーです。
Unity を実装する必要があるかもしれません。 3D のような、文字式の遷移スイッチです。

<イグ

Unity これをUnityで行うにはどうしたらいいのでしょうか?今日はその話をしましょう。

II. ブレンドシェイプ(アニメーター、MAYA)

Maya アニメーターは BlendShape を作成するだけで、アニメーターは式をバインドすることができます。 A emoji を使用します。

B expression
C expression
etc., by
BlendShape
It's easy to interpolate the transition between expressions.

Note that BlendShape is different from skeletal animation in that the mesh needs to be bound to a bone first, and the bone drives the mesh; whereas BlendShape does not require bones, the BlendShape is good for facial expression implementation.
Animators do a good job of BlendShape After the Unity the client programmer imports the model into Unity project in the Unity Check the model's Import BlendShapes . In this way, the Unity we can use the BlendShape slider to adjust the transition of the expression. The effect is as follows. Three, Unity control BlendShapes Above we are manually adjusting the BlendShape slider, how can we control the BlendShape What about
There are two ways to do this. 1. directly through SkinnedMeshRenderer component to access the BlendShape
2, made into Animation in Animation control in BlendShape and then the code controls the Animation . 1. SkinnedMeshRenderer controls BlendShape Interface. // SkinnedMeshRenderer.cs public void SetBlendShapeWeight(int index, float value); Parameters index is BlendShape index, starting at 0. The parameter value is the value of the slider, in the range 0~100 . 2. Animation control BlendShape The animator makes the expressions into Animation and specific combinations of BlendShape is actually an expression, such as eyebrows up, eyes wide open, mouth open, the combination of these three is an expression, so made into n a Animation Animation. Organize these animations into Animator state machine. about Animator you can see my previous article on the use of A tutorial on using the Animator, Unity's animation state machine Next, we can play the animation to make the transition to the expression. // Animator.cs public void CrossFade(string stateName, float normalizedTransitionDuration); Parameters stateName is the name of the animation state, e.g. smile , the parameter normalizedTransitionDuration is the animation fusion normalization time.
We can test the normalizedTransitionDuration respectively, as 0 , 0.3f , 1 The fusion effect for the three cases.
The case of 0.
For the 0.3f case. for 1. IV. Conclusion OK.
Like. Unity students, don't forget to click on the follow, if there are any Unity If you have any technical problems related to Unity, please feel free to leave a comment or private message.
Thanks for reading and see you next time.

The above is the Unity through BlendShape to achieve facial expressions transition switching Animation tutorial details, more information about Unity through BlendShape to achieve facial expressions transition switching Animation please pay attention to other related articles of the script home!

// Animator.cs
public void CrossFade(string stateName, float normalizedTransitionDuration);


<リンク The above is the Unity through BlendShape to achieve facial expressions transition switching Animation tutorial details, more information about Unity through BlendShape to achieve facial expressions transition switching Animation please pay attention to other related articles of the script home!