Commit: 41f1918b2d380405249c5657676235a8cd0a8ebf Author: decoda Date: Sun Jun 11 16:23:45 2017 +0530 Branches: soc-2017-sculpting_brush https://developer.blender.org/rB41f1918b2d380405249c5657676235a8cd0a8ebf
First approach towards Clip Brush =================================================================== 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 b08e50ad509..2fc17a838ce 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -3090,10 +3090,20 @@ static void do_clip_brush_task_cb_ex( axis_angle_normalized_to_mat3(rot, ss->cache->sculpt_normal_symm, angle * fade); mul_v3_m3v3(proxy[vd.i], rot, vec); add_v3_v3(proxy[vd.i], ss->cache->location); */ - mul_v3_v3fl(proxy[vd.i], vd.co, 1.5); /*just testing the working*/ - BM_vert_kill(ss->bm, vd.bm_vert); + sub_v3_v3v3(vec, vd.co, ss->cache->location); + float length = dot_v3v3(vec, vec); + float r = ss->cache->radius_squared; + float p1[3]; + mul_v3_v3fl(p1, vec, sqrt(r / length)); + + copy_v3_v3(proxy[vd.i], p1); + /* + mul_v3_v3fl(proxy[vd.i], vd.co, 1.5); just testing the working*/ + /* + BM_vert_kill(ss->bm, vd.bm_vert);*/ if (vd.mvert) vd.mvert->flag |= ME_VERT_PBVH_UPDATE; + } } BKE_pbvh_vertex_iter_end; _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs