Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It's possible to create abstract resource classes using the inspector (e.g. Mesh or PrimitiveMesh in MeshInstance3D) #59605

Open
Calinou opened this issue Mar 27, 2022 · 2 comments

Comments

@Calinou
Copy link
Member

Calinou commented Mar 27, 2022

Godot version

4.0.alpha (a007102)

System information

Fedora 34, GeForce GTX 1080 (NVIDIA 495.46)

Issue description

Since #58972 was merged, it's now possible to create abstract resource classes using the inspector:

image

These abstract classes should probably be hidden again, as it's confusing (and may cause crashes on instantiation for specific resources).

Steps to reproduce

  • Add a MeshInstance3D node.
  • Add a Mesh or PrimitiveMesh resource to the Mesh property of the MeshInstance3D node.
  • Notice error spam after adding a Mesh or PrimitiveMesh resource:

Example with Mesh

ERROR: Required virtual method: Mesh::_get_surface_count must be overriden before calling.
   at: _gdvirtual__get_surface_count_call (scene/resources/mesh.h:61)
ERROR: Required virtual method: Mesh::_get_blend_shape_count must be overriden before calling.
   at: _gdvirtual__get_blend_shape_count_call (scene/resources/mesh.h:71)
ERROR: Required virtual method: Mesh::_get_aabb must be overriden before calling.
   at: _gdvirtual__get_aabb_call (scene/resources/mesh.h:74)

Example with PrimitiveMesh

ERROR: _create_mesh_array must return at least a vertex array.
   at: _update (scene/resources/primitive_meshes.cpp:48)

Minimal reproduction project

N/A

@Calinou Calinou added this to the 4.0 milestone Mar 27, 2022
@Calinou Calinou changed the title It's possible to create abstract resource classes using the inspector (Mesh or PrimitiveMesh in MeshInstance3D) It's possible to create abstract resource classes using the inspector (e.g. Mesh or PrimitiveMesh in MeshInstance3D) Mar 27, 2022
@KoBeWi KoBeWi removed this from the 4.0 milestone Apr 24, 2022
@hmans
Copy link

hmans commented Mar 9, 2023

This also happens when you create a custom resource class that a bunch of other classes inherit. For example, I have a base ColorSource class inheriting from Resource, and a couple of different child classes that each implements a different way to determine a color (for a shader; but that doesn't matter.)

In another class, I have a @export var color_source : ColorSource, and the resource dropdown in the inspector correctly presents all child classes inheriting from ColorSource, but also ColorSource itself. I'd love to be able to mark it as abstract, or otherwise hide it.

Not the most critical of issues, but maybe it can be re-assigned to one of the upcoming milestones for visibility?

@poirierlouis
Copy link

poirierlouis commented May 24, 2023

In 4.0.3-stable (5222a99), looking at inspector does not show PrimitiveMesh (please ignore WireframeBoxMesh and TestMesh as they are custom implementation):
2023-05-24_godot_issue_abstract-resource-inspector

However, at least the following error is still present in Output (here due to TestMesh GDScript declaration):

ERROR: _create_mesh_array must return at least a vertex array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants