Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Dobarro <pablodp606@gmail.com>2019-10-07 23:07:29 +0300
committerPablo Dobarro <pablodp606@gmail.com>2019-10-09 16:44:56 +0300
commit06c5520bda40c9b5b8240eaf4c8d0a1de7d2ffec (patch)
tree773791f0824dadc3c57f85a2a4632878e5f0b51a /source/blender/editors/sculpt_paint
parentec9044e2b2ea6609128cc1db98eb23411f5e2ade (diff)
Fix T70554: Snake Hook + Ctrl does not set the brush stroke in its normal direction
This commit also fixes the same issue in elastic deform Reviewed By: jbakker Maniphest Tasks: T70554 Differential Revision: https://developer.blender.org/D6014
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 145bc77fb0f..cec323fd31f 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -2107,7 +2107,10 @@ static void update_sculpt_normal(Sculpt *sd, Object *ob, PBVHNode **nodes, int t
StrokeCache *cache = ob->sculpt->cache;
/* Grab brush does not update the sculpt normal during a stroke */
const bool update_normal = !(brush->flag & BRUSH_ORIGINAL_NORMAL) &&
- !(brush->sculpt_tool == SCULPT_TOOL_GRAB);
+ !(brush->sculpt_tool == SCULPT_TOOL_GRAB) &&
+ !(brush->sculpt_tool == SCULPT_TOOL_ELASTIC_DEFORM) &&
+ !(brush->sculpt_tool == SCULPT_TOOL_SNAKE_HOOK &&
+ cache->normal_weight > 0.0f);
if (cache->mirror_symmetry_pass == 0 && cache->radial_symmetry_pass == 0 &&
(cache->first_time || update_normal)) {
@@ -3591,6 +3594,10 @@ static void do_elastic_deform_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, in
copy_v3_v3(grab_delta, ss->cache->grab_delta_symmetry);
+ if (ss->cache->normal_weight > 0.0f) {
+ sculpt_project_v3_normal_align(ss, ss->cache->normal_weight, grab_delta);
+ }
+
SculptThreadedTaskData data = {
.sd = sd,
.ob = ob,