From 59e70d5f8d68d8fa9eb34f75866578fafece8709 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 7 Nov 2018 11:44:51 +1100 Subject: Cleanup: renmae ePaintTexture(Projective) -> 3D Matches ePaintTexture2D, less verbose. --- source/blender/blenkernel/BKE_paint.h | 5 ++++- source/blender/blenkernel/intern/paint.c | 6 +++--- source/blender/editors/sculpt_paint/paint_cursor.c | 4 ++-- source/blender/editors/sculpt_paint/paint_curve.c | 2 +- source/blender/editors/sculpt_paint/paint_image.c | 8 ++++---- source/blender/editors/sculpt_paint/paint_ops.c | 2 +- source/blender/editors/sculpt_paint/paint_stroke.c | 6 +++--- source/blender/makesrna/intern/rna_brush.c | 4 ++-- 8 files changed, 20 insertions(+), 17 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h index abb9000b024..a132af41567 100644 --- a/source/blender/blenkernel/BKE_paint.h +++ b/source/blender/blenkernel/BKE_paint.h @@ -69,9 +69,12 @@ extern const char PAINT_CURSOR_TEXTURE_PAINT[3]; typedef enum ePaintMode { ePaintSculpt = 0, + /** Vertex color. */ ePaintVertex = 1, ePaintWeight = 2, - ePaintTextureProjective = 3, + /** 3D view (projection painting). */ + ePaintTexture3D = 3, + /** Image space (2D painting). */ ePaintTexture2D = 4, ePaintSculptUV = 5, ePaintInvalid = 6 diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c index 2c17fa44229..0541bd58c85 100644 --- a/source/blender/blenkernel/intern/paint.c +++ b/source/blender/blenkernel/intern/paint.c @@ -142,7 +142,7 @@ Paint *BKE_paint_get_active_from_paintmode(Scene *sce, ePaintMode mode) case ePaintWeight: return &ts->wpaint->paint; case ePaintTexture2D: - case ePaintTextureProjective: + case ePaintTexture3D: return &ts->imapaint.paint; case ePaintSculptUV: return &ts->uvsculpt->paint; @@ -248,7 +248,7 @@ ePaintMode BKE_paintmode_get_active_from_context(const bContext *C) case OB_MODE_WEIGHT_PAINT: return ePaintWeight; case OB_MODE_TEXTURE_PAINT: - return ePaintTextureProjective; + return ePaintTexture3D; case OB_MODE_EDIT: if (ts->use_uv_sculpt) return ePaintSculptUV; @@ -486,7 +486,7 @@ eObjectMode BKE_paint_object_mode_from_paint_mode(ePaintMode mode) return OB_MODE_VERTEX_PAINT; case ePaintWeight: return OB_MODE_WEIGHT_PAINT; - case ePaintTextureProjective: + case ePaintTexture3D: return OB_MODE_TEXTURE_PAINT; case ePaintTexture2D: return OB_MODE_TEXTURE_PAINT; diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c index f503ab37230..fb938ed60c9 100644 --- a/source/blender/editors/sculpt_paint/paint_cursor.c +++ b/source/blender/editors/sculpt_paint/paint_cursor.c @@ -788,7 +788,7 @@ static void paint_draw_alpha_overlay( ViewContext *vc, int x, int y, float zoom, ePaintMode mode) { /* color means that primary brush texture is colured and secondary is used for alpha/mask control */ - bool col = ELEM(mode, ePaintTextureProjective, ePaintTexture2D, ePaintVertex) ? true : false; + bool col = ELEM(mode, ePaintTexture3D, ePaintTexture2D, ePaintVertex) ? true : false; eOverlayControlFlags flags = BKE_paint_get_overlay_flags(); /* save lots of GL state * TODO: check on whether all of these are needed? */ @@ -990,7 +990,7 @@ static void paint_cursor_on_hit( static bool ommit_cursor_drawing(Paint *paint, ePaintMode mode, Brush *brush) { if (paint->flags & PAINT_SHOW_BRUSH) { - if (ELEM(mode, ePaintTexture2D, ePaintTextureProjective) && brush->imagepaint_tool == PAINT_TOOL_FILL) { + if (ELEM(mode, ePaintTexture2D, ePaintTexture3D) && brush->imagepaint_tool == PAINT_TOOL_FILL) { return true; } return false; diff --git a/source/blender/editors/sculpt_paint/paint_curve.c b/source/blender/editors/sculpt_paint/paint_curve.c index 0e56a1187e3..1bbc1a7a555 100644 --- a/source/blender/editors/sculpt_paint/paint_curve.c +++ b/source/blender/editors/sculpt_paint/paint_curve.c @@ -659,7 +659,7 @@ static int paintcurve_draw_exec(bContext *C, wmOperator *UNUSED(op)) switch (mode) { case ePaintTexture2D: - case ePaintTextureProjective: + case ePaintTexture3D: name = "PAINT_OT_image_paint"; break; case ePaintWeight: diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index ab04a927573..6ad2f98c520 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -878,7 +878,7 @@ static int sample_color_exec(bContext *C, wmOperator *op) RNA_int_get_array(op->ptr, "location", location); const bool use_palette = RNA_boolean_get(op->ptr, "palette"); - const bool use_sample_texture = (mode == ePaintTextureProjective) && !RNA_boolean_get(op->ptr, "merged"); + const bool use_sample_texture = (mode == ePaintTexture3D) && !RNA_boolean_get(op->ptr, "merged"); paint_sample_color(C, ar, location[0], location[1], use_sample_texture, use_palette); @@ -918,7 +918,7 @@ static int sample_color_invoke(bContext *C, wmOperator *op, const wmEvent *event RNA_int_set_array(op->ptr, "location", event->mval); ePaintMode mode = BKE_paintmode_get_active_from_context(C); - const bool use_sample_texture = (mode == ePaintTextureProjective) && !RNA_boolean_get(op->ptr, "merged"); + const bool use_sample_texture = (mode == ePaintTexture3D) && !RNA_boolean_get(op->ptr, "merged"); paint_sample_color(C, ar, event->mval[0], event->mval[1], use_sample_texture, false); WM_cursor_modal_set(win, BC_EYEDROPPER_CURSOR); @@ -954,7 +954,7 @@ static int sample_color_modal(bContext *C, wmOperator *op, const wmEvent *event) } ePaintMode mode = BKE_paintmode_get_active_from_context(C); - const bool use_sample_texture = (mode == ePaintTextureProjective) && !RNA_boolean_get(op->ptr, "merged"); + const bool use_sample_texture = (mode == ePaintTexture3D) && !RNA_boolean_get(op->ptr, "merged"); switch (event->type) { case MOUSEMOVE: @@ -1093,7 +1093,7 @@ static int texture_paint_toggle_exec(bContext *C, wmOperator *op) ob->mode |= mode_flag; - BKE_paint_init(bmain, scene, ePaintTextureProjective, PAINT_CURSOR_TEXTURE_PAINT); + BKE_paint_init(bmain, scene, ePaintTexture3D, PAINT_CURSOR_TEXTURE_PAINT); if (U.glreslimit != 0) GPU_free_images(bmain); diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c index 74984d090f8..07c57d1891b 100644 --- a/source/blender/editors/sculpt_paint/paint_ops.c +++ b/source/blender/editors/sculpt_paint/paint_ops.c @@ -205,7 +205,7 @@ static int palette_color_add_exec(bContext *C, wmOperator *UNUSED(op)) color = BKE_palette_color_add(palette); palette->active_color = BLI_listbase_count(&palette->colors) - 1; - if (ELEM(mode, ePaintTextureProjective, ePaintTexture2D, ePaintVertex)) { + if (ELEM(mode, ePaintTexture3D, ePaintTexture2D, ePaintVertex)) { copy_v3_v3(color->rgb, BKE_brush_color_get(scene, brush)); color->value = 0.0; } diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index de804677de9..760768fe29d 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -426,7 +426,7 @@ static bool paint_stroke_use_jitter(ePaintMode mode, Brush *brush, bool invert) /* jitter-ed brush gives weird and unpredictable result for this * kinds of stroke, so manually disable jitter usage (sergey) */ use_jitter &= (brush->flag & (BRUSH_DRAG_DOT | BRUSH_ANCHORED)) == 0; - use_jitter &= (!ELEM(mode, ePaintTexture2D, ePaintTextureProjective) || + use_jitter &= (!ELEM(mode, ePaintTexture2D, ePaintTexture3D) || !(invert && brush->imagepaint_tool == PAINT_TOOL_CLONE)); @@ -825,7 +825,7 @@ bool paint_supports_dynamic_size(Brush *br, ePaintMode mode) break; case ePaintTexture2D: /* fall through */ - case ePaintTextureProjective: + case ePaintTexture3D: if ((br->imagepaint_tool == PAINT_TOOL_FILL) && (br->flag & BRUSH_USE_GRADIENT)) { @@ -861,7 +861,7 @@ bool paint_supports_smooth_stroke(Brush *br, ePaintMode mode) bool paint_supports_texture(ePaintMode mode) { /* omit: PAINT_WEIGHT, PAINT_SCULPT_UV, PAINT_INVALID */ - return ELEM(mode, ePaintSculpt, ePaintVertex, ePaintTextureProjective, ePaintTexture2D); + return ELEM(mode, ePaintSculpt, ePaintVertex, ePaintTexture3D, ePaintTexture2D); } /* return true if the brush size can change during paint (normally used for pressure) */ diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index 1afa462dba8..dfc93581e6a 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -568,7 +568,7 @@ static const EnumPropertyItem *rna_Brush_direction_itemf(bContext *C, PointerRNA } case ePaintTexture2D: - case ePaintTextureProjective: + case ePaintTexture3D: switch (me->imagepaint_tool) { case PAINT_TOOL_SOFTEN: return prop_soften_sharpen_items; @@ -599,7 +599,7 @@ static const EnumPropertyItem *rna_Brush_stroke_itemf(bContext *C, PointerRNA *U switch (mode) { case ePaintSculpt: case ePaintTexture2D: - case ePaintTextureProjective: + case ePaintTexture3D: return sculpt_stroke_method_items; default: -- cgit v1.2.3