[Bf-blender-cvs] [2b32296e178] sculpt-mode-features: Fix crash on remesh operator with a multi user mesh data.

Pablo Dobarro noreply at git.blender.org
Sun Apr 28 18:53:28 CEST 2019


Commit: 2b32296e178262109f3d927a60b9068c8d632cc2
Author: Pablo Dobarro
Date:   Sun Apr 28 18:53:05 2019 +0200
Branches: sculpt-mode-features
https://developer.blender.org/rB2b32296e178262109f3d927a60b9068c8d632cc2

Fix crash on remesh operator with a multi user mesh data.

I also added some error messages.

===================================================================

M	source/blender/editors/object/object_edit.c

===================================================================

diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index 2cd870cfb24..122bd9208ee 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -1807,6 +1807,17 @@ static int remesh_exec(bContext *C, wmOperator *op)
     linked_data = true;
     return OPERATOR_CANCELLED;
   }
+
+  if (ID_REAL_USERS(data) != 1) {
+    BKE_report(op->reports, RPT_ERROR, "Remesh cannot run on mesh data with multiple users");
+    return OPERATOR_CANCELLED;
+  }
+
+  if (BKE_object_is_in_editmode(ob)) {
+    BKE_report(op->reports, RPT_ERROR, "Remesh cannot run from edit mode");
+    return OPERATOR_CANCELLED;
+  }
+
   if (ob->type == OB_MESH) {
     Mesh *mesh = ob->data;
     Mesh *newMesh;



More information about the Bf-blender-cvs mailing list