diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2015-08-31 21:37:38 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2015-08-31 22:00:30 +0300 |
commit | 333feea6e9450379f5314f327cf1ac1aef6d8a07 (patch) | |
tree | 733c5da53fbae58268a4c1d68beb2fc383ad5187 /source/blender/blenkernel/BKE_paint.h | |
parent | 0018483dfaf96af569fad40bed6f47389ef3358f (diff) |
Fix T45258, impossible to select brush when removing it from 2d
painting.
Also system added a brush every time it found no paint brush in the
system which is not what we would want.
Solution:
* Brush panel stays visible always, regardless of whether there is a
brush or not.
* We search for first available brush when we find no brush in paint
struct instead of always generating a new one.
* Generating and searching for a brush take a mode argument now. Needed
some refactoring to users of BKE_paint_init as well.
* Did some style cleanups for paint mode enums.
Patch is big but it's mostly argument refactoring.
Diffstat (limited to 'source/blender/blenkernel/BKE_paint.h')
-rw-r--r-- | source/blender/blenkernel/BKE_paint.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h index c9192fddec6..bf1cfb263eb 100644 --- a/source/blender/blenkernel/BKE_paint.h +++ b/source/blender/blenkernel/BKE_paint.h @@ -66,13 +66,13 @@ extern const char PAINT_CURSOR_WEIGHT_PAINT[3]; extern const char PAINT_CURSOR_TEXTURE_PAINT[3]; typedef enum PaintMode { - PAINT_SCULPT = 0, - PAINT_VERTEX = 1, - PAINT_WEIGHT = 2, - PAINT_TEXTURE_PROJECTIVE = 3, - PAINT_TEXTURE_2D = 4, - PAINT_SCULPT_UV = 5, - PAINT_INVALID = 6 + ePaintSculpt = 0, + ePaintVertex = 1, + ePaintWeight = 2, + ePaintTextureProjective = 3, + ePaintTexture2D = 4, + ePaintSculptUV = 5, + ePaintInvalid = 6 } PaintMode; /* overlay invalidation */ @@ -108,12 +108,14 @@ void BKE_palette_clear(struct Palette *palette); struct PaintCurve *BKE_paint_curve_add(struct Main *bmain, const char *name); void BKE_paint_curve_free(struct PaintCurve *pc); -void BKE_paint_init(struct UnifiedPaintSettings *ups, struct Paint *p, const char col[3]); +void BKE_paint_init(struct Scene *sce, PaintMode mode, const char col[3]); void BKE_paint_free(struct Paint *p); void BKE_paint_copy(struct Paint *src, struct Paint *tar); void BKE_paint_cavity_curve_preset(struct Paint *p, int preset); +short BKE_paint_object_mode_from_paint_mode(PaintMode mode); +struct Paint *BKE_paint_get_active_from_paintmode(struct Scene *sce, PaintMode mode); struct Paint *BKE_paint_get_active(struct Scene *sce); struct Paint *BKE_paint_get_active_from_context(const struct bContext *C); PaintMode BKE_paintmode_get_active_from_context(const struct bContext *C); |