This general question is not limited to only Maya, but other 3D modelling tools. I’m trying to create a 3D character that has a flat facial animation look and to use it inside Unity. The problem is I’m not sure how to do it.
Do I have to make shapes for the face expressions or can I use textures?
Should the facial animations be controlled by script in Unity or?
Here’s an example what I like to do:
Notice how the facial animation changes according to dialogue.
Hope someone can help me with this. Thanks in advace.
-Hakimo
Unity doesn’t support BlendShape animation, although I have seen some user based scripts for that. If you want to go with what’s built-in in unity, you have to do bone-based facial animations.
For this type of effect I think a texture atlas of the different facial expressions might work best. Then just change the UV offset parameter of the texture to get the desired expression to show up. There would be no blending, but it didn’t look like there was any in the video you linked either.
Hi, thanks for the reply. I have a new question. I’ve looked at the animation view tutorial and I’m finally able to make facial expressions and have it animated on a 3D character. Here’s a snippet of code:
Is there a way to manage animations? E.g When character jumps, play the facial animation and after jumping, stop the animation? I can’t use the !animation.IsPlaying for some reason. And from my example code above, everytime I press the fire1 button, it plays the search2 and sad animation but I can also see the MeIdle animations.
Thanks for the reply Fishman92. I’ve looked at animation layers and even animation.synclayer but I can’t seem to grasp on how to use animation layers. I have two game objects, each with an animation attached. One is for character body and the other one if for facial animations. Here’s a small snippet of what I’ve made:
var charExpression : GameObject;
function Start ()
{
// We are in full control here - don't let any other animations play when we start
// animation.Stop();
// By default loop all animations
animation.wrapMode = WrapMode.Loop;
animation["walk"].layer = 3;
animation["idle"].layer = 3;
charExpression.animation["faceJump"].layer = 2;
charExpression.animation["faceJump"].wrapMode = WrapMode.Clamp;
// The jump animation is clamped and overrides all others
var jump = animation["jump"];
jump.layer = 2;
jump.enabled = false;
jump.wrapMode = WrapMode.Clamp;
animation.SyncLayer(2);
}
function Update() {
if (marioController.IsJumping())
{
charExpression.animation.CrossFade("faceJump");
if (lastJump.time > landBounceTime) {
lastJump.speed = 0;
}
}
}
The animations I should get is the jumping animation and facial animation to play at the same time. For now the facial works but it’s not playing the animated jumping of the character’s body. I’m a bit confused about how animation layer works but from I understand, what it does is basically grouping the animations yea?
Scrap that, again I’ve seen to have complicated things. This might be an easier solution, since I have the facial animations on another gameobject inside the character’s hierarchy, is it possible to call an animation event from another game object?
Discussed this with a Unity Evangelist. At the moment, I can’t call on a function of an animation of a another game object from the animation view editor. For now, scripting it is the only solution.
I saw blendshapes mentioned, but I don’t think the video you linked was using blend shapes, it just changed the texture. So you should make a texture atlas with different facial expressions in it and then move the UVs around to the ones you want, when you want them.
Yep already done that I’m using the facial animation script from the Animation tutorial at unity3D. For now I can call the animation from script but I can’t call the animation in the view editor since it’s on another game object.
-Hakimo
In Max Maps are animate able like noise, but for a flat shape animation hmm … maybe morph modifier can help, in your 3d application make a face with different face textures then add them to your morph it and make them animate able, it should work imo
Welcome to the Unity Forums. Here’s a link that I use to start with. I used the C# version of the facialanimation code. In the vimeo video it shows how it works. Once it’s done it’s called like any other animations i.e. animation.Play("HappyFace");
Don’t forget to download the unity file from unity3d and watch the videos.
Well i think we can make animations with morph then collapse it so that it change to editable poly or mesh in case unity don’t support it, then exported to fbx and bake the animations, and run it to unity…