Zylann / godot_voxel

Voxel module for Godot Engine
MIT License
2.72k stars 251 forks source link

Editor Crash When using ArrayMesh/PointMesh on the VoxelBockyModelMesh #578

Closed EarthDLL closed 1 year ago

EarthDLL commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Build:https://github.com/EarthDLL/godot_voxel/actions/runs/6836074952

Steps to reproduce the behavior:

  1. Create a VoxelBlockyModelMesh
  2. Create a ArrayMesh and use Script to add surface to the Mesh(Empty ArrayMesh will not cause crashing)
  3. Adding ArrayMesh to BockyModelMesh or creating a new pointMesh directly can cause a crash

Screenshots I8T3SSVGAND)CDCZVFD%EGL https://github.com/Zylann/godot_voxel/assets/100025289/b2920f63-52f2-4e48-abca-100ca1555135 Cache_641d8def88211970 Cache_-431f1dce4b52d356

https://github.com/Zylann/godot_voxel/assets/100025289/78e9b0a4-85bc-47d1-8893-5f93393c3b83

Environment

Zylann commented 1 year ago

Meshes made only of vertices (and no UVs, no normals, no indices) are not supported. It must also be triangles. It should not crash though, instead it should show an error. That should be fixed.

Note, please don't post screenshots of code. It prevents me from copying it to try it. Ideally, post a minimal reproduction project.

Zylann commented 1 year ago

Added more checks in 67a6f0c65c8754a5b740fc5aef8e511967aa875d so it should no longer crash.

EarthDLL commented 1 year ago

Thanks