Cleanup: renmae ePaintTexture(Projective) -> 3D
authorCampbell Barton <ideasman42@gmail.com>
Wed, 7 Nov 2018 00:44:51 +0000 (11:44 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 7 Nov 2018 00:52:14 +0000 (11:52 +1100)
Matches ePaintTexture2D, less verbose.

source/blender/blenkernel/BKE_paint.h
source/blender/blenkernel/intern/paint.c
source/blender/editors/sculpt_paint/paint_cursor.c
source/blender/editors/sculpt_paint/paint_curve.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/paint_ops.c
source/blender/editors/sculpt_paint/paint_stroke.c
source/blender/makesrna/intern/rna_brush.c

index abb9000b024dedec838ff41f33dab09f54242367..a132af41567af1839d3afeb94a66599239dc7e77 100644 (file)
@@ -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
index 2c17fa442294feb57581ebcf1b7b0848a4f6195e..0541bd58c85bc99e836abdb3ee3f5ba1a1ba2df7 100644 (file)
@@ -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;
index f503ab37230748bfc5decd2b396987898b5b9991..fb938ed60c98fdc57e2eeba8e2adcc27984ac7fc 100644 (file)
@@ -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;
index 0e56a1187e359a3b5573db85419ce57ef3021be7..1bbc1a7a555805e3d00023112dd6993fdea7c882 100644 (file)
@@ -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:
index ab04a9275738f515cd225da32fafd1956a26176d..6ad2f98c5201632867a435c031f17ed9dee907fb 100644 (file)
@@ -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);
index 74984d090f8dff4b51270537fc219715120385f4..07c57d1891b9569bf703d321d4947076afb3afd1 100644 (file)
@@ -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;
        }
index de804677de9401800086df0d113b5fca6093f19e..760768fe29dd885c41009970c646a9e015bb2b5e 100644 (file)
@@ -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) */
index 1afa462dba8a9cd11ec36e3a268c63748627cc0d..dfc93581e6a67a493cc9064b07d1a90620826442 100644 (file)
@@ -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: