UI cleanup:
authorAntony Riakiotakis <kalast@gmail.com>
Sun, 31 Mar 2013 11:04:13 +0000 (11:04 +0000)
committerAntony Riakiotakis <kalast@gmail.com>
Sun, 31 Mar 2013 11:04:13 +0000 (11:04 +0000)
* 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.

release/scripts/startup/bl_ui/space_image.py
release/scripts/startup/bl_ui/space_view3d_toolbar.py
source/blender/editors/sculpt_paint/paint_cursor.c
source/blender/editors/sculpt_paint/paint_image_proj.c
source/blender/makesdna/DNA_brush_types.h
source/blender/makesrna/intern/rna_brush.c

index 488f2bddd90d09fdee768e0fa560af8d3edabb9b..3537ca62d93bd7cb47386950482976fcf3f54734 100644 (file)
@@ -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
 
index efeb4ff0f1ce9f060d8cdc37a45a771d60314558..aa90b093c2614962b8e265fb6b19c0566b861e58 100644 (file)
@@ -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
 
index dd07da6a16f3aace34e5f91b5e2a5fa31e824352..80cce81e1527ee2d210aa6ac1470a2cb9ec19209 100644 (file)
@@ -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;
        }
index 5dcfa181fa240c3967db01f9ed5f8aed90511ca1..a2101305b4b1a613696c84470ce05cbd941ec8da 100644 (file)
@@ -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*/
index 29081f96867da9c2fa54d2e8939287e179578908..11dd68bb11b63cc79648fbf3c9400a0c422323f6 100644 (file)
@@ -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 */
index fc46440d8cc856ae681f55ce0a2b9f4a27df373a..8946274fc381650c9612a06e9dff9b077a0f300f 100644 (file)
@@ -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);