diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2013-03-31 15:04:13 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2013-03-31 15:04:13 +0400 |
commit | 514c449a549662a29507f3a3d1eaabd7e216ea94 (patch) | |
tree | 69dc0385a50584fb78bfb4a86ee19ad77e97b049 | |
parent | e8d532f1dde96c40c1407d39260724fcfee0b606 (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.
-rw-r--r-- | release/scripts/startup/bl_ui/space_image.py | 5 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d_toolbar.py | 5 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_cursor.c | 6 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image_proj.c | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_brush_types.h | 3 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_brush.c | 15 |
6 files changed, 11 insertions, 25 deletions
diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py index 488f2bddd90..3537ca62d93 100644 --- a/release/scripts/startup/bl_ui/space_image.py +++ b/release/scripts/startup/bl_ui/space_image.py @@ -739,11 +739,6 @@ class IMAGE_PT_tools_mask_texture(BrushButtonsPanel, Panel): bl_label = "Texture Mask" bl_options = {'DEFAULT_CLOSED'} - def draw_header(self, context): - brush = context.tool_settings.image_paint.brush - tex_slot_alpha = brush.mask_texture_slot - self.layout.prop(brush, 'use_mask', text="") - def draw(self, context): layout = self.layout diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index efeb4ff0f1c..aa90b093c26 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -779,11 +779,6 @@ class VIEW3D_PT_tools_mask_texture(View3DPanel, Panel): brush = context.tool_settings.image_paint.brush return (context.image_paint_object and brush and brush.image_tool != 'SOFTEN') - def draw_header(self, context): - brush = context.tool_settings.image_paint.brush - tex_slot_alpha = brush.mask_texture_slot - self.layout.prop(brush, 'use_mask', text="") - def draw(self, context): layout = self.layout 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); |