diff options
author | Ton Roosendaal <ton@blender.org> | 2010-12-24 18:30:13 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2010-12-24 18:30:13 +0300 |
commit | 77d08370cfa0abd318f3b0c06560262d6b67e3b9 (patch) | |
tree | 9ba5f89d1d8372c7536a21a715f1c67e77bd132c /source/blender/editors/sculpt_paint/sculpt.c | |
parent | 490c0758cb7fc7da40d4ee3ca74d96a6c40b7586 (diff) |
Bugfix #25371
Sculpt: brush type "Grab" with option "Frontface only" was flipping
back and forth when grabbing outside of original brush area.
Reason: it was calling a function that used deformed coordinates
for getting normal, clipped by brush area. Now it uses original
coordinates, so it always finds normal.
Nicholas can determine better if tag "cache->original" should be
set as default for this brush type, this far I don't dare to go :)
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index f29d32131d6..55c7247650a 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -411,7 +411,6 @@ static float frontface(Brush *brush, float sculpt_normal[3], short no[3], float else { dot= dot_v3v3(fno, sculpt_normal); } - return dot > 0 ? dot : 0; } else { @@ -1331,9 +1330,14 @@ static void do_grab_brush(Sculpt *sd, SculptSession *ss, PBVHNode **nodes, int t int n; float len; - if (brush->normal_weight > 0 || brush->flag & BRUSH_FRONTFACE) + if (brush->normal_weight > 0 || brush->flag & BRUSH_FRONTFACE) { + int cache= 1; + /* grab brush requires to test on original data */ + SWAP(int, ss->cache->original, cache); calc_sculpt_normal(sd, ss, an, nodes, totnode); - + SWAP(int, ss->cache->original, cache); + } + copy_v3_v3(grab_delta, ss->cache->grab_delta_symmetry); len = len_v3(grab_delta); |