I rewrote Blender’s export_fbx_bin.py and Unity’s Unity-BlenderToFBX.py script to not bake additional keyframes between the main keyframes that I placed manually for an animation in Blender. I also had to write a custom AssetPostprocessor to disable Unity’s curve resampling:
void OnPreprocessModel()
{
ModelImporter modelImporter = assetImporter as ModelImporter;
modelImporter.resampleCurves = false;
modelImporter.SaveAndReimport();
}
However, this is how the animation looks now:
I am using the legacy animation system and at first I thought that Unity’s curve resampling is doing more than just adding additional keyframes but the generic animation system with Unity’s curve resampling disabled via the inspector does not have this problem.
Do you have any ideas on what’s going on here?
By the way despite looking weird in the game view the animation looks perfect in the preview in the inspector:
Some details:
Unity 2020.2.6f1 Personal
Blender 2.90
You can find the modified versions of the aforementioned scripts in the attached zip file. I also provided a Unity package that contains the blend file with the animation shown above if you want to give it a try.
The file locations for the script files are:
\Hub\Editor\2020.2.6f1\Editor\Data\Tools\Unity-BlenderToFBX.py
\Blender 2.90\2.90\scripts\addons\io_scene_fbx\export_fbx_bin.py
6968729–821390–PythonFBXScripts.zip (36 KB)
6950183–817772–UnresampledAnimation.unitypackage (298 KB)