[Bf-blender-cvs] [a37dceb139e] master: Cleanup: replace commented code with define check

Campbell Barton noreply at git.blender.org
Wed Mar 4 01:09:45 CET 2020


Commit: a37dceb139eb64e00af8c1a79c49f31f42479bdd
Author: Campbell Barton
Date:   Wed Mar 4 10:56:56 2020 +1100
Branches: master
https://developer.blender.org/rBa37dceb139eb64e00af8c1a79c49f31f42479bdd

Cleanup: replace commented code with define check

Avoids duplicated comments,
also quiet warning accessing non-existing variable.

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

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

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

diff --git a/source/blender/editors/object/object_remesh.c b/source/blender/editors/object/object_remesh.c
index 742c9c77542..4454af5a096 100644
--- a/source/blender/editors/object/object_remesh.c
+++ b/source/blender/editors/object/object_remesh.c
@@ -74,6 +74,9 @@
 
 #include "object_intern.h"  // own include
 
+/* TODO(sebpa): unstable, can lead to unrecoverable errors. */
+// #define USE_MESH_CURVATURE
+
 static bool object_remesh_poll(bContext *C)
 {
   Object *ob = CTX_data_active_object(C);
@@ -405,8 +408,12 @@ static void quadriflow_start_job(void *customdata, short *stop, short *do_update
       qj->target_faces,
       qj->seed,
       qj->use_preserve_sharp,
-      qj->use_preserve_boundary || qj->use_paint_symmetry,
-      false,  // TODO unstable, can lead to uncoverable errors (sebpa) qj->use_mesh_curvature,
+      (qj->use_preserve_boundary || qj->use_paint_symmetry),
+#ifdef USE_MESH_CURVATURE
+      qj->use_mesh_curvature,
+#else
+      false,
+#endif
       quadriflow_update_job,
       (void *)qj);
 
@@ -416,7 +423,7 @@ static void quadriflow_start_job(void *customdata, short *stop, short *do_update
     *do_update = true;
     *stop = 0;
     if (qj->success == 1) {
-      /* This is not a user cancelation event */
+      /* This is not a user cancellation event. */
       qj->success = 0;
     }
     return;
@@ -497,7 +504,9 @@ static int quadriflow_remesh_exec(bContext *C, wmOperator *op)
   job->use_preserve_sharp = RNA_boolean_get(op->ptr, "use_preserve_sharp");
   job->use_preserve_boundary = RNA_boolean_get(op->ptr, "use_preserve_boundary");
 
+#ifdef USE_MESH_CURVATURE
   job->use_mesh_curvature = RNA_boolean_get(op->ptr, "use_mesh_curvature");
+#endif
 
   job->preserve_paint_mask = RNA_boolean_get(op->ptr, "preserve_paint_mask");
   job->smooth_normals = RNA_boolean_get(op->ptr, "smooth_normals");
@@ -671,13 +680,13 @@ void OBJECT_OT_quadriflow_remesh(wmOperatorType *ot)
                   false,
                   "Preserve Mesh Boundary",
                   "Try to preserve mesh boundary on the mesh");
-  /* TODO unstable, can lead to uncoverable errors (sebpa)
+#ifdef USE_MESH_CURVATURE
   RNA_def_boolean(ot->srna,
                   "use_mesh_curvature",
                   false,
                   "Use Mesh Curvature",
                   "Take the mesh curvature into account when remeshing");
-  */
+#endif
   RNA_def_boolean(ot->srna,
                   "preserve_paint_mask",
                   false,



More information about the Bf-blender-cvs mailing list