From f3040be3ba4ac42606a3f37a9a8af7444bc8979b Mon Sep 17 00:00:00 2001 From: kobewi Date: Wed, 22 Feb 2023 03:17:29 +0100 Subject: [PATCH] Fix Polygon3DEditor parenting errors --- editor/plugins/polygon_3d_editor_plugin.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/editor/plugins/polygon_3d_editor_plugin.cpp b/editor/plugins/polygon_3d_editor_plugin.cpp index 9defb4de9ba..f4d97a5427e 100644 --- a/editor/plugins/polygon_3d_editor_plugin.cpp +++ b/editor/plugins/polygon_3d_editor_plugin.cpp @@ -506,7 +506,11 @@ void Polygon3DEditor::edit(Node *p_node) { wip.clear(); wip_active = false; edited_point = -1; - p_node->add_child(imgeom); + if (imgeom->get_parent()) { + imgeom->reparent(p_node, false); + } else { + p_node->add_child(imgeom); + } _polygon_draw(); set_process(true); prev_depth = -1;