You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe a workaround is to use ArrayMesh, so the mesh is created internally but you still have ability to procedurally generate it? The downside though, is that if you save that resource, it will also save vertex data, which may not be desired if your mesh is procedural I guess.
I think if this function needs to be virtual to allow creating custom meshes, that would be a feature to request in Godot's API rather than GodotCpp?
Maybe a workaround is to use ArrayMesh, so the mesh is created internally but you still have ability to procedurally generate it?
I think if this function needs to be virtual to allow creating custom meshes, that would be a feature to request in Godot's API rather than GodotCpp?
Although it's possible that get_rid doesnt actually need to be virtual, because unless you create a new kind of mesh (which would however require to also modify RenderingServer to make it handle it), such mesh would still be made of vertex arrays.
ArrayMesh, BoxMesh, SphereMesh etc all use the same kind of mesh RID. The only difference is the API on the resource classes. The advantage of using Mesh over ArrayMesh would then be that mesh data would never get saved, since your code would have to provide it every time in some way. ArrayMesh would work too, but would save the data unnecessarily.
Maybe a workaround is to use ArrayMesh, so the mesh is created internally but you still have ability to procedurally generate it? The downside though, is that if you save that resource, it will also save vertex data, which may not be desired if your mesh is procedural I guess.
I think if this function needs to be virtual to allow creating custom meshes, that would be a feature to request in Godot's API rather than GodotCpp?
I still think it being virtual would be nice, but I could resolve my issue by extending ArrayMesh and generating at the _set call. Thanks!
Activity
MGilleronFJ commentedon Sep 30, 2022
Maybe a workaround is to use
ArrayMesh, so the mesh is created internally but you still have ability to procedurally generate it? The downside though, is that if you save that resource, it will also save vertex data, which may not be desired if your mesh is procedural I guess.I think if this function needs to be virtual to allow creating custom meshes, that would be a feature to request in Godot's API rather than GodotCpp?
tefusion commentedon Sep 30, 2022
Thanks I'll look into that. The mesh in question is https://github.com/tefusion/godot-subdiv/blob/1f0b170114c6a577af5249f093bba7471b4ca277/src/resources/baked_subdiv_mesh.cpp which does generates data compatible with ArrayMesh, I just think doing that will require a hacky looking and more expensive solution. Also the function is already virtual and usable with modules and just not in the generated extension API.
I'll open a seperate issue in Godot core, cause you're right changes need to be done there, just didn't know where to open GDExtension issues.
tefusion commentedon Oct 2, 2022
I still think it being virtual would be nice, but I could resolve my issue by extending ArrayMesh and generating at the _set call. Thanks!