[Bf-blender-cvs] [0b9aaaf97f1] sculpt-dev: Sculpt Expand: Force all enabled when cursor not over the mesh

Pablo Dobarro noreply at git.blender.org
Thu Feb 11 18:48:42 CET 2021


Commit: 0b9aaaf97f1afc353d79eff9bfd92d175d798155
Author: Pablo Dobarro
Date:   Thu Feb 11 18:47:48 2021 +0100
Branches: sculpt-dev
https://developer.blender.org/rB0b9aaaf97f1afc353d79eff9bfd92d175d798155

Sculpt Expand: Force all enabled when cursor not over the mesh

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

M	source/blender/editors/sculpt_paint/sculpt_expand.c
M	source/blender/editors/sculpt_paint/sculpt_intern.h

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

diff --git a/source/blender/editors/sculpt_paint/sculpt_expand.c b/source/blender/editors/sculpt_paint/sculpt_expand.c
index 48857d0ecf0..6732e9e48d2 100644
--- a/source/blender/editors/sculpt_paint/sculpt_expand.c
+++ b/source/blender/editors/sculpt_paint/sculpt_expand.c
@@ -146,6 +146,10 @@ static bool sculpt_expand_state_get(SculptSession *ss, ExpandCache *expand_cache
     return false;
   }
 
+  if (expand_cache->all_enabled) {
+      return true;
+  }
+
   bool enabled = false;
 
   if (expand_cache->snap) {
@@ -178,6 +182,10 @@ static bool sculpt_expand_face_state_get(SculptSession *ss, ExpandCache *expand_
     return false;
   }
 
+  if (expand_cache->all_enabled) {
+      return true;
+  }
+
   bool enabled = false;
 
   if (expand_cache->snap_enabled_face_sets) {
@@ -1124,9 +1132,11 @@ static void sculpt_expand_update_for_vertex(bContext *C, Object *ob, const int v
   /* Update the active factor in the cache. */
   if (vertex == SCULPT_EXPAND_VERTEX_NONE) {
     expand_cache->active_factor = expand_cache->max_falloff_factor;
+    expand_cache->all_enabled = true;
   }
   else {
     expand_cache->active_factor = expand_cache->falloff_factor[vertex];
+    expand_cache->all_enabled = false;
   }
 
   if (expand_cache->target == SCULPT_EXPAND_TARGET_FACE_SETS) {
diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h b/source/blender/editors/sculpt_paint/sculpt_intern.h
index 135b7869153..28c1612f2ca 100644
--- a/source/blender/editors/sculpt_paint/sculpt_intern.h
+++ b/source/blender/editors/sculpt_paint/sculpt_intern.h
@@ -1190,6 +1190,7 @@ typedef struct ExpandCache {
   float max_face_falloff_factor;
 
   float active_factor;
+  bool all_enabled;
 
   float initial_mouse[2];
   int initial_active_vertex;



More information about the Bf-blender-cvs mailing list