[Bf-blender-cvs] [15884510e86] sculpt-dev: Twist Brush: Deform rotation space

Pablo Dobarro noreply at git.blender.org
Fri Jul 2 22:20:19 CEST 2021


Commit: 15884510e863c04a9d47622cee0bdaf3fa92bdc9
Author: Pablo Dobarro
Date:   Sun Jun 20 17:21:53 2021 +0200
Branches: sculpt-dev
https://developer.blender.org/rB15884510e863c04a9d47622cee0bdaf3fa92bdc9

Twist Brush: Deform rotation space

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

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

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

diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index f117722a713..0673c70dbb3 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -5885,9 +5885,6 @@ static void do_twist_brush_task_cb_ex(void *__restrict userdata,
 
 
     copy_m4_m4(scaled_mat, mat);
-
-    float scale_factor = 1.0f;
-    mul_v3_fl(scaled_mat[2], scale_factor);
     
     invert_m4_m4(scaled_mat_inv, scaled_mat);
 
@@ -5902,7 +5899,9 @@ static void do_twist_brush_task_cb_ex(void *__restrict userdata,
     mul_v3_m4v3(p_rotated, scaled_mat_inv, p_rotated);
 
 
-    sub_v3_v3v3(proxy[vd.i], p_rotated, vd.co);
+    float disp[3];
+    sub_v3_v3v3(disp, p_rotated, vd.co);
+    mul_v3_v3fl(proxy[vd.i], disp, fade * fade);
 
 
 
@@ -5919,8 +5918,6 @@ static void do_twist_brush_task_cb_ex(void *__restrict userdata,
     */
 
 
-    sub_v3_v3v3(proxy[vd.i], p_rotated, vd.co);
-
     if (vd.mvert) {
       vd.mvert->flag |= ME_VERT_PBVH_UPDATE;
     }
@@ -5990,6 +5987,9 @@ static void do_twist_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode
   scale_m4_fl(scale, ss->cache->radius);
   mul_m4_m4m4(tmat, mat, scale);
 
+  /* Scale rotation space. */
+  mul_v3_fl(tmat[2], 0.25f);
+
   invert_m4_m4(mat, tmat);
 
   SculptThreadedTaskData data = {



More information about the Bf-blender-cvs mailing list