From becc98162e533bc7f34088c60c8f2bcf801f0d7b Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Mon, 20 May 2024 15:56:16 +0800 Subject: [PATCH] Fix error when duplicating visual shader node inside a Frame --- editor/plugins/visual_shader_editor_plugin.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index 01551a52c2d..438d7981200 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -60,7 +60,6 @@ #include "scene/gui/view_panner.h" #include "scene/main/window.h" #include "scene/resources/curve_texture.h" -#include "scene/resources/image_texture.h" #include "scene/resources/style_box_flat.h" #include "scene/resources/visual_shader_nodes.h" #include "scene/resources/visual_shader_particle_nodes.h" @@ -5135,7 +5134,7 @@ void VisualShaderEditor::_dup_paste_nodes(int p_type, List &r_items, c } int new_node_id = connection_remap[item.id]; - int new_frame_id = connection_remap[node->get_frame()]; + int new_frame_id = node->get_frame(); undo_redo->add_do_method(visual_shader.ptr(), "attach_node_to_frame", type, new_node_id, new_frame_id); undo_redo->add_do_method(graph_plugin.ptr(), "attach_node_to_frame", type, new_node_id, new_frame_id); }