[Bf-blender-cvs] [c32f291e753] quadriflow: Clearify "adaptive scale" setting and some other minor cleanup

Sebastian Parborg noreply at git.blender.org
Wed Sep 11 17:32:05 CEST 2019


Commit: c32f291e753b70556bd0dbfdcc1792867d97ff63
Author: Sebastian Parborg
Date:   Wed Sep 11 17:32:13 2019 +0200
Branches: quadriflow
https://developer.blender.org/rBc32f291e753b70556bd0dbfdcc1792867d97ff63

Clearify "adaptive scale" setting and some other minor cleanup

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

M	source/blender/editors/object/object_remesh.c
M	source/blender/makesdna/DNA_mesh_types.h
M	source/blender/makesrna/intern/rna_mesh.c

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

diff --git a/source/blender/editors/object/object_remesh.c b/source/blender/editors/object/object_remesh.c
index a2615ffb660..96356540d83 100644
--- a/source/blender/editors/object/object_remesh.c
+++ b/source/blender/editors/object/object_remesh.c
@@ -173,7 +173,7 @@ typedef struct QuadriFlowJob {
   int seed;
   bool use_preserve_sharp;
   bool use_preserve_boundary;
-  bool use_adaptive_scale;
+  bool use_mesh_curvature;
 
   bool preserve_paint_mask;
   bool smooth_normals;
@@ -241,7 +241,7 @@ static void quadriflow_start_job(void *customdata, short *stop, short *do_update
                                                        qj->seed,
                                                        qj->use_preserve_sharp,
                                                        qj->use_preserve_boundary,
-                                                       qj->use_adaptive_scale,
+                                                       qj->use_mesh_curvature,
                                                        quadriflow_update_job,
                                                        (void *)qj);
 
@@ -314,43 +314,6 @@ static void quadriflow_end_job(void *customdata)
 
 static int quadriflow_remesh_exec(bContext *C, wmOperator *op)
 {
-  /*
-  new_mesh = BKE_mesh_remesh_quadriflow_to_mesh_nomain(
-      mesh, target_faces, seed, use_preserve_sharp, use_preserve_boundary, use_adaptive_scale);
-
-  if (!new_mesh) {
-    return OPERATOR_CANCELLED;
-  }
-
-  Mesh *obj_mesh_copy = NULL;
-  if (preserve_paint_mask) {
-    obj_mesh_copy = BKE_mesh_new_nomain_from_template(mesh, mesh->totvert, 0, 0, 0, 0);
-    CustomData_copy(
-        &mesh->vdata, &obj_mesh_copy->vdata, CD_MASK_MESH.vmask, CD_DUPLICATE, mesh->totvert);
-    for (int i = 0; i < mesh->totvert; i++) {
-      copy_v3_v3(obj_mesh_copy->mvert[i].co, mesh->mvert[i].co);
-    }
-  }
-
-  BKE_mesh_nomain_to_mesh(new_mesh, mesh, ob, &CD_MASK_MESH, true);
-
-  if (preserve_paint_mask) {
-    BKE_remesh_reproject_paint_mask(mesh, obj_mesh_copy);
-    BKE_mesh_free(obj_mesh_copy);
-  }
-
-  if (smooth_normals) {
-    BKE_mesh_smooth_flag_set(ob->data, true);
-  }
-
-  if (ob->mode == OB_MODE_SCULPT) {
-    ED_sculpt_undo_geometry_end(ob);
-  }
-
-  BKE_mesh_batch_cache_dirty_tag(ob->data, BKE_MESH_BATCH_DIRTY_ALL);
-  DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
-  WM_event_add_notifier(C, NC_GEOM | ND_DATA, ob->data);
-  */
   QuadriFlowJob *job = MEM_mallocN(sizeof(QuadriFlowJob), "QuadriFlowJob");
 
   job->owner = CTX_data_active_object(C);
@@ -361,7 +324,7 @@ 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");
 
-  job->use_adaptive_scale = RNA_boolean_get(op->ptr, "use_adaptive_scale");
+  job->use_mesh_curvature = RNA_boolean_get(op->ptr, "use_mesh_curvature");
 
   job->preserve_paint_mask = RNA_boolean_get(op->ptr, "preserve_paint_mask");
   job->smooth_normals = RNA_boolean_get(op->ptr, "smooth_normals");
@@ -501,10 +464,10 @@ void OBJECT_OT_quadriflow_remesh(wmOperatorType *ot)
                   "Try to preserve mesh boundary on the mesh");
 
   RNA_def_boolean(ot->srna,
-                  "use_adaptive_scale",
+                  "use_mesh_curvature",
                   false,
-                  "Adaptive Scale",
-                  "Use adaptive scale when remeshing");
+                  "Use Mesh Curvature",
+                  "Take the mesh curvature into account when remeshing");
 
   RNA_def_boolean(ot->srna,
                   "preserve_paint_mask",
@@ -565,7 +528,7 @@ void OBJECT_OT_quadriflow_remesh(wmOperatorType *ot)
       "This property is only used to cache the object area for later calculations",
       0.0f,
       FLT_MAX);
-  RNA_def_property_flag(prop, PROP_HIDDEN);
+  RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
 
   RNA_def_int(ot->srna,
               "seed",
diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h
index bd3e3da6df3..9b6b885e330 100644
--- a/source/blender/makesdna/DNA_mesh_types.h
+++ b/source/blender/makesdna/DNA_mesh_types.h
@@ -265,7 +265,7 @@ enum {
 /* me->remesh_mode */
 enum {
   REMESH_VOXEL = 1 << 0,
-  REMESH_QUADRIFLOW = 1 << 1,
+  REMESH_QUAD = 1 << 1,
 };
 
 /* Subsurf Type */
diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c
index 10715a5229f..294b19e37fd 100644
--- a/source/blender/makesrna/intern/rna_mesh.c
+++ b/source/blender/makesrna/intern/rna_mesh.c
@@ -57,7 +57,7 @@ const EnumPropertyItem rna_enum_mesh_delimit_mode_items[] = {
 
 const EnumPropertyItem rna_enum_mesh_remesh_mode_items[] = {
     {REMESH_VOXEL, "VOXEL", 0, "Voxel Remesher", "Use the voxel remesher"},
-    {REMESH_QUADRIFLOW, "QUADRILOW", 0, "QuadriFlow Remesher", "Use the QuadriFlow remesher"},
+    {REMESH_QUAD, "QUAD", 0, "Quad Remesher", "Use the quad remesher"},
     {0, NULL, 0, NULL, NULL},
 };



More information about the Bf-blender-cvs mailing list