diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-11-07 03:58:57 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-07 03:59:41 +0300 |
commit | 101fd08348e5717f98af93481e6cc97d3bf920c3 (patch) | |
tree | 32a8130570ed435290656f48c7af8bfde7e96532 /source | |
parent | 4e9911663a22766f6751d33ae84c1ebcc1fae559 (diff) | |
parent | 59e70d5f8d68d8fa9eb34f75866578fafece8709 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/BKE_paint.h | 5 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/paint.c | 14 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_icons.c | 2 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_cursor.c | 4 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_curve.c | 2 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image.c | 8 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_ops.c | 4 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_stroke.c | 6 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_brush.c | 4 |
9 files changed, 26 insertions, 23 deletions
diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h index b4b667ecb6b..6f54e2b3b17 100644 --- a/source/blender/blenkernel/BKE_paint.h +++ b/source/blender/blenkernel/BKE_paint.h @@ -76,9 +76,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, ePaintGpencil = 6, diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c index db7cd513bf4..e31021d7d48 100644 --- a/source/blender/blenkernel/intern/paint.c +++ b/source/blender/blenkernel/intern/paint.c @@ -158,7 +158,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; @@ -184,7 +184,7 @@ const EnumPropertyItem *BKE_paint_get_tool_enum_from_paintmode(ePaintMode mode) case ePaintWeight: return rna_enum_brush_weight_tool_items; case ePaintTexture2D: - case ePaintTextureProjective: + case ePaintTexture3D: return rna_enum_brush_image_tool_items; case ePaintSculptUV: return NULL; @@ -203,7 +203,7 @@ const char *BKE_paint_get_tool_prop_id_from_paintmode(ePaintMode mode) case ePaintVertex: return "vertex_tool"; case ePaintWeight: return "weight_tool"; case ePaintTexture2D: - case ePaintTextureProjective: return "image_tool"; + case ePaintTexture3D: return "image_tool"; case ePaintGpencil: return "gpencil_tool"; default: /* invalid paint mode */ @@ -309,7 +309,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; @@ -340,7 +340,7 @@ ePaintMode BKE_paintmode_get_from_tool(const struct bToolRef *tref) case CTX_MODE_GPENCIL_PAINT: return ePaintGpencil; case CTX_MODE_PAINT_TEXTURE: - return ePaintTextureProjective; + return ePaintTexture3D; } } else if (tref->space_type == SPACE_IMAGE) { @@ -405,7 +405,7 @@ uint BKE_paint_get_brush_tool_offset_from_paintmode(const ePaintMode mode) { switch (mode) { case ePaintTexture2D: - case ePaintTextureProjective: + case ePaintTexture3D: return offsetof(Brush, imagepaint_tool); case ePaintSculpt: return offsetof(Brush, sculpt_tool); @@ -627,7 +627,7 @@ eObjectMode BKE_paint_object_mode_from_paintmode(ePaintMode mode) case ePaintWeight: return OB_MODE_WEIGHT_PAINT; case ePaintTexture2D: - case ePaintTextureProjective: + case ePaintTexture3D: return OB_MODE_TEXTURE_PAINT; case ePaintSculptUV: return OB_MODE_EDIT; diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 79d0c9852de..5bcacca9214 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -1697,7 +1697,7 @@ static int ui_id_brush_get_icon(const bContext *C, ID *id) paint_mode = ePaintWeight; } else if (ob->mode & OB_MODE_TEXTURE_PAINT) { - paint_mode = ePaintTextureProjective; + paint_mode = ePaintTexture3D; } } else if (space_type == SPACE_IMAGE) { diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c index 294981e7303..dfad5afc9dc 100644 --- a/source/blender/editors/sculpt_paint/paint_cursor.c +++ b/source/blender/editors/sculpt_paint/paint_cursor.c @@ -802,7 +802,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(); gpuPushAttrib(GPU_DEPTH_BUFFER_BIT | GPU_BLEND_BIT); @@ -1033,7 +1033,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 3213ee005cf..90e068ab17a 100644 --- a/source/blender/editors/sculpt_paint/paint_curve.c +++ b/source/blender/editors/sculpt_paint/paint_curve.c @@ -661,7 +661,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 4bd625c3cc6..e528c64b6e2 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -919,7 +919,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); @@ -959,7 +959,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); @@ -993,7 +993,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: @@ -1130,7 +1130,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); BKE_paint_toolslots_brush_validate(bmain, &imapaint->paint); diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c index 9bad1324aa6..136a6c9c664 100644 --- a/source/blender/editors/sculpt_paint/paint_ops.c +++ b/source/blender/editors/sculpt_paint/paint_ops.c @@ -252,7 +252,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; } @@ -488,7 +488,7 @@ static void PAINT_OT_brush_select(wmOperatorType *ot) {ePaintSculpt, "SCULPT", ICON_SCULPTMODE_HLT, "Sculpt", ""}, {ePaintVertex, "VERTEX_PAINT", ICON_VPAINT_HLT, "Vertex Paint", ""}, {ePaintWeight, "WEIGHT_PAINT", ICON_WPAINT_HLT, "Weight Paint", ""}, - {ePaintTextureProjective, "TEXTURE_PAINT", ICON_TPAINT_HLT, "Texture Paint", ""}, + {ePaintTexture3D, "TEXTURE_PAINT", ICON_TPAINT_HLT, "Texture Paint", ""}, {ePaintGpencil, "GPENCIL_PAINT", ICON_GREASEPENCIL, "Grease Pencil Paint", ""}, {0, NULL, 0, NULL, NULL} }; diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c index a1ae32f2e9a..e31a2617238 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -459,7 +459,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)); @@ -862,7 +862,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)) { @@ -898,7 +898,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 f369c0a323e..150ad998dea 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -618,7 +618,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; @@ -649,7 +649,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: |