- Home /
Mecanim is not playing facial animation.
So trying to get accustomed to the new animation system and upgrade all of our animations. Problem I am currently having is that when I preview the animations in the inspector, the character animates as he should. However, when I assign any of the clips to the Animator controller for my character, the body moves just fine but any animations that should be driving the face are not working. Any ideas?
Hi, I don't really follow this process (sorry) But could someone put together a youtube video explaining how i would make it work with a few animations?? Idle ,wave etc all with body and facial animation, and how this fits into the $$anonymous$$ecanim system....
Cheers
Probably not. We're coders, not directors :) Answered below.
Answer by SilverStorm · Dec 05, 2012 at 08:15 PM
I think this is a bug, I also got the same problem and still have not found a solution. I have used masking and assigning the face bones in the Avatar which makes things even worse. You should submit a ticket I think.
Answer by JD3D · Dec 06, 2012 at 01:03 AM
I sent in my project to Unity. It has been forwarded onto the dev team. For now my fix is to just use generic for the rig.
Answer by SilverStorm · Dec 06, 2012 at 08:31 AM
I was told on the forum that this is the solution : "Wow, slow down SilverStorm, 5 hours of bumping a specialized question on a public forum? Please don't bump more frequently than once per day!
The feature is called Additional Bones... and if you check this feature both when you import the Humanoid model and the Humanoid animations this should work out of the box."
For me this has not worked. But maybe I did something wrong, try that out for yourself and let me know how things go.
Answer by alwynd · Jun 19, 2013 at 03:34 PM
Hi, I don't know if this is too late, or if your'e problem has been resolved, I have Unity 4.1.2f, and have setup a character with a face rig bones only, (Brows 2, Cheecks 2, Lips (4 bones), Jaw 1), very simple and basic face rig I must admit.
And created a few expressions using motion builder, when I imported this , I checked the "Keep additional Bones" (my character and animations are all in 1 FBX), and setup using Humanoid, the animation clips played fine on their own. (I have 2 idles, and facial expressions, to test)
It is using Mecanim, and I setup the base layer of the Animator for this character, to only alternate between 2 idles, and then created a separate layer for the Face, I used a body mask (Head only), and set the layer blend mode to additive. *I did not set sync or IK Pass, basically default
anyways, when I played the Scene, only the base would play, and I figured (via this forum) that the default layer weight is 0. So I attached a script to the character, on start. (C#)
Animator animator = null;
animator = GetComponent();
animator.SetLayerWeight(1, 1.0f);
And it worked, no problem. The facial expression is playing, while the body is doing something else. The head is also being turned by one of the idles, and as that happens, the facial expression is also blending with it.
If your animations aren't even working in the clips, then I guess it is something else, just wanted to say this. Regards.
Here is my youtube clip, showing my Facial animation with idle animation, using only Mecanim and a body mask.
The Solution that I found is this. Use $$anonymous$$ixing Transforms to animate the face and remove all the face bones from $$anonymous$$ecanim. $$anonymous$$ecanim doesn't animate facial animations....So I added all the Body bones ONLY but for face I simply use $$anonymous$$ixing Transforms to animate face animations. You need to have added a "Animation" component for this to work....maybe that was your problem all along.
$$anonymous$$y character has a "Animator AND an Animation" Component. Using this method WITHOUT mixing transforms still works because the Animator can drive the body while the Animation can drive the face. (remember to remove all face-bones from $$anonymous$$ecanim if you use this method and it should work if you did it properly).
You need Animation components for Animations with a Legacy Rig to show up while playing. You need Animator components for Animations with a Generic or $$anonymous$$ecanim rig to show up while playing. Odds are your facial animation is using a Legacy rig.... If you still need help give me a buzz and I will make a video tutorial with scripting examples.
Answer by meat5000 · Feb 09, 2015 at 01:38 PM
Note that if other animation plays, this is likely a Modeller problem and not a Unity one.
If your Facial Animation is performed with Bones, this is not so hard.
With Blender :
Keep the Facial Rig and the Main rig separate. Combine them to the Master/Root bone using the Child-Of BONE constraint in Pose Mode.
When Keyframing, only select the bones you wish to OverRide completely with that current animation.
EMPTY INFORMATION IN A BONE WILL CAUSE A NON MOVING RIG IN UNITY. Unity will do as it is told and keep the bone still as the animation is telling it to. Only keyframe the bones you want. This is easier achieved with the Child-Of constraint.
When importing the model to Unity you will see (in the latest builds >4.5) that the rig and face animations appear in the same list
Face | Smile
Face | Frown
Body | SpontaneouslyExplode
And despite being separate subobject can all be animated with the same animator on the Top-Level object, no Body-Mask required.
I'm trying this from $$anonymous$$aya, where the face rig and body rig need to be part of the same rigging system to work...
Is it purely a job for a coder? Or is there a way to solve this in $$anonymous$$ecanim through masks and blend tress etc?
I'm not sure what is available in $$anonymous$$aya but I imagine it is a similar process. This is because Blender uses FBX format and the information in there must be similar for it to work in Unity.
Ultimately the rigs are two separate objects that are both linked to the root. When Imported, the root will contain the information of the animations for all its parts. This is not a parent relationship but a constraint, in Blender. It will work with parenting but you must only $$anonymous$$eyframe the bones that matter for that animation, as if it is linked and contains 0 information this will count as a non-movement in Unity.
Its not a job for a coder, its a job for a modeller.
Another interesting point to note is that when animating the parts independently you are able to place the parts on different layers of the Animator and set the mode to Override. Having them set to Blend can cause more problems!
where the face rig and body rig need to be part of the same rigging system to work
Have you tried a parent relationship? The import thing is that the parts of your model you want to animate are weight painted or vertex grouped to the relevant bones. As long as all your parts are children of the Root object there shouldnt be a problem.
Your answer
Follow this Question
Related Questions
Facial Animation inconsistancy in Mecanim 0 Answers
Add more bones to skeleton - vertebraes definition...? 0 Answers
How to create a 2D rig? 1 Answer
Multiple Animation Events not firing 1 Answer
Tweaking a Walk Cycle 0 Answers