Skip to content

Commit

Permalink
Select nodes on drag and drop in 3D viewport
Browse files Browse the repository at this point in the history
  • Loading branch information
viksl committed Feb 2, 2024
1 parent 10e1114 commit 93334eb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion editor/plugins/node_3d_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4353,6 +4353,7 @@ bool Node3DEditorViewport::_create_instance(Node *parent, String &path, const Po
undo_redo->add_do_method(instantiated_scene, "set_owner", EditorNode::get_singleton()->get_edited_scene());
undo_redo->add_do_reference(instantiated_scene);
undo_redo->add_undo_method(parent, "remove_child", instantiated_scene);
undo_redo->add_do_method(editor_selection, "add_node", instantiated_scene);

String new_name = parent->validate_child_name(instantiated_scene);
EditorDebuggerNode *ed = EditorDebuggerNode::get_singleton();
Expand Down Expand Up @@ -4401,7 +4402,8 @@ void Node3DEditorViewport::_perform_drop_data() {

Vector<String> error_files;

undo_redo->create_action(TTR("Create Node"));
undo_redo->create_action(TTR("Create Node"), UndoRedo::MERGE_DISABLE, target_node);
undo_redo->add_do_method(editor_selection, "clear");

for (int i = 0; i < selected_files.size(); i++) {
String path = selected_files[i];
Expand Down

0 comments on commit 93334eb

Please sign in to comment.