Parcourir la source

Fix Polygon3DEditor parenting errors

kobewi il y a 2 ans
Parent
commit
f3040be3ba
1 fichiers modifiés avec 5 ajouts et 1 suppressions
  1. 5 1
      editor/plugins/polygon_3d_editor_plugin.cpp

+ 5 - 1
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;