diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2013-12-19 16:39:54 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2013-12-19 16:40:19 +0400 |
commit | a102d3397f69e84b11d57ac15a5206a60cf41614 (patch) | |
tree | 95eb6f2ecf960be784604d7ae58cb569469878aa /source/blender/editors/sculpt_paint/paint_utils.c | |
parent | 70ef1f20043425d0b721cbb03eebaa26ec013af9 (diff) |
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.
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_utils.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_utils.c | 17 |
1 files changed, 17 insertions, 0 deletions
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 */ { |