GodotVR / godot_openxr_vendors

Godot 4 wrapper for OpenXR vendors loaders and extensions
MIT License
90 stars 19 forks source link

Creating mesh crashes with MeshDataTool #65

Closed aahmyu closed 8 months ago

aahmyu commented 8 months ago

Hello,

I'm trying to use this plugin to slice meshes in VR: https://github.com/PiCode9560/Godot-4-Concave-Mesh-Slicer This works fine on 2d screen, but in VR it breaks.

In logcat I found this:

12-07 21:21:49.449  9978 16260 E godot   : USER ERROR: Index r[i] = 48896 is out of bounds (vcount = 24).
12-07 21:21:49.449  9978 16260 E godot   :    at: create_from_surface (scene/resources/mesh_data_tool.cpp:73)

To reproduce with minimal code:

var mdt = MeshDataTool.new() 
var mesh: Mesh = rigid_body.mesh
var new_array_mesh = ArrayMesh.new()
new_array_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, mesh.surface_get_arrays(0))
mdt.create_from_surface(new_array_mesh , 0)

The rigid body is just a node with a meshinstace 3d with a box shape.

I'm using Godot 4.2 and a Pico 4 VR headset.

Any help would be appricated.

Regards

aahmyu commented 8 months ago

The issue is fixed in Godot 4.2.1 rc.