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

change editor description of a child scene causing multiple open in editor buttons in the Scene tab #96567

Closed
conradax opened this issue Sep 4, 2024 · 6 comments · Fixed by #96569

Comments

@conradax
Copy link

conradax commented Sep 4, 2024

Tested versions

Godot V4.4 dev1.official
Godot V4.4 dev[906a4e9]

System information

Godot v4.4.dev1 - Windows 10.0.19045 - Vulkan (Forward+) - dedicated Radeon RX 590 Series (Advanced Micro Devices, Inc.; 31.0.21905.1001) - Intel(R) Core(TM) i5-9400F CPU @ 2.90GHz (6 Threads)

Issue description

In editor's Scene tab, a node of instanced scene has a button "open in editor"

What's wrong: there will be multiple "open in editor" buttons after changing the "editor description" of an instanced scene.

What's expected: there should be only one "open in editor" button and it already exists

P.S. I found this when i'm poking a instanced .glb scene's editor description.

Steps to reproduce

  1. create a scene
  2. create another scene
  3. add one scene into another
  4. change instanced scene node's editor description
Godot_v4.4dev1_EditorSceneTreeBug.mp4

Minimal reproduction project (MRP)

N/A

@Giganzo
Copy link
Contributor

Giganzo commented Sep 4, 2024

Can reproduce it in v4.3.stable too

@AThousandShips
Copy link
Member

I've identified the code responsible for this, will take a look at fixing it

@Giganzo
Copy link
Contributor

Giganzo commented Sep 4, 2024

I've identified the code responsible for this, will take a look at fixing it

Nice! Is it #82916?

@AThousandShips
Copy link
Member

That's indeed the PR that introduced it, thank you for finding it!

@bikemurt
Copy link
Contributor

bikemurt commented Sep 4, 2024

Someone else will probably beat me to it, but here is what I found:

p_item->add_button(0, get_editor_theme_icon(SNAME("InstanceOptions")), BUTTON_SUBSCENE, false, TTR("Open in Editor"));

We are adding the "Open in Editor" button every time the scene tree node tooltip is updated (signal gets emitted from the UI for description, in this case).

This is only for inherited scenes or if can_open_instance is true - not sure what that would signify yet.

So there should be a way to check if p_item already has an "open in editor" button, and only add it if it is missing.

@AThousandShips
Copy link
Member

Indeed, see the fix above :)

@akien-mga akien-mga added this to the 4.4 milestone Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants