- Home /
Weird issue with Blender animation running riot in Unity
Hi guys,
I have imported a Blender created model with animations into Unity, and it is working fine except for one thing that seems completely screwed up.
Here you can see what the animation looks like in Blender: blender_20130204.avi Please note how both hands of the robot character are remaining relatively static (as intended).
And here is what comes out from it in Unity (in slow motion): unity_20130204.avi Note how the hands/arms are flapping around like crazy!
I've imported the model as a "humanoid" rig in Unity, and the bone mappings are looking absolutely fine from my point of view. I can also run all the muscle movements, they all seem to behave normally.
Only when playing the animation (either in the preview window, or in game mode), the hands are flapping.
Before going more into details: Has anyone every experienced this?
I guess there can be various reasons for it, e.g. from badly designed bones, weights, normals in Blender to wrong import settings in Unity. I've checked myself tons of things for hours, but haven't come to any conclusion.
Any help higly appreciated!
Some more details that I didn't mention in the first place:
First of all: If someone is willing to download and check my .blend file, it can be downloaded here
Then...
I am using Blender 2.65
I am using Unity free version 4.0.1
The .blend model uses regular bones alongside with I$$anonymous$$ controls. $$anonymous$$g., the hand bones that are "flapping" in Unity are also influenced by I$$anonymous$$s linked to the lower arm bones. This works fine in Blender. Honestly, I am not sure whether it's actually the hands or rather the lower arms that are responsible for the "flapping"
I've imported the .blend file in Unity as a "humanoid" rig, and the "Configure" proces worked fine, including T-Pose and testing of all the muscles; though I don't know how meaningful this is for telling whether the bones are correctly handled by Unity, as Unity seems to interpret armature in its own way (e.g., in the muscle preview, I cannot even see my hand bones, and several other bones seem to be placed/oriented differently, though the mesh itself behaves correctly)
The mesh is not scaled during import (scale factor is 1)
I've imported the model's animations with and without keyframe compression, with and without various root bone options etc. Nothing of this makes any difference.
So right now I still can't tell whether the cause of this issue lies in Blender or in Unity.
Answer by webNeophyte · Feb 20, 2013 at 01:35 AM
One thing I noticed in your Blender video is that you have the NLA editor open in the bottom left portion of the screen. In my experience, animations seemed to always get "tangled" up with each other doing that. The best way I create separate animations to work with Unity is using a workflow that I found on blendercookie (see link below). I use 2.64, but I am sure not much has changed. It just uses actions in the dope sheet editor. I think it is easier to manage.
Blender Cookie - Exporting Characters from Blender to Unity
Hopefully that should help.
Thx Scott!
I admit that I've been using the NLA editor without deeper understanding. I've just adopted this from a basic blender animation tutorial, without getting deeply into the question what the editor really does, and whether there are alternatives. So I'll gladly use your link to get a new view!
I should mention that in the meantime I've switched to importing my model as "generic" ins$$anonymous$$d of "humanoid" rig, which seems to have bypassed the problem: In generic mode, the strange "flapping" is gone!
The reason why I was originally sticking to the "humanoid" rig approach was that I wanted to make use of the bone mask feature. But meanwhile I found out that I can also define "Transform masks" for generic rigs, so there's no direct need anymore for the humanoid.
But I am still curious to learn whether there's a solution for this issue. Because it would definitely be nice to benefit from the full mecanim features rather than having to switch back to "generic" or "legacy" mode each time I run into such problems.
Answer by coffiarts · Mar 16, 2013 at 03:14 PM
Meanwhile I found out that the bone rolls in my model are partially inconsistent: I did a test by automatically recalculating them (in Blender) and reimporting my model. As a result, my character looks weirdly twisted (as expected), but the animation issues are mostly gone (approximately 80% of the flapping effects have vanished).
Hence, though it's still not completely solved, I strongly suspect my own corrupted Blender model being the reason for my problem. I assume that I have simply forgotten to recalculate my bone rolls in Blender prior to creating my animations. And now there's probably no easy way to revert to a proper state (other than recreating all my animations from scratch) :(
So the answer to my own question is: Take extreme care to properly clean up bone rolls in Blender before animating!
It seems that this is a potential reason for screwed up animation behaviour in Mecanim (i.e. it's most likely not a Mecanim problem, at least in my situation).
How to recalculate bone roll in blender?:
switch to Object view,
select your armature
switch to Edit view
press "a" to select all
press space to bring up the context menu
type in "roll" to find the "Recalcutate bone roll" option
Hope this helps!
Your answer
Follow this Question
Related Questions
Blender to Unity Animations 1 Answer
How to combine mecanim and script based bone movement/animations? 2 Answers
Confused on importing animated model from Blender 0 Answers
Mecanim animation importing 2 Answers