diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-03-16 21:05:53 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-03-16 21:05:53 +0300 |
commit | 391526c20e7ba0e818241f4dedb3f40aa51fd47a (patch) | |
tree | 707f856b9e68fbcd2fea836c6d93ac524fcb1d58 /source/blender/editors/sculpt_paint/paint_image.c | |
parent | abb7a25426a630f5a5209987a78530f70c0dfa94 (diff) |
option to lock alpha while projection painting.
(commit 27538 by Campbell from render25 branch)
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_image.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 6137d83e77e..9fc858a191f 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -3705,6 +3705,7 @@ static void *do_projectpaint_thread(void *ph_v) float mask = 1.0f; /* airbrush wont use mask */ unsigned short mask_short; float size_half = ((float)ps->brush->size) * 0.5f; + short lock_alpha= ELEM(ps->brush->blend, IMB_BLEND_ERASE_ALPHA, IMB_BLEND_ADD_ALPHA) ? 0 : ps->brush->flag & BRUSH_LOCK_ALPHA; LinkNode *smearPixels = NULL; LinkNode *smearPixels_f = NULL; @@ -3833,6 +3834,12 @@ static void *do_projectpaint_thread(void *ph_v) break; } } + + if(lock_alpha) { + if (is_floatbuf) projPixel->pixel.f_pt[3]= projPixel->origColor.f[3]; + else projPixel->pixel.ch_pt[3]= projPixel->origColor.ch[3]; + } + /* done painting */ } } |