[Bf-blender-cvs] [5c03d0c30c4] sculpt-dev: Fix plane falloff with elastic cloth

Pablo Dobarro noreply at git.blender.org
Wed Dec 16 21:36:55 CET 2020


Commit: 5c03d0c30c4093e43387d0593ca8ed5b1caaab63
Author: Pablo Dobarro
Date:   Wed Dec 16 21:09:45 2020 +0100
Branches: sculpt-dev
https://developer.blender.org/rB5c03d0c30c4093e43387d0593ca8ed5b1caaab63

Fix plane falloff with elastic cloth

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

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

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

diff --git a/source/blender/editors/sculpt_paint/sculpt_cloth.c b/source/blender/editors/sculpt_paint/sculpt_cloth.c
index 3e7a193527e..a18c271ea25 100644
--- a/source/blender/editors/sculpt_paint/sculpt_cloth.c
+++ b/source/blender/editors/sculpt_paint/sculpt_cloth.c
@@ -644,7 +644,14 @@ static void do_cloth_brush_apply_forces_task_cb_ex(void *__restrict userdata,
           float final_disp[3];
           sub_v3_v3v3(brush_disp, ss->cache->location, ss->cache->last_location);
           mul_v3_v3fl(final_disp, brush_disp, ss->cache->bstrength);
-          BKE_kelvinlet_grab_triscale(final_disp, &params, vd.co, ss->cache->location, brush_disp);
+          float location[3];
+          if (use_falloff_plane) {
+            closest_to_plane_v3(location, deform_plane, vd.co);
+          }
+          else {
+            copy_v3_v3(location, ss->cache->location);
+          }
+          BKE_kelvinlet_grab_triscale(final_disp, &params, vd.co, location, brush_disp);
           mul_v3_fl(final_disp, 20.0f * (1.0f - fade));
           add_v3_v3(cloth_sim->pos[vd.index], final_disp);
           zero_v3(force);



More information about the Bf-blender-cvs mailing list