[Bf-blender-cvs] [ebf94179b5f] sculpt-dev: Sculpt IPMask: Dummy function to compute a step
Pablo Dobarro
noreply at git.blender.org
Fri Feb 26 14:59:00 CET 2021
Commit: ebf94179b5ff8a29bf0f73cb298ad586916573ec
Author: Pablo Dobarro
Date: Wed Feb 24 20:48:12 2021 +0100
Branches: sculpt-dev
https://developer.blender.org/rBebf94179b5ff8a29bf0f73cb298ad586916573ec
Sculpt IPMask: Dummy function to compute a step
===================================================================
M source/blender/editors/sculpt_paint/sculpt_filter_mask.c
===================================================================
diff --git a/source/blender/editors/sculpt_paint/sculpt_filter_mask.c b/source/blender/editors/sculpt_paint/sculpt_filter_mask.c
index c9562f3a25d..b2c68d92ee4 100644
--- a/source/blender/editors/sculpt_paint/sculpt_filter_mask.c
+++ b/source/blender/editors/sculpt_paint/sculpt_filter_mask.c
@@ -356,6 +356,25 @@ static MaskFilterDeltaStep *sculpt_ipmask_filter_delta_create(const float *curre
}
+static float *sculpt_ipmask_step_compute(SculptSession *ss, const float *current_mask) {
+ const int totvert = SCULPT_vertex_count_get(ss);
+ float *next_mask = MEM_malloc_arrayN(sizeof (float), totvert, "delta values");
+ for (int i = 0; i < totvert; i++) {
+ float max = 0.0f;
+ SculptVertexNeighborIter ni;
+ SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN (ss, i, ni) {
+ float vmask_f = current_mask[ni.index];
+ if (vmask_f > max) {
+ max = vmask_f;
+ }
+ }
+ SCULPT_VERTEX_NEIGHBORS_ITER_END(ni);
+ next_mask[i] = max;
+ }
+ return next_mask;
+}
+
+
#define IPMASK_FILTER_STEP_SENSITIVITY 0.05f
static int sculpt_ipmask_filter_modal(bContext *C, wmOperator *op, const wmEvent *event)
{
@@ -384,6 +403,46 @@ static int sculpt_ipmask_filter_modal(bContext *C, wmOperator *op, const wmEvent
}
+ while(filter_cache->mask_filter_current_step != target_step) {
+ int next_step = filter_cache->mask_filter_current_step;
+ int delta_index = next_step;
+
+ if (target_step > filter_cache->mask_filter_current_step) {
+ next_step += 1;
+ }
+ else {
+ next_step -= 1;
+ delta_index = next_step + 1;
+ }
+
+
+
+ if (BLI_ghash_haskey(filter_cache->mask_delta_step, POINTER_FROM_INT(delta_index))) {
+ /* apply */
+ }
+ else {
+ /* compute */
+
+
+ /* store */
+ }
+
+
+
+ /* copy */
+
+
+ /* update */
+
+
+
+
+
+
+
+
+ }
+
return OPERATOR_RUNNING_MODAL;
More information about the Bf-blender-cvs
mailing list