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

Adding / Removing nodes to EditorSelection does not refresh Inspector (after 3.2.4 rc3) #46821

Closed
koodikulma-fi opened this issue Mar 9, 2021 · 6 comments · Fixed by #47709
Closed

Comments

@koodikulma-fi
Copy link

koodikulma-fi commented Mar 9, 2021

Godot version:
Godot 3.2.4 rc3 and rc4

OS/device including version:
Windows 10

Issue description:
When adding nodes to selection (or removing them) via EditorSelection, the Inspector panel no longer gets refreshed - however the SceneTree is refreshed properly. It now only gets refreshed when the user selects / removes nodes as opposed to selecting from within a tool script. (Could not find a way to manually refresh the Inspector.)

Steps to reproduce:
Follow the minimal reproduction project. Below are general steps:

  1. First get the EditorSelection instance from EditorInterface instance (from an EditorPlugin instance). Eg. EditorPlugin.new().get_editor_interface().get_selection()
  2. Then call .add_node(my_node) or .clear() to do the changes to the selection.
  3. Observe the result: SceneTree is updated, but Inspector is not. (Does not help to emit selection_changed from EditorSelection instance.)

Minimal reproduction project:
LazyInspector.zip

@KoBeWi
Copy link
Member

KoBeWi commented Mar 13, 2021

Might be another consequence of #32908

@akien-mga akien-mga modified the milestones: 3.2, 3.3 Mar 17, 2021
@akien-mga
Copy link
Member

Might be another consequence of #32908

CC @Nehluxhes

@KoBeWi
Copy link
Member

KoBeWi commented Mar 30, 2021

After looking into it, I think this is not a bug. Before ##32908, any selection change would cause a cascade of calls that would edit every selected node. Now nodes need to be edited (i.e. opened in the inspector) explicitly.

EditorNode has a method called push_item, but it's not exposed. Not sure if there is a way to push something to edit in the inspector. We should add/expose such method and properly document that users have to manually edit the nodes added to selection.

@nonfinity
Copy link

@KoBeWi I am able to push things to the editor with this inspect_object() call. Is that what you are talking about?

https://docs.godotengine.org/en/stable/classes/class_editorinterface.html#class-editorinterface-method-inspect-object

@koodikulma-fi
Copy link
Author

koodikulma-fi commented Apr 10, 2021

Thanks! I had only used inspect_object for resources and selection for nodes, didn't realize inspecting works for nodes, and this is (now) intended behaviour - not a bug. So, for anyone with similar tool helpers: from 3.2.4 5c3 onwards should call EditorInterface.inspect_object(node) after calling EditorSelection.add_node(node) or EditorSelection.clear() to "refresh inspector".

@koodikulma-fi
Copy link
Author

Btw. Any idea how to refresh the inspector to view multiple (selected) nodes ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants