Open Xyotic opened 1 year ago
Is there a workaround for now that doesnt include the use of 'clear_surfaces'? @Calinou
Seconding, I was using this for some very simple deformations and had to give up on those in 4.0
Removing surfaces also seems to be missing from RenderingServer3D. So this server cant be used as a workaround.
This makes it difficult to add surfaces to a mesh without it. Sure you can clear all the surfaces, but if you are relying on the previous surfaces to generate new surfaces, you don't want to clear them all when you need to add each one separately.. :( I'm using MeshDataTool's create_from_surface(mesh, 0).. then commit the surface back into the mesh(while removing the original). So I need to do each surface at a time and I can't do it if I clear the surfaces, because then it just clears ones that I've added.
Edit: Okay, so a workaround I found., I am duplicating the mesh, and refering to the duplicated mesh's surfaces while I clear the original mesh's surfaces. This makes things more bearable. I just clear all the surfaces once, and then create the new surfaces from the duplicated mesh that I've stored at the start.
I don't know if someone started some work on it, but I started to (re)implement this function and I should be able to make a PR next week for both OpenGL and Vulkan renderers.
I hope this gets in eventually
Godot version
4.0 beta 1
System information
Windows 10, Nvidia RTX2080
Issue description
In 4.0, ArrayMesh is missing the 'surface_remove' method and there doenst seem to be an alternative. Accessing the surface array directly and removing an entry also doesnt seem to work. Currently the only way is to use 'clear_surfaces'. Which I think would have a negative performance impact if you'd always clear all surfaces and set new ones. In 3.x 'surface_remove' is still present.
Steps to reproduce
Add a surface to an ArrayMesh via 'add_surface_from_arrays' and try to remove it.
Minimal reproduction project
No response