godot: Inherited export variables from a registered class don't show up in node inspector
Bugsquad note: This issue has been confirmed several times already. No need to confirm it further.
Godot version: Godot 3.1 Alpha
OS/device including version: Mac OSX Sierra 10.12.6
Issue description: Suppose you have a base class in GDScript.
# res://base.gd
extends Node2D
class_name Base
export(int) var number : int
(1) You can extend by using the path to the .gd script:
# res://inherited.gd
extends "res://base.gd"
(2) You can extend by using the registered class name:
# res://inherited.gd
extends Base
in case two the export variable number from Base does not appear in the inspector.
Steps to reproduce:
- Create a new Godot project with an empty scene.
- Add a Node of any kind and give it a script, say “res://base.gd”
- Give “res://base.gd” an export variable and register its class name
- Create a new Node that extends from “res://base.gd” but uses the class name instead of the gdscript path
- The export variable inside “res://base.gd” does not show up in the inherited node inspector
Minimal reproduction project: class_name_export_bug.zip
About this issue
- Original URL
- State: open
- Created 6 years ago
- Reactions: 18
- Comments: 33 (10 by maintainers)
This is still happening in 4.1.stable. After reloading the project, the export variables appear now, though. I’ve tried it using both with extending the class_name as well as extending the the “res://…gd” script.
This problem still exists on Godot 3.2.3.
@gameoflord012 Godot is developed largely by volunteers, and we have a huge backlog of reports and features to work on as it is. It will be fixed in due time, but please avoid posting entitled comments like that. Consider leaving an upvote on the issue itself to give it more visibility.
Hi ! I found that the export var in the base class would appear if I reload scene (Scene -> reload saved scene) OR write any thing in the inherited script. Still, auto refresh might be more desirable…
Still present in godot 4
Still present in 3.5.1 stable. After reopening the entire project, the export variables start to appear in the inspector.
The OP’s script has errors when opened in Godot 4, so obviously the variables will not appear until you fix it. Then it’s safe to assume that this “bug” only occurs when a script is invalid, which is expected. The editor can’t determine variables if the script can’t be loaded.
Same issue in v.4.1.2.
I just reproduced this issue in 3.3.4 stable.
Restarting the editor fixed the issue and now the parent script variables are shown in their children nodes, both using the parent class name or the parent file path.
I’ve also tested the provided sample project and the children nodes show the parent exported var as expected.
@akyoto If you can reproduce it, please provide a project and exact steps that demonstrate the issue. As stated above, we don’t really have much luck reproducing it.
This is updated project from the OP: class_name_export_bug.zip The issue is not present in 4.1 rc.
@H0nney Please provide a minimal reproduction project.