godotengine / godotengine/godot

Custom nodes don't have their parents' icon

Open
#90,367 2 comments 6 reactions 0 assignees View on GitHub
discussion topic:editor topic:gdextension
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

- Reproducible in v4.2.1.stable.official [b09f793f5]

### System information

Windows 11 - Godot v4.2.1.stable

### Issue description

Custom nodes made in C++ have the node's icon instead of the parent's node icon.

According to the documentation when a new class is created and exposed to scripting, the editor's interface will display it with a default icon representing the base class it inherits from. This seems to be not the case.

Example of C++ code:
``` C++
using BasePanelContainer = godot::PanelContainer;

class ChartPanel: public BasePanelContainer
{
GDCLASS(ChartPanel, BasePanelContainer)
```

The icon in the editor is wrong either in the "create new node" window or in the "scene tree":
![image](https://github.com/godotengine/godot/assets/18684872/aa8ce035-6df1-4190-8d7a-5505b4284a09)

### Steps to reproduce

- Create a C++ class inherited from godot::PanelContainer
- Add the created node in a scene

### Minimal reproduction project (MRP)

N/A

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.