From a102d3397f69e84b11d57ac15a5206a60cf41614 Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Thu, 19 Dec 2013 14:39:54 +0200 Subject: Sculpting: * Support for symmetry in lasso masking * Optimize away symmetry multiplication of gravity vector if no gravity active * Move flip_v3_v3 to paint_utils (used in masking as well) * Use OpenMP for mask flood fill too. --- source/blender/editors/sculpt_paint/paint_utils.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'source/blender/editors/sculpt_paint/paint_utils.c') diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c index bfc431baea5..dd414a7b2b2 100644 --- a/source/blender/editors/sculpt_paint/paint_utils.c +++ b/source/blender/editors/sculpt_paint/paint_utils.c @@ -342,6 +342,23 @@ int imapaint_pick_face(ViewContext *vc, const int mval[2], unsigned int *index, return 1; } +/* Uses symm to selectively flip any axis of a coordinate. */ +void flip_v3_v3(float out[3], const float in[3], const char symm) +{ + if (symm & PAINT_SYMM_X) + out[0] = -in[0]; + else + out[0] = in[0]; + if (symm & PAINT_SYMM_Y) + out[1] = -in[1]; + else + out[1] = in[1]; + if (symm & PAINT_SYMM_Z) + out[2] = -in[2]; + else + out[2] = in[2]; +} + /* used for both 3d view and image window */ void paint_sample_color(const bContext *C, ARegion *ar, int x, int y) /* frontbuf */ { -- cgit v1.2.3