Matches ePaintTexture2D, less verbose.
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
case ePaintWeight:
return &ts->wpaint->paint;
case ePaintTexture2D:
- case ePaintTextureProjective:
+ case ePaintTexture3D:
return &ts->imapaint.paint;
case ePaintSculptUV:
return &ts->uvsculpt->paint;
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;
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;
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? */
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;
switch (mode) {
case ePaintTexture2D:
- case ePaintTextureProjective:
+ case ePaintTexture3D:
name = "PAINT_OT_image_paint";
break;
case ePaintWeight:
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);
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);
}
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:
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);
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;
}
/* 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));
break;
case ePaintTexture2D: /* fall through */
- case ePaintTextureProjective:
+ case ePaintTexture3D:
if ((br->imagepaint_tool == PAINT_TOOL_FILL) &&
(br->flag & BRUSH_USE_GRADIENT))
{
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) */
}
case ePaintTexture2D:
- case ePaintTextureProjective:
+ case ePaintTexture3D:
switch (me->imagepaint_tool) {
case PAINT_TOOL_SOFTEN:
return prop_soften_sharpen_items;
switch (mode) {
case ePaintSculpt:
case ePaintTexture2D:
- case ePaintTextureProjective:
+ case ePaintTexture3D:
return sculpt_stroke_method_items;
default: