godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
89.42k stars 20.24k forks source link

DAE skeleton Animations from Blender do not deform the mesh #68410

Open Kimedero opened 1 year ago

Kimedero commented 1 year ago

Godot version

v4.0.beta4.official [e6751549c]

System information

Windows 10, GLES3, Intel HD Graphics 4400

Issue description

Importing a DAE, or FBX file from Blender containing animations into Godot, the AnimationPlayer displays all the animations but they are not playing.

It should be noted that these same DAE or FBX files' animations are playing in Godot 3.5.1.

It should also be noted that Intel HD Graphics 4400 graphics card has trouble opening Godot 4 projects without some modifications using the command line, where we have to set the '--rendering-driver' to 'opengl3'

Steps to reproduce

  1. Importing the DAE or FBX file into a folder named 'Models' in the Godot project
  2. Right-clicking on the file and selecting 'New Inherited Scene'
  3. Clicking on the AnimationPlayer and selecting an animation
  4. Playing the selected animation

Minimal reproduction project

AnimationPlayer Issue.zip

KoBeWi commented 1 year ago

The MRP did not upload.

Kimedero commented 1 year ago

Oh dang! Here you go: AnimationPlayer Issue.zip

TokageItLab commented 1 year ago

CC @fire @lyuma

fire commented 1 year ago

Please try the latest fbx2gltf and report back https://github.com/godotengine/FBX2glTF/releases

Kimedero commented 1 year ago

Alright.. Promptly on it

On Mon, 19 Jun 2023, 1:27 am K. S. Ernest (iFire) Lee, < @.***> wrote:

Please try the latest fbx2gltf and report back https://github.com/godotengine/FBX2glTF/releases

— Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/68410#issuecomment-1596290921, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMEOLGBQLY5HHK6BNH647ZLXL56FFANCNFSM6AAAAAAR2JKRNY . You are receiving this because you authored the thread.Message ID: @.***>

Kimedero commented 1 year ago

Unfortunately the issue persists. I've tested the GLTF2FBX importer, and imported both a Collada and GLTF file with animations into Godot and they simply do not showbup on the viewport. The animation player's track do not show any animation data, although the animation names appear.

On Mon, 19 Jun 2023, 1:27 am K. S. Ernest (iFire) Lee, < @.***> wrote:

Please try the latest fbx2gltf and report back https://github.com/godotengine/FBX2glTF/releases

— Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/68410#issuecomment-1596290921, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMEOLGBQLY5HHK6BNH647ZLXL56FFANCNFSM6AAAAAAR2JKRNY . You are receiving this because you authored the thread.Message ID: @.***>

fire commented 1 year ago

I don't see any FBX files.

Dae hasn't have much bug fixes, but according to my proposal we didn't want to deprecate it.

Blender conversion should work..

fire commented 1 year ago

Some errors on the dae.


  editor\import\collada.cpp:996 - Primitive type "polygons" is not well supported (concave shapes may fail). To ensure that the geometry is properly imported, please re-export using "triangles" or "polylist".
  editor\import\collada.cpp:996 - Primitive type "polygons" is not well supported (concave shapes may fail). To ensure that the geometry is properly imported, please re-export using "triangles" or "polylist".
  editor\import\collada.cpp:996 - Primitive type "polygons" is not well supported (concave shapes may fail). To ensure that the geometry is properly imported, please re-export using "triangles" or "polylist".
``
Kimedero commented 1 year ago

I reimported the DAE file with polygons triangulated.

The issue of animation names appearing on the animation player but no animation playing, still persists.

On Mon, 19 Jun 2023, 10:16 am K. S. Ernest (iFire) Lee, < @.***> wrote:

Some errors on the dae.

editor\import\collada.cpp:996 - Primitive type "polygons" is not well supported (concave shapes may fail). To ensure that the geometry is properly imported, please re-export using "triangles" or "polylist". editor\import\collada.cpp:996 - Primitive type "polygons" is not well supported (concave shapes may fail). To ensure that the geometry is properly imported, please re-export using "triangles" or "polylist". editor\import\collada.cpp:996 - Primitive type "polygons" is not well supported (concave shapes may fail). To ensure that the geometry is properly imported, please re-export using "triangles" or "polylist".```

— Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/68410#issuecomment-1596640903, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMEOLGBHPRUW2GJ3JQTX7B3XL74DZANCNFSM6AAAAAAR2JKRNY . You are receiving this because you authored the thread.Message ID: @.***>

lyuma commented 1 year ago

DAE and FBX go through extremely different import flows, and they should really be filed as two separate issues.

@Kimedero If the issue only affects DAE, can the issue title be renamed to DAE Animations?

If it does indeed affect FBX, can you please attach an FBX file with the issue? I don't see one in the reproduction project.

Kimedero commented 1 year ago

I have no problem with that. Actually I feel like somebody renamed this whole thread wrong as the issue I faced had never been about DAEs or GLTFs imports in particular, but more about the Animation Player.

By that I mean even when an animation is delivered into Godot 4 via a blend file, the mesh is not visible on the viewport, and the animations attached to it, simply do not work even if you can see their names and the properties they are attached to on the Animation Player.

The thread was mislabelled from the original issue, I think..

On Mon, 19 Jun 2023, 11:52 pm lyuma, @.***> wrote:

DAE and FBX go through extremely different import flows, and they should really be filed as two separate issues.

@Kimedero https://github.com/Kimedero If the issue only affects DAE, can the issue title be renamed to DAE Animations?

If it does indeed affect FBX, can you please attach an FBX file with the issue? I don't see one in the reproduction project.

— Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/68410#issuecomment-1597742195, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMEOLGAQM44M5EJYBCUMAXTXMC3X7ANCNFSM6AAAAAAR2JKRNY . You are receiving this because you were mentioned.Message ID: @.***>

lyuma commented 1 year ago

ok, but you have not attached any gltf or fbx files with the issue, so I cannot confirm your issues with gltf.

Collada / DAE works very very differently from either FBX or glTF, and the issue I can confirm in the original project seems to be specific to DAE.

I renamed this issue to say DAE, since those are the only files you provided for us to work with. If there are similar problems with FBX or glTF, please file a new issue so we can solve each separate problem one by one.

lyuma commented 1 year ago

That said, yes I can confirm the problem with DAE / collada. Skeleton is null, bad skeleton The skeleton looks like an absolute mess after import (even with animations disabled). AND, we have this:

[node name="Peasant_girl" type="MeshInstance3D" parent="Armature_003/Skeleton3D"]
mesh = SubResource("ArrayMesh_qsvyd")
skeleton = NodePath("")

The skeleton path is forced to "", rather than the default of "..", so this mesh is forbidden from deforming to its skeleton for some reason.

After clicking reset so it deforms to the mesh, let's see where we're at...... YIKES mesh explodes

The run animation actually looks perfect, in terms of the skeleton bones (yellow). image

So it really is the mesh and skin that are broken, not the animations.

But yeah it's been months since I've tested collada. it doesn't surprise me in the least that something broke. Collada is not very well maintained, and I wish we had removed it entirely because it goes through a whole separate untested codepath, but there was a poll and some people voted to keep it without understanding that it is not well maintained.

Kimedero commented 1 year ago

Ah.. That kind of makes sense. I used the 'Better Collada' addon to import to Godot after experiencing trouble with the default exporter, but I remember reading about some issues with it. Actually even the 'Better Collada' exporter has a bugs where it exports meshes with Emission turned on by default on the materials.

Can i attach the .blend file for the animation as imported into Godot, as I noticed it has the exact same issue as the DAE file in terms of animations simply not playing? This has led me to suppose this to be an issue specific to Godot 4 as I used the 'Better Collada' addon export method in Godot 3.5 successfully.

On Tue, 20 Jun 2023, 12:56 am lyuma, @.***> wrote:

That said, yes I can confirm the problem with DAE / collada. [image: Skeleton is null, bad skeleton] https://user-images.githubusercontent.com/39946030/246943083-ea31ffd3-debb-494c-8c0e-29884c705eb0.png The skeleton looks like an absolute mess after import (even with animations disabled). AND, we have this:

[node name="Peasant_girl" type="MeshInstance3D" parent="Armature_003/Skeleton3D"]mesh = SubResource("ArrayMesh_qsvyd")skeleton = NodePath("")

The skeleton path is forced to "", rather than the default of "..", so this mesh is forbidden from deforming to its skeleton for some reason.

After clicking reset so it deforms to the mesh, let's see where we're at...... YIKES [image: mesh explodes] https://user-images.githubusercontent.com/39946030/246943209-b259eb5f-b327-4b0c-828a-1cdb4540a705.png

The run animation actually looks perfect, in terms of the skeleton bones (yellow). [image: image] https://user-images.githubusercontent.com/39946030/246943384-0fde7bb6-4336-4ab7-a3b8-63c2302fc215.png

So it really is the mesh and skin that are broken, not the animations.

But yeah it's been months since I've tested collada. it doesn't surprise me in the least that something broke. Collada is not very well maintained, and I wish we had removed it entirely because it goes through a whole separate untested codepath, but there was a poll and some people voted to keep it without understanding that it is not well maintained.

— Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/68410#issuecomment-1597803340, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMEOLGCQMO43IFRVUB36MOTXMDDHVANCNFSM6AAAAAAR2JKRNY . You are receiving this because you were mentioned.Message ID: @.***>

Kimedero commented 1 year ago

Here's both a BLEND and DAE file with the exact same issue of animations not playing in the Animation Player. I think the issue might go further than collada importation, because in Godot 3.5 the DAE file displays and plays correctly.

On Tue, 20 Jun 2023, 1:15 am Dennis Kibanya, @.***> wrote:

Ah.. That kind of makes sense. I used the 'Better Collada' addon to import to Godot after experiencing trouble with the default exporter, but I remember reading about some issues with it. Actually even the 'Better Collada' exporter has a bugs where it exports meshes with Emission turned on by default on the materials.

Can i attach the .blend file for the animation as imported into Godot, as I noticed it has the exact same issue as the DAE file in terms of animations simply not playing? This has led me to suppose this to be an issue specific to Godot 4 as I used the 'Better Collada' addon export method in Godot 3.5 successfully.

On Tue, 20 Jun 2023, 12:56 am lyuma, @.***> wrote:

That said, yes I can confirm the problem with DAE / collada. [image: Skeleton is null, bad skeleton] https://user-images.githubusercontent.com/39946030/246943083-ea31ffd3-debb-494c-8c0e-29884c705eb0.png The skeleton looks like an absolute mess after import (even with animations disabled). AND, we have this:

[node name="Peasant_girl" type="MeshInstance3D" parent="Armature_003/Skeleton3D"]mesh = SubResource("ArrayMesh_qsvyd")skeleton = NodePath("")

The skeleton path is forced to "", rather than the default of "..", so this mesh is forbidden from deforming to its skeleton for some reason.

After clicking reset so it deforms to the mesh, let's see where we're at...... YIKES [image: mesh explodes] https://user-images.githubusercontent.com/39946030/246943209-b259eb5f-b327-4b0c-828a-1cdb4540a705.png

The run animation actually looks perfect, in terms of the skeleton bones (yellow). [image: image] https://user-images.githubusercontent.com/39946030/246943384-0fde7bb6-4336-4ab7-a3b8-63c2302fc215.png

So it really is the mesh and skin that are broken, not the animations.

But yeah it's been months since I've tested collada. it doesn't surprise me in the least that something broke. Collada is not very well maintained, and I wish we had removed it entirely because it goes through a whole separate untested codepath, but there was a poll and some people voted to keep it without understanding that it is not well maintained.

— Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/68410#issuecomment-1597803340, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMEOLGCQMO43IFRVUB36MOTXMDDHVANCNFSM6AAAAAAR2JKRNY . You are receiving this because you were mentioned.Message ID: @.***>

lyuma commented 1 year ago

I do not believe GitHub supports email attachments, so the files did not come through.

Kimedero commented 1 year ago

Oh.. Thank you. I was wondering if anybody was actually opening the zip files I'd been attaching.

Here's a current zip file with a DAE and BLEND file imported but still not playing on the Animation Player.

I suspect this issue might go further than collada importation, because in Godot 3.5 the DAE file displays and plays correctly.

simple bone test.zip

lyuma commented 1 year ago

Can confirm the problem with the .dae file. It's clearly a import bug and we'll need to look into why collada skinning animations are wrong.

However, the .blend file works for me. Can you confirm that you have Blender 3.4 or higher selected in your Godot Editor Settings? Blender versions before 3.4 do not correctly import animations.

Kimedero commented 1 year ago

That's strange. I'm surprised that the *.blend works on your system.

As you can see here that I'm using Blender 3.4:

image

and this viewport is how the blend file displays on my system:

image

you can see the animations on the Animation Player but none work, as the mesh is not even displayed:

image

This has become such a head-scratcher.

lyuma commented 1 year ago

Ah, I see.

I'm testing on 4.1, and also using Forward+ renderer.

4.0 renderer with Compatibility mode was incomplete, and that could be one source of the problem. Can you try Forward+ if your system supports it? If not, can you try 4.1 beta?