summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-02-22 10:13:13 +0100
committerRémi Verschelde <rverschelde@gmail.com>2023-02-22 10:13:13 +0100
commitc86f18698e42a55d763e164f9ceeedc6c915aa45 (patch)
tree253014e8402028fdb4dd3169c7b7b24f110afe0a
parente0cba314b9883e4874fab3643f3c075da4c1778c (diff)
parentf3040be3ba4ac42606a3f37a9a8af7444bc8979b (diff)
Merge pull request #73726 from KoBeWi/parenting_problems
Fix Polygon3DEditor parenting errors
-rw-r--r--editor/plugins/polygon_3d_editor_plugin.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/editor/plugins/polygon_3d_editor_plugin.cpp b/editor/plugins/polygon_3d_editor_plugin.cpp
index 9defb4de9b..f4d97a5427 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;