1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-03 16:55:53 +00:00

Merge pull request #112729 from KoBeWi/multi_group_yoink

Edit groups on multiple nodes
This commit is contained in:
Thaddeus Crews
2025-11-20 16:47:07 -06:00
8 changed files with 154 additions and 89 deletions

View File

@@ -2888,7 +2888,7 @@ void EditorNode::push_node_item(Node *p_node) {
void EditorNode::push_item(Object *p_object, const String &p_property, bool p_inspector_only) {
if (!p_object) {
InspectorDock::get_inspector_singleton()->edit(nullptr);
NodeDock::get_singleton()->set_object(nullptr);
NodeDock::get_singleton()->set_selection(Vector<Object *>());
SceneTreeDock::get_singleton()->set_selected(nullptr);
InspectorDock::get_singleton()->update(nullptr);
hide_unused_editors();
@@ -2999,7 +2999,7 @@ void EditorNode::_edit_current(bool p_skip_foreign, bool p_skip_inspector_update
if (!current_obj) {
SceneTreeDock::get_singleton()->set_selected(nullptr);
InspectorDock::get_inspector_singleton()->edit(nullptr);
NodeDock::get_singleton()->set_object(nullptr);
NodeDock::get_singleton()->set_selection(Vector<Object *>());
InspectorDock::get_singleton()->update(nullptr);
EditorDebuggerNode::get_singleton()->clear_remote_tree_selection();
hide_unused_editors();
@@ -3033,7 +3033,7 @@ void EditorNode::_edit_current(bool p_skip_foreign, bool p_skip_inspector_update
if (!p_skip_inspector_update) {
InspectorDock::get_inspector_singleton()->edit(current_res);
SceneTreeDock::get_singleton()->set_selected(nullptr);
NodeDock::get_singleton()->set_object(current_res);
NodeDock::get_singleton()->set_selection(Vector<Object *>{ current_res });
InspectorDock::get_singleton()->update(nullptr);
EditorDebuggerNode::get_singleton()->clear_remote_tree_selection();
ImportDock::get_singleton()->set_edit_path(current_res->get_path());
@@ -3063,7 +3063,7 @@ void EditorNode::_edit_current(bool p_skip_foreign, bool p_skip_inspector_update
InspectorDock::get_inspector_singleton()->edit(current_node);
if (current_node->is_inside_tree()) {
NodeDock::get_singleton()->set_object(current_node);
NodeDock::get_singleton()->set_selection(Vector<Object *>{ current_node });
SceneTreeDock::get_singleton()->set_selected(current_node);
SceneTreeDock::get_singleton()->set_selection({ current_node });
InspectorDock::get_singleton()->update(current_node);
@@ -3075,7 +3075,7 @@ void EditorNode::_edit_current(bool p_skip_foreign, bool p_skip_inspector_update
}
}
} else {
NodeDock::get_singleton()->set_object(nullptr);
NodeDock::get_singleton()->set_selection(Vector<Object *>());
SceneTreeDock::get_singleton()->set_selected(nullptr);
InspectorDock::get_singleton()->update(nullptr);
}
@@ -3122,8 +3122,15 @@ void EditorNode::_edit_current(bool p_skip_foreign, bool p_skip_inspector_update
EditorDebuggerNode::get_singleton()->clear_remote_tree_selection();
}
// TODO: This can be replaced by some casting operator.
Vector<Object *> nodes_as_objects;
nodes_as_objects.reserve_exact(multi_nodes.size());
for (Node *n : multi_nodes) {
nodes_as_objects.append(n);
}
InspectorDock::get_inspector_singleton()->edit(current_obj);
NodeDock::get_singleton()->set_object(nullptr);
NodeDock::get_singleton()->set_selection(nodes_as_objects);
SceneTreeDock::get_singleton()->set_selected(selected_node);
SceneTreeDock::get_singleton()->set_selection(multi_nodes);
InspectorDock::get_singleton()->update(nullptr);