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/editors/sculpt_paint/paint_curve.c | |
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/editors/sculpt_paint/paint_curve.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_curve.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_curve.c b/source/blender/editors/sculpt_paint/paint_curve.c index ebe5268ec5c..2f27db835f5 100644 --- a/source/blender/editors/sculpt_paint/paint_curve.c +++ b/source/blender/editors/sculpt_paint/paint_curve.c @@ -134,12 +134,12 @@ static void paintcurve_undo_begin(bContext *C, wmOperator *op, PaintCurve *pc) UndoCurve *uc; switch (mode) { - case PAINT_TEXTURE_2D: - case PAINT_TEXTURE_PROJECTIVE: + case ePaintTexture2D: + case ePaintTextureProjective: undo_stack_id = UNDO_PAINT_IMAGE; break; - case PAINT_SCULPT: + case ePaintSculpt: undo_stack_id = UNDO_PAINT_MESH; break; @@ -737,17 +737,17 @@ static int paintcurve_draw_exec(bContext *C, wmOperator *UNUSED(op)) const char *name; switch (mode) { - case PAINT_TEXTURE_2D: - case PAINT_TEXTURE_PROJECTIVE: + case ePaintTexture2D: + case ePaintTextureProjective: name = "PAINT_OT_image_paint"; break; - case PAINT_WEIGHT: + case ePaintWeight: name = "PAINT_OT_weight_paint"; break; - case PAINT_VERTEX: + case ePaintVertex: name = "PAINT_OT_vertex_paint"; break; - case PAINT_SCULPT: + case ePaintSculpt: name = "SCULPT_OT_brush_stroke"; break; default: @@ -777,7 +777,7 @@ static int paintcurve_cursor_invoke(bContext *C, wmOperator *UNUSED(op), const w PaintMode mode = BKE_paintmode_get_active_from_context(C); switch (mode) { - case PAINT_TEXTURE_2D: + case ePaintTexture2D: { ARegion *ar = CTX_wm_region(C); SpaceImage *sima = CTX_wm_space_image(C); |