[Bf-blender-cvs] [f35bfbb25ea] master: Sculpt: mesh filter, mask filter and dirty mask now work with multires

Brecht Van Lommel noreply at git.blender.org
Fri Oct 4 19:07:58 CEST 2019


Commit: f35bfbb25eacd95a976cbf248986be57c1fa88e7
Author: Brecht Van Lommel
Date:   Fri Oct 4 19:00:09 2019 +0200
Branches: master
https://developer.blender.org/rBf35bfbb25eacd95a976cbf248986be57c1fa88e7

Sculpt: mesh filter, mask filter and dirty mask now work with multires

Thanks to Sergey's neighbor access functions.

Mesh filter still needs some improvements to handle open boundaries better.

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

M	source/blender/editors/sculpt_paint/sculpt.c

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

diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 9bd788f7960..853324c7e17 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -186,7 +186,6 @@ static float sculpt_vertex_mask_get(SculptSession *ss, int index)
 
 static int sculpt_active_vertex_get(SculptSession *ss)
 {
-  BLI_assert(BKE_pbvh_type(ss->pbvh) != PBVH_GRIDS);
   switch (BKE_pbvh_type(ss->pbvh)) {
     case PBVH_FACES:
       return ss->active_vertex_index;
@@ -8296,6 +8295,11 @@ static void mesh_filter_task_cb(void *__restrict userdata,
     float fade = vd.mask ? *vd.mask : 0.0f;
     fade = 1 - fade;
     fade *= data->filter_strength;
+
+    if (fade == 0.0f) {
+      continue;
+    }
+
     copy_v3_v3(orig_co, orig_data.co);
     switch (filter_type) {
       case MESH_FILTER_SMOOTH:
@@ -8437,10 +8441,6 @@ static int sculpt_mesh_filter_invoke(bContext *C, wmOperator *op, const wmEvent
   SculptSession *ss = ob->sculpt;
   PBVH *pbvh = ob->sculpt->pbvh;
 
-  if (BKE_pbvh_type(ss->pbvh) == PBVH_GRIDS) {
-    return OPERATOR_CANCELLED;
-  }
-
   int deform_axis = RNA_enum_get(op->ptr, "deform_axis");
   if (deform_axis == 0) {
     return OPERATOR_CANCELLED;
@@ -8651,10 +8651,6 @@ static int sculpt_mask_filter_exec(bContext *C, wmOperator *op)
   int totnode;
   int filter_type = RNA_enum_get(op->ptr, "filter_type");
 
-  if (BKE_pbvh_type(ss->pbvh) == PBVH_GRIDS) {
-    return OPERATOR_CANCELLED;
-  }
-
   BKE_sculpt_update_object_for_edit(depsgraph, ob, true, true);
 
   sculpt_vertex_random_access_init(ss);
@@ -8868,10 +8864,6 @@ static int sculpt_dirty_mask_exec(bContext *C, wmOperator *op)
   Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
   int totnode;
 
-  if (BKE_pbvh_type(ss->pbvh) == PBVH_GRIDS) {
-    return OPERATOR_CANCELLED;
-  }
-
   BKE_sculpt_update_object_for_edit(depsgraph, ob, true, true);
 
   sculpt_vertex_random_access_init(ss);



More information about the Bf-blender-cvs mailing list