Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2013-03-31 15:04:13 +0400
committerAntony Riakiotakis <kalast@gmail.com>2013-03-31 15:04:13 +0400
commit514c449a549662a29507f3a3d1eaabd7e216ea94 (patch)
tree69dc0385a50584fb78bfb4a86ee19ad77e97b049 /source/blender
parente8d532f1dde96c40c1407d39260724fcfee0b606 (diff)
UI cleanup:
* Using masking is determined only by the presence of the texture, remove extraneous DNA flag (might cause issues later but in practice brush options are not harmful) * Overlay and angle sliders are active during stencil mapped brushes * Only draw the overlay if there's a texture.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/sculpt_paint/paint_cursor.c6
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_proj.c2
-rw-r--r--source/blender/makesdna/DNA_brush_types.h3
-rw-r--r--source/blender/makesrna/intern/rna_brush.c15
4 files changed, 11 insertions, 15 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c
index dd07da6a16f..80cce81e152 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -424,9 +424,9 @@ static void paint_draw_alpha_overlay(UnifiedPaintSettings *ups, Brush *brush,
bool col;
/* check for overlay mode */
- if (brush->mtex.brush_map_mode != MTEX_MAP_MODE_STENCIL &&
- (!(brush->flag & BRUSH_TEXTURE_OVERLAY) ||
- !ELEM(brush->mtex.brush_map_mode, MTEX_MAP_MODE_VIEW, MTEX_MAP_MODE_TILED)))
+ if (!((brush->mtex.brush_map_mode == MTEX_MAP_MODE_STENCIL && brush->mtex.tex) ||
+ ((brush->flag & BRUSH_TEXTURE_OVERLAY) &&
+ ELEM(brush->mtex.brush_map_mode, MTEX_MAP_MODE_VIEW, MTEX_MAP_MODE_TILED))))
{
return;
}
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index 5dcfa181fa2..a2101305b4b 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -4160,7 +4160,7 @@ static void project_state_init(bContext *C, Object *ob, ProjPaintState *ps, int
/* disable for 3d mapping also because painting on mirrored mesh can create "stripes" */
ps->do_masking = (brush->flag & BRUSH_AIRBRUSH || brush->mtex.brush_map_mode != MTEX_MAP_MODE_TILED) ? false : true;
ps->is_texbrush = (brush->mtex.tex && brush->imagepaint_tool == PAINT_TOOL_DRAW) ? true : false;
- ps->is_maskbrush = (brush->flag & BRUSH_USE_MASK && brush->mask_mtex.tex) ? true : false;
+ ps->is_maskbrush = (brush->mask_mtex.tex) ? true : false;
}
else {
/* brush may be NULL*/
diff --git a/source/blender/makesdna/DNA_brush_types.h b/source/blender/makesdna/DNA_brush_types.h
index 29081f96867..11dd68bb11b 100644
--- a/source/blender/makesdna/DNA_brush_types.h
+++ b/source/blender/makesdna/DNA_brush_types.h
@@ -144,8 +144,7 @@ typedef enum BrushFlags {
/* temporary flag which sets up automatically for correct brush
* drawing when inverted modal operator is running */
BRUSH_INVERTED = (1 << 29),
- BRUSH_ABSOLUTE_JITTER = (1 << 30),
- BRUSH_USE_MASK = (1 << 31)
+ BRUSH_ABSOLUTE_JITTER = (1 << 30)
} BrushFlags;
/* Brush.sculpt_tool */
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index fc46440d8cc..8946274fc38 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -145,9 +145,10 @@ static int rna_SculptToolCapabilities_has_normal_weight_get(PointerRNA *ptr)
static int rna_BrushCapabilities_has_overlay_get(PointerRNA *ptr)
{
Brush *br = (Brush *)ptr->data;
- return ELEM(br->mtex.brush_map_mode,
+ return ELEM3(br->mtex.brush_map_mode,
MTEX_MAP_MODE_VIEW,
- MTEX_MAP_MODE_TILED);
+ MTEX_MAP_MODE_TILED,
+ MTEX_MAP_MODE_STENCIL);
}
static int rna_SculptToolCapabilities_has_persistence_get(PointerRNA *ptr)
@@ -237,10 +238,11 @@ static int rna_SculptToolCapabilities_has_strength_get(PointerRNA *ptr)
static int rna_BrushCapabilities_has_texture_angle_get(PointerRNA *ptr)
{
Brush *br = (Brush *)ptr->data;
- return ELEM3(br->mtex.brush_map_mode,
+ return ELEM4(br->mtex.brush_map_mode,
MTEX_MAP_MODE_VIEW,
MTEX_MAP_MODE_AREA,
- MTEX_MAP_MODE_TILED);
+ MTEX_MAP_MODE_TILED,
+ MTEX_MAP_MODE_STENCIL);
}
static int rna_BrushCapabilities_has_texture_angle_source_get(PointerRNA *ptr)
@@ -929,11 +931,6 @@ static void rna_def_brush(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Restore Mesh", "Allow a single dot to be carefully positioned");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- prop = RNA_def_property(srna, "use_mask", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_USE_MASK);
- RNA_def_property_ui_text(prop, "Mask Texture", "Use a texture as mask for the brush");
- RNA_def_property_update(prop, 0, "rna_Brush_update");
-
/* only for projection paint, TODO, other paint modes */
prop = RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", BRUSH_LOCK_ALPHA);