diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2013-10-03 02:18:14 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2013-10-03 02:18:14 +0400 |
commit | 8dcbc1060bcf7ee0d58726080405cffd2f3db5d1 (patch) | |
tree | 4260246e718ef6f280d82149d89c07714a26c839 /source/blender/editors/sculpt_paint | |
parent | be20171f39fc5c9664e988c72cb3671d95b7fb8a (diff) |
Revert 60358, it made irregularly scaled objects behave incorrectly, checking out different approach here.
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index d710d0c8cb1..459cf0fd3e9 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -1791,6 +1791,7 @@ static void do_draw_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode) /* offset with as much as possible factored in already */ mul_v3_v3fl(offset, ss->cache->sculpt_normal_symm, ss->cache->radius); + mul_v3_v3(offset, ss->cache->scale); mul_v3_fl(offset, bstrength); /* threaded loop over nodes */ @@ -1835,6 +1836,7 @@ static void do_crease_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnod /* offset with as much as possible factored in already */ mul_v3_v3fl(offset, ss->cache->sculpt_normal_symm, ss->cache->radius); + mul_v3_v3(offset, ss->cache->scale); mul_v3_fl(offset, bstrength); /* we divide out the squared alpha and multiply by the squared crease to give us the pinch strength */ @@ -2263,7 +2265,8 @@ static void do_inflate_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totno if (vd.fno) copy_v3_v3(val, vd.fno); else normal_short_to_float_v3(val, vd.no); - mul_v3_v3fl(proxy[vd.i], val, fade * ss->cache->radius); + mul_v3_fl(val, fade * ss->cache->radius); + mul_v3_v3v3(proxy[vd.i], val, ss->cache->scale); if (vd.mvert) vd.mvert->flag |= ME_VERT_PBVH_UPDATE; @@ -2642,7 +2645,8 @@ static void do_flatten_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totno displace = radius * offset; - mul_v3_v3fl(temp, an, displace); + mul_v3_v3v3(temp, an, ss->cache->scale); + mul_v3_fl(temp, displace); add_v3_v3(fc, temp); #pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP) @@ -2711,7 +2715,8 @@ static void do_clay_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode) displace = radius * (0.25f + offset); - mul_v3_v3fl(temp, an, displace); + mul_v3_v3v3(temp, an, ss->cache->scale); + mul_v3_fl(temp, displace); add_v3_v3(fc, temp); /* add_v3_v3v3(p, ss->cache->location, an); */ @@ -2798,7 +2803,8 @@ static void do_clay_strips_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int t displace = radius * (0.25f + offset); - mul_v3_v3fl(temp, sn, displace); + mul_v3_v3v3(temp, sn, ss->cache->scale); + mul_v3_fl(temp, displace); add_v3_v3(fc, temp); /* init mat */ @@ -2877,7 +2883,8 @@ static void do_fill_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode) displace = radius * offset; - mul_v3_v3fl(temp, an, displace); + mul_v3_v3v3(temp, an, ss->cache->scale); + mul_v3_fl(temp, displace); add_v3_v3(fc, temp); #pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP) @@ -2940,7 +2947,8 @@ static void do_scrape_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnod displace = -radius * offset; - mul_v3_v3fl(temp, an, displace); + mul_v3_v3v3(temp, an, ss->cache->scale); + mul_v3_fl(temp, displace); add_v3_v3(fc, temp); #pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP) |