godotengine / godot

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

Two Identical Meshes But Only One Works with Skeleton #98944

Open grazianobolla opened 3 weeks ago

grazianobolla commented 3 weeks ago

Tested versions

4.3-stable

System information

Godot v4.3.stable.mono - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 6GB (NVIDIA; 32.0.15.6094) - Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz (6 Threads)

Issue description

I have to absolutely identical meshes, both exported from Blender, one of them was exported with the Armature and the other was was exported alone.

I already have the skeleton for this mesh in my Godot scene, I only need to change between meshes, but for some reason it only works if I export the whole armature + mesh from blender and not only the mesh, which is all I need. It seems like the vertex groups are getting lost somewhere or not being loaded properly.

Exported w/Armature: image

Exported only Mesh: image

Quick video:

https://github.com/user-attachments/assets/fd84bac0-77a3-4baa-a030-147b67e45573

Steps to reproduce

  1. Create an Armature in blender and animate a simple mesh
  2. Import the full model to Godot (mesh + armature) everything works fine
  3. Go back to blender and create/modify the mesh (just the mesh)
  4. Import only the mesh into godot
  5. Go into the skeleton and change the mesh for the new onw
  6. It doesnt work

Minimal reproduction project (MRP)

bug-report-meshes-anim.zip

MwilliamsK commented 3 weeks ago

It requires a skin resource, which you won't get unless you export it with the armature. I've taken to exporting glb with the armature then deleting it once it's in my scene and setting it to use the original skeleton. I don't know if you can just copy it from one to another.

AFAIK the skin resource maps bone indices and has some matrix data - but someone can correct me on that, I didn't look far into it beyond discovering it's existance and requirement, and the documentation is "There is currently no description for this class."

I don't know if you need this with other formats. Regardless I don't think it's a bug since the same data in the skin class is in the gtlf format.

grazianobolla commented 3 weeks ago

It requires a skin resource, which you won't get unless you export it with the armature.

Is Godot removing the skin resource? Or is this some GLTF specific optimization?

Also I tried to manually copy the skin from the mesh that did work into the other one and it also doesn't work. You can try yourself on the MRP, save the skin resource and put it into the mesh that isn't working, it still doesn't work.

It's not that bad, but I would still prefer to have only the mesh and not bother with the skeleton.

PrinceDeveloperOf commented 1 week ago

Does this issue still require work? It seems like someone has put up documentation for the skin resource. Do different formats needs to be tested to se if they exhibit the same behavior?

grazianobolla commented 1 week ago

Can you point me to this documentation? I don't see it on the Godot docs

PrinceDeveloperOf commented 1 week ago

Is this the page that you would be looking for? https://docs.godotengine.org/en/4.3/classes/class_skinreference.html