Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-11-06 10:06:33 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-11-06 10:06:33 +0300
commit80109c976cf1f43e1f1730cb827130aa270abaaa (patch)
tree93932897c425ea9f062f6960bc50f1f265a53e32 /source/blender/editors/sculpt_paint/paint_vertex_color_utils.c
parent900c562b71b6efcf68d649cb639cc8bc246d5899 (diff)
Brush: split out vertex paint tool & blend mode
- Vertex & weight paint now use the 'blend' setting. - Weight paint now has it's own tool setting, since weight paint doesn't deal with color - we'll likely support different tools eventually.
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_vertex_color_utils.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex_color_utils.c42
1 files changed, 20 insertions, 22 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_vertex_color_utils.c b/source/blender/editors/sculpt_paint/paint_vertex_color_utils.c
index 481d5e7d5ea..f78588df0fa 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex_color_utils.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex_color_utils.c
@@ -36,6 +36,7 @@
#include "BLI_math_color.h"
#include "IMB_colormanagement.h"
+#include "IMB_imbuf.h"
#include "BKE_context.h"
#include "BKE_mesh.h"
@@ -617,29 +618,26 @@ uint ED_vpaint_blend_tool(
const int tool, const uint col,
const uint paintcol, const int alpha_i)
{
- switch (tool) {
- case PAINT_BLEND_MIX:
- case PAINT_BLEND_BLUR: return mcol_blend(col, paintcol, alpha_i);
- case PAINT_BLEND_AVERAGE: return mcol_blend(col, paintcol, alpha_i);
- case PAINT_BLEND_SMEAR: return mcol_blend(col, paintcol, alpha_i);
- case PAINT_BLEND_ADD: return mcol_add(col, paintcol, alpha_i);
- case PAINT_BLEND_SUB: return mcol_sub(col, paintcol, alpha_i);
- case PAINT_BLEND_MUL: return mcol_mul(col, paintcol, alpha_i);
- case PAINT_BLEND_LIGHTEN: return mcol_lighten(col, paintcol, alpha_i);
- case PAINT_BLEND_DARKEN: return mcol_darken(col, paintcol, alpha_i);
- case PAINT_BLEND_COLORDODGE: return mcol_colordodge(col, paintcol, alpha_i);
- case PAINT_BLEND_DIFFERENCE: return mcol_difference(col, paintcol, alpha_i);
- case PAINT_BLEND_SCREEN: return mcol_screen(col, paintcol, alpha_i);
- case PAINT_BLEND_HARDLIGHT: return mcol_hardlight(col, paintcol, alpha_i);
- case PAINT_BLEND_OVERLAY: return mcol_overlay(col, paintcol, alpha_i);
- case PAINT_BLEND_SOFTLIGHT: return mcol_softlight(col, paintcol, alpha_i);
- case PAINT_BLEND_EXCLUSION: return mcol_exclusion(col, paintcol, alpha_i);
- case PAINT_BLEND_LUMINOCITY: return mcol_luminosity(col, paintcol, alpha_i);
- case PAINT_BLEND_SATURATION: return mcol_saturation(col, paintcol, alpha_i);
- case PAINT_BLEND_HUE: return mcol_hue(col, paintcol, alpha_i);
+ switch ((IMB_BlendMode)tool) {
+ case IMB_BLEND_MIX: return mcol_blend(col, paintcol, alpha_i);
+ case IMB_BLEND_ADD: return mcol_add(col, paintcol, alpha_i);
+ case IMB_BLEND_SUB: return mcol_sub(col, paintcol, alpha_i);
+ case IMB_BLEND_MUL: return mcol_mul(col, paintcol, alpha_i);
+ case IMB_BLEND_LIGHTEN: return mcol_lighten(col, paintcol, alpha_i);
+ case IMB_BLEND_DARKEN: return mcol_darken(col, paintcol, alpha_i);
+ case IMB_BLEND_COLORDODGE: return mcol_colordodge(col, paintcol, alpha_i);
+ case IMB_BLEND_DIFFERENCE: return mcol_difference(col, paintcol, alpha_i);
+ case IMB_BLEND_SCREEN: return mcol_screen(col, paintcol, alpha_i);
+ case IMB_BLEND_HARDLIGHT: return mcol_hardlight(col, paintcol, alpha_i);
+ case IMB_BLEND_OVERLAY: return mcol_overlay(col, paintcol, alpha_i);
+ case IMB_BLEND_SOFTLIGHT: return mcol_softlight(col, paintcol, alpha_i);
+ case IMB_BLEND_EXCLUSION: return mcol_exclusion(col, paintcol, alpha_i);
+ case IMB_BLEND_LUMINOSITY: return mcol_luminosity(col, paintcol, alpha_i);
+ case IMB_BLEND_SATURATION: return mcol_saturation(col, paintcol, alpha_i);
+ case IMB_BLEND_HUE: return mcol_hue(col, paintcol, alpha_i);
/* non-color */
- case PAINT_BLEND_ALPHA_SUB: return mcol_alpha_sub(col, alpha_i);
- case PAINT_BLEND_ALPHA_ADD: return mcol_alpha_add(col, alpha_i);
+ case IMB_BLEND_ERASE_ALPHA: return mcol_alpha_sub(col, alpha_i);
+ case IMB_BLEND_ADD_ALPHA: return mcol_alpha_add(col, alpha_i);
default:
BLI_assert(0);
return 0;