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_weight_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_weight_utils.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex_weight_utils.c42
1 files changed, 19 insertions, 23 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_vertex_weight_utils.c b/source/blender/editors/sculpt_paint/paint_vertex_weight_utils.c
index 51cd759b260..0a1fc7c0b4e 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex_weight_utils.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex_weight_utils.c
@@ -45,6 +45,9 @@
#include "BKE_report.h"
#include "BKE_object.h"
+/* Only for blend modes. */
+#include "IMB_imbuf.h"
+
#include "WM_api.h"
#include "WM_types.h"
@@ -280,31 +283,24 @@ float ED_wpaint_blend_tool(
const float weight,
const float paintval, const float alpha)
{
- switch (tool) {
- case PAINT_BLEND_MIX:
- case PAINT_BLEND_AVERAGE:
- case PAINT_BLEND_SMEAR:
- case PAINT_BLEND_BLUR: return wval_blend(weight, paintval, alpha);
- case PAINT_BLEND_ADD: return wval_add(weight, paintval, alpha);
- case PAINT_BLEND_SUB: return wval_sub(weight, paintval, alpha);
- case PAINT_BLEND_MUL: return wval_mul(weight, paintval, alpha);
- case PAINT_BLEND_LIGHTEN: return wval_lighten(weight, paintval, alpha);
- case PAINT_BLEND_DARKEN: return wval_darken(weight, paintval, alpha);
+ switch ((IMB_BlendMode)tool) {
+ case IMB_BLEND_MIX: return wval_blend(weight, paintval, alpha);
+ case IMB_BLEND_ADD: return wval_add(weight, paintval, alpha);
+ case IMB_BLEND_SUB: return wval_sub(weight, paintval, alpha);
+ case IMB_BLEND_MUL: return wval_mul(weight, paintval, alpha);
+ case IMB_BLEND_LIGHTEN: return wval_lighten(weight, paintval, alpha);
+ case IMB_BLEND_DARKEN: return wval_darken(weight, paintval, alpha);
/* Mostly make sense for color: support anyway. */
- case PAINT_BLEND_COLORDODGE: return wval_colordodge(weight, paintval, alpha);
- case PAINT_BLEND_DIFFERENCE: return wval_difference(weight, paintval, alpha);
- case PAINT_BLEND_SCREEN: return wval_screen(weight, paintval, alpha);
- case PAINT_BLEND_HARDLIGHT: return wval_hardlight(weight, paintval, alpha);
- case PAINT_BLEND_OVERLAY: return wval_overlay(weight, paintval, alpha);
- case PAINT_BLEND_SOFTLIGHT: return wval_softlight(weight, paintval, alpha);
- case PAINT_BLEND_EXCLUSION: return wval_exclusion(weight, paintval, alpha);
+ case IMB_BLEND_COLORDODGE: return wval_colordodge(weight, paintval, alpha);
+ case IMB_BLEND_DIFFERENCE: return wval_difference(weight, paintval, alpha);
+ case IMB_BLEND_SCREEN: return wval_screen(weight, paintval, alpha);
+ case IMB_BLEND_HARDLIGHT: return wval_hardlight(weight, paintval, alpha);
+ case IMB_BLEND_OVERLAY: return wval_overlay(weight, paintval, alpha);
+ case IMB_BLEND_SOFTLIGHT: return wval_softlight(weight, paintval, alpha);
+ case IMB_BLEND_EXCLUSION: return wval_exclusion(weight, paintval, alpha);
/* Only for color: just use blend. */
- case PAINT_BLEND_LUMINOCITY:
- case PAINT_BLEND_SATURATION:
- case PAINT_BLEND_HUE:
- case PAINT_BLEND_ALPHA_SUB:
- case PAINT_BLEND_ALPHA_ADD:
- default: return wval_blend(weight, paintval, alpha);
+ default:
+ return wval_blend(weight, paintval, alpha);
}
}