godotengine / godot

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

Loose edges in mesh can crash editor during import #92937

Open TitanNano opened 5 months ago

TitanNano commented 5 months ago

Tested versions

versions tested: 4.2-stable to 4.3-beta1

Release build:

Debug build: all versions

System information

Godot v4.2.beta (c5f73a178) - macOS 14.5.0 - Vulkan (Forward+) - integrated Apple M1 Pro - Apple M1 Pro (8 Threads)

Issue description

When importing a mesh with loose edges and with the advanced option generate/occluder set to Mesh + Occluder the engine will crash during the import.

In debug build:

an assertion in simplifier.cpp fails and causes the crash:

Assertion failed: (index_count % 3 == 0), function meshopt_simplifyEdge, file simplifier.cpp, line 1475.

In release build:

Steps to reproduce

  1. add glb mesh file to project
  2. enable generate/occluder in advanced import options
  3. reimport mesh

Minimal reproduction project (MRP)

test_mesh.glb.zip

TheSofox commented 1 month ago

Can confirm this bug:

image

Incidentally, since it took me a second to find them, here are the settings on the Import dialog needed to recreate the crash:

image