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

Export variables on base class do not update in inspector of node with child class script #73390

Open
hsandt opened this issue Feb 15, 2023 · 3 comments

Comments

@hsandt
Copy link
Contributor

hsandt commented Feb 15, 2023

Godot version

v4.0.rc1.official [8843d9a]

System information

Linux Ubuntu 20.04 with Unity desktop

Issue description

Exported variables defined in some base class script are serialized in nodes using a script whose class inherits from the base class too.

However, such serialized fields are not updated in the inspector: when adding, removing or renaming exported vars on the base class script, nodes with child class script do not show any field changes in the inspector.

This only happens when the script is a child class, and the exported var is on the base class. If the script is the base class itself, or we change exported var on the child class, the inspector updates appropriately.

Workaround: restart the editor

Note: unlike #70217, this affects the whole fields, not just the tooltip

Steps to reproduce

  1. Open repro project demo scene
  2. Select "Node2D with Child Script" in the inspector
  3. Open BaseClass.gd in code editor
  4. Comment out base_field2 declaration, add base_field3 or rename any existing field
  5. Check both nodes in the inspector
    Expected: both reflect the field changes
    Actual: only "Node2D with Base Script" updates properly. The one with child script shows the old fields.

image

You can continue changing ChildClass fields too, but those should work normally.

You can also restart the editor to confirm the changes.

Minimal reproduction project

v4.0.rc1 - Base class exported vars do not update on child class node.zip

@hsandt
Copy link
Contributor Author

hsandt commented Feb 19, 2023

A side effect for @export var node: NodeClass is that when NodeClass changes, the node reference popup does not update and still shows matching types for the old types. In the extreme case where the class was removed or didn't compile properly at first, no node can be selected (until restart).

@hsandt
Copy link
Contributor Author

hsandt commented Feb 1, 2024

Today, I tried to just close the scene containing the node and reopen it to avoid rebooting the whole Godot editor, but the node with child class script just stopped showing the base class properties altogether! So I had to reboot the editor anyway in the end.

It must be a related bug, will probably be fixed if we fix instant refresh of child class node inspector.

@Sebauxs
Copy link

Sebauxs commented Aug 19, 2024

This is happening to me, so annoying :C

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

3 participants