EdyJ / blender-to-unity-fbx-exporter

FBX exporter addon for Blender compatible with Unity's coordinate and scaling system.
MIT License
947 stars 98 forks source link

Armature animations aren't applied to mesh #10

Closed sacrish closed 3 years ago

sacrish commented 3 years ago

When exporting a skinned mesh, only the animations of the armature itself are exported, but the weight painting and vertex groups on the mesh are lost.

EdyJ commented 3 years ago

Are those exported correctly using the standard FBX Exporter? Do you need to enable some specific option(s) on it?

sacrish commented 3 years ago

Yes the objects can be properly exported with the standard exporter, with default settings.

Here is a test file. It has a cylinder mesh and an simple armature. No matter which options I enable with the Unity FBX Exporter, I can't get the weights to be exported.

FBX_export_test.zip

EdyJ commented 3 years ago

Thanks, will take a look at it.

EdyJ commented 3 years ago

The problem is that modifiers are applied before fixing the rotations, so applying the Armature modifier to the cylinder actually freezes it. The default FBX exporter lets this modifier pass through even with the Apply Modifiers option enabled. I'll update the Unity FBX exporter not to apply the Armature modifier.

EdyJ commented 3 years ago

Please test this version and let me know if it works: https://github.com/EdyJ/blender-to-unity-fbx-exporter/blob/dev/fix-armature/blender-to-unity-fbx-exporter.py

sacrish commented 3 years ago

I've tested the file and armatures are now exported correctly. Thanks!