[Bf-blender-cvs] [ca60d520d96] sculpt-dev: Sculp IPMask: Property to enable/disable step interpolation

Pablo Dobarro noreply at git.blender.org
Wed Mar 3 17:30:19 CET 2021


Commit: ca60d520d96090ea2dcf850c2472c1605cbfab9e
Author: Pablo Dobarro
Date:   Wed Mar 3 17:29:24 2021 +0100
Branches: sculpt-dev
https://developer.blender.org/rBca60d520d96090ea2dcf850c2472c1605cbfab9e

Sculp IPMask: Property to enable/disable step interpolation

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

M	release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
M	source/blender/editors/sculpt_paint/sculpt_filter_mask.c

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

diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index 3f643af5adc..c0c115af2e9 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -1486,6 +1486,7 @@ class _defs_sculpt:
             props = tool.operator_properties("sculpt.ipmask_filter")
             layout.prop(props, "filter_type", expand=False)
             layout.prop(props, "iterations", expand=False)
+            layout.prop(props, "use_step_interpolation", expand=False)
 
         return dict(
             idname="builtin.ipmask_filter",
diff --git a/source/blender/editors/sculpt_paint/sculpt_filter_mask.c b/source/blender/editors/sculpt_paint/sculpt_filter_mask.c
index 6cc32ab19ee..17cfc4058bc 100644
--- a/source/blender/editors/sculpt_paint/sculpt_filter_mask.c
+++ b/source/blender/editors/sculpt_paint/sculpt_filter_mask.c
@@ -946,6 +946,7 @@ static int sculpt_ipmask_filter_modal(bContext *C, wmOperator *op, const wmEvent
   SculptSession *ss = ob->sculpt;
   FilterCache *filter_cache = ss->filter_cache;
   const int filter_type = RNA_enum_get(op->ptr, "filter_type");
+  const bool use_step_interpolation = RNA_boolean_get(op->ptr, "use_step_interpolation");
   const int iteration_count = RNA_int_get(op->ptr, "iterations");
 
   if ((event->type == EVT_ESCKEY && event->val == KM_PRESS) ||
@@ -971,7 +972,7 @@ static int sculpt_ipmask_filter_modal(bContext *C, wmOperator *op, const wmEvent
   const float len = event->x - event->prevclickx;
   const float target_step_fl = len * IPMASK_FILTER_STEP_SENSITIVITY * UI_DPI_FAC;
   const int target_step = floorf(target_step_fl);
-  const float step_interpolation = target_step_fl - target_step;
+  const float step_interpolation = use_step_interpolation? target_step_fl - target_step: 0.0f;
   const float full_step_strength = target_step_fl / IPMASK_FILTER_STEPS_PER_FULL_STRENGTH;
 
   BKE_sculpt_update_object_for_edit(depsgraph, ob, true, true, false);
@@ -1076,6 +1077,8 @@ void SCULPT_OT_ipmask_filter(struct wmOperatorType *ot)
               "Number of times that the filter is going to be applied per step",
               1,
               100);
+  RNA_def_boolean(
+      ot->srna, "use_step_interpolation", true, "Step Interpolation", "Calculate and render intermediate values between multiple full steps of the filter");
 }
 
 /******************************************************************************************/



More information about the Bf-blender-cvs mailing list