[Bf-blender-cvs] [7be07a9d6e2] master: Cleanup: use local variable in smear code instead of ss->cache->bstrength

Joseph Eagar noreply at git.blender.org
Mon Jul 4 10:19:59 CEST 2022


Commit: 7be07a9d6e26fde833e24957e8263e5e07af8d2f
Author: Joseph Eagar
Date:   Mon Jul 4 01:19:14 2022 -0700
Branches: master
https://developer.blender.org/rB7be07a9d6e26fde833e24957e8263e5e07af8d2f

Cleanup: use local variable in smear code instead of ss->cache->bstrength

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

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

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

diff --git a/source/blender/editors/sculpt_paint/sculpt_paint_color.c b/source/blender/editors/sculpt_paint/sculpt_paint_color.c
index ed56138adca..7e813590e21 100644
--- a/source/blender/editors/sculpt_paint/sculpt_paint_color.c
+++ b/source/blender/editors/sculpt_paint/sculpt_paint_color.c
@@ -427,7 +427,7 @@ static void do_smear_brush_task_cb_exec(void *__restrict userdata,
     madd_v3_v3fl(current_disp, no, -dot_v3v3(current_disp, no));
 
     normalize_v3_v3(current_disp_norm, current_disp);
-    mul_v3_v3fl(current_disp, current_disp_norm, ss->cache->bstrength);
+    mul_v3_v3fl(current_disp, current_disp_norm, bstrength);
 
     float accum[4] = {0.0f, 0.0f, 0.0f, 0.0f};
     float totw = 0.0f;
@@ -457,12 +457,12 @@ static void do_smear_brush_task_cb_exec(void *__restrict userdata,
         sub_v3_v3v3(vertex_disp, SCULPT_vertex_co_get(ss, ni.index), vd.co);
 
         /* Weight by how close we are to our target distance from vd.co. */
-        float w = (1.0f + fabsf(len_v3(vertex_disp) / ss->cache->bstrength - 1.0f));
+        float w = (1.0f + fabsf(len_v3(vertex_disp) / bstrength - 1.0f));
 
         /* TODO: use cotangents (or at least face areas) here. */
         float len = len_v3v3(SCULPT_vertex_co_get(ss, ni.index), nco);
         if (len > 0.0f) {
-          len = ss->cache->bstrength / len;
+          len = bstrength / len;
         }
         else { /* Coincident point. */
           len = 1.0f;



More information about the Bf-blender-cvs mailing list