[Bf-blender-cvs] [185d9627b31] master: Fix T97423: Make mask filter less confusing by showing redo panel.

Joseph Eagar noreply at git.blender.org
Mon Apr 25 21:08:00 CEST 2022


Commit: 185d9627b3156d30596e19f611941c1ed0e88e5b
Author: Joseph Eagar
Date:   Mon Apr 25 12:03:16 2022 -0700
Branches: master
https://developer.blender.org/rB185d9627b3156d30596e19f611941c1ed0e88e5b

Fix T97423: Make mask filter less confusing
            by showing redo panel.

The A hotkey has "auto iteration" enabled by default,
which calculates the number of times to run the filter
using a heuristic based on vertex count.

To make clear to the user what is going on the redo
panel is now shown for the mask filter operator.

NOTE: I discovered the source of the bug where sculpt
operators' redo panels were greyed out.  The name
fed to SCULPT_undo_push_begin must match the operator
name.  I've added a comment in sculpt_intern explaining
this.

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

M	release/datafiles/locale
M	release/scripts/addons
M	source/blender/editors/sculpt_paint/sculpt_filter_mask.c
M	source/blender/editors/sculpt_paint/sculpt_intern.h
M	source/tools

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

diff --git a/release/datafiles/locale b/release/datafiles/locale
index 716dc02ec30..2e715d54178 160000
--- a/release/datafiles/locale
+++ b/release/datafiles/locale
@@ -1 +1 @@
-Subproject commit 716dc02ec30c0810513f7b4adc4ae865ae50c4e6
+Subproject commit 2e715d54178e24ea463c7bc0cdeb27c682c39ecf
diff --git a/release/scripts/addons b/release/scripts/addons
index 787ea78f7fa..d1b824f3c2a 160000
--- a/release/scripts/addons
+++ b/release/scripts/addons
@@ -1 +1 @@
-Subproject commit 787ea78f7fa6f0373d80ba1247768402df93f8ad
+Subproject commit d1b824f3c2a7a7b3e37e70f336e5a1580028c63e
diff --git a/source/blender/editors/sculpt_paint/sculpt_filter_mask.c b/source/blender/editors/sculpt_paint/sculpt_filter_mask.c
index c8137301de5..172c1f44e47 100644
--- a/source/blender/editors/sculpt_paint/sculpt_filter_mask.c
+++ b/source/blender/editors/sculpt_paint/sculpt_filter_mask.c
@@ -176,9 +176,7 @@ static void mask_filter_task_cb(void *__restrict userdata,
 static int sculpt_mask_filter_exec(bContext *C, wmOperator *op)
 {
   Object *ob = CTX_data_active_object(C);
-  SculptSession *ss = ob->sculpt;
   Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C);
-  PBVH *pbvh = ob->sculpt->pbvh;
   PBVHNode **nodes;
   Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
   int totnode;
@@ -186,6 +184,9 @@ static int sculpt_mask_filter_exec(bContext *C, wmOperator *op)
 
   BKE_sculpt_update_object_for_edit(depsgraph, ob, true, true, false);
 
+  SculptSession *ss = ob->sculpt;
+  PBVH *pbvh = ob->sculpt->pbvh;
+
   SCULPT_vertex_random_access_ensure(ss);
 
   if (!ob->sculpt->pmap) {
@@ -195,7 +196,7 @@ static int sculpt_mask_filter_exec(bContext *C, wmOperator *op)
   int num_verts = SCULPT_vertex_count_get(ss);
 
   BKE_pbvh_search_gather(pbvh, NULL, NULL, &nodes, &totnode);
-  SCULPT_undo_push_begin(ob, "Mask filter");
+  SCULPT_undo_push_begin(ob, "Mask Filter");
 
   for (int i = 0; i < totnode; i++) {
     SCULPT_undo_push_node(ob, nodes[i], SCULPT_UNDO_MASK);
@@ -274,7 +275,7 @@ void SCULPT_OT_mask_filter(struct wmOperatorType *ot)
   ot->exec = sculpt_mask_filter_exec;
   ot->poll = SCULPT_mode_poll;
 
-  ot->flag = OPTYPE_REGISTER;
+  ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 
   /* RNA. */
   RNA_def_enum(ot->srna,
diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h b/source/blender/editors/sculpt_paint/sculpt_intern.h
index f13f1c79a7a..f9633c91087 100644
--- a/source/blender/editors/sculpt_paint/sculpt_intern.h
+++ b/source/blender/editors/sculpt_paint/sculpt_intern.h
@@ -1448,6 +1448,11 @@ void SCULPT_cache_free(StrokeCache *cache);
 SculptUndoNode *SCULPT_undo_push_node(Object *ob, PBVHNode *node, SculptUndoType type);
 SculptUndoNode *SCULPT_undo_get_node(PBVHNode *node);
 SculptUndoNode *SCULPT_undo_get_first_node(void);
+
+/**
+ * NOTE: `name` must match operator name for
+ * redo panels to work.
+ */
 void SCULPT_undo_push_begin(struct Object *ob, const char *name);
 void SCULPT_undo_push_end(struct Object *ob);
 void SCULPT_undo_push_end_ex(struct Object *ob, const bool use_nested_undo);
diff --git a/source/tools b/source/tools
index 1e658ca996f..50c27746f2a 160000
--- a/source/tools
+++ b/source/tools
@@ -1 +1 @@
-Subproject commit 1e658ca996f11e5ff3398d89bd81f5b719304a57
+Subproject commit 50c27746f2a7c86ab4a0cfa8899b292af5dd07b6



More information about the Bf-blender-cvs mailing list