godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
89.86k stars 20.99k forks source link

Parser Error: Native class "EditorSpinSlider" cannot be constructed as it is abstract. #93854

Closed MikeSchulze closed 3 months ago

MikeSchulze commented 3 months ago

Tested versions

v4.3.beta2.mono.official [b75f0485b]

System information

Windows 11

Issue description

I'm working on a new plugin to build by procedural nodes via visual scripting and build my own custom graph nodes. As example: image

To have the same Look&Feel I rebuild the property editors used by the Godot editor inspector. (The original property editors are not public, but why?)

I used the Godot provided class EditorSpinSlider And it works fine, so far so good.

But i have a unit test coverage and it fails when loading my ui components by error

Parser Error: Native class "EditorSpinSlider" cannot be constructed as it is abstract.

From the documentation, it is not abstract. This blocks me actually to develop and test the scene and often needs a restart of the Godot editor. It also blocks me to write unit tests because the scene is loaded via a test API and not instantiated by a plugin.

Steps to reproduce

Use the attached example plugin. When the project opened, it shows the example in the bottom. image

The scene is loaded and the custom panel using the EditorSpinSlider works fine. But when you try to run the panel scene itself, it fails with the error. Parser Error: Native class "EditorSpinSlider" cannot be constructed as it is abstract. image

This makes it impossible to test the scene manually or by a testing framework.

Minimal reproduction project (MRP)

EditorSpinSlider.zip

alvinhochun commented 3 months ago

Correct me if I'm wrong, but I think it's because EditorSpinSlider, being an editor control, is only available when running inside the editor, so they cannot be constructed when running the scene as a game.

Probably the same issue as #73525.

MikeSchulze commented 3 months ago

Correct me if I'm wrong, but I think it's because EditorSpinSlider, being an editor control, is only available when running inside the editor, so they cannot be constructed when running the scene as a game.

Yes is described as editor control, but creating a scene and running it for testing makes it impossible if it is recognized as abstract.

AThousandShips commented 3 months ago

Consolidating in: