Cleanup: renmae ePaintTexture(Projective) -> 3D
Matches ePaintTexture2D, less verbose.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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) */
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user