From 6c43490616973af78f91062df402e2ca34cedac5 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 6 Oct 2017 19:10:33 +1100 Subject: Vertex Paint: use view normal w/ 2D falloff When projecting to the view, cull faces pointing away from the view normal. --- source/blender/editors/sculpt_paint/sculpt.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to '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 5f38eaa4de2..ad58adfe4af 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -651,6 +651,19 @@ SculptBrushTestFn sculpt_brush_test_init_with_falloff_shape( return sculpt_brush_test_sq_fn; } +const float *sculpt_brush_frontface_normal_from_falloff_shape( + SculptSession *ss, char falloff_shape) +{ + if (falloff_shape == PAINT_FALLOFF_SHAPE_SPHERE) { + return ss->cache->sculpt_normal_symm; + } + else { + /* PAINT_FALLOFF_SHAPE_TUBE */ + return ss->cache->view_normal; + } +} + + static float frontface(const Brush *br, const float sculpt_normal[3], const short no[3], const float fno[3]) { -- cgit v1.2.3