Revision: 48291
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48291
Author:   psy-fi
Date:     2012-06-25 21:22:36 +0000 (Mon, 25 Jun 2012)
Log Message:
-----------
Cleanup: Setting to use mask texture. Only expose texture option if the
option is ticked.

Modified Paths:
--------------
    
branches/soc-2012-bratwurst/release/scripts/startup/bl_ui/space_view3d_toolbar.py
    
branches/soc-2012-bratwurst/source/blender/editors/sculpt_paint/paint_image.c
    branches/soc-2012-bratwurst/source/blender/makesdna/DNA_brush_types.h
    branches/soc-2012-bratwurst/source/blender/makesrna/intern/rna_brush.c

Modified: 
branches/soc-2012-bratwurst/release/scripts/startup/bl_ui/space_view3d_toolbar.py
===================================================================
--- 
branches/soc-2012-bratwurst/release/scripts/startup/bl_ui/space_view3d_toolbar.py
   2012-06-25 21:08:45 UTC (rev 48290)
+++ 
branches/soc-2012-bratwurst/release/scripts/startup/bl_ui/space_view3d_toolbar.py
   2012-06-25 21:22:36 UTC (rev 48291)
@@ -730,8 +730,10 @@
 
         col.template_ID_preview(brush, "texture", new="texture.new", rows=3, 
cols=8)
         if context.image_paint_object:
-            col.label(text='Mask Texture')
-            col.template_ID_preview(brush, "mask_texture", new="texture.new", 
rows=3, cols=8)
+            col.prop(brush, 'use_mask')
+            if brush.use_mask:
+                col.template_ID_preview(brush, "mask_texture", 
new="texture.new", rows=3, cols=8)
+
         if brush.use_paint_image:
             col.prop(brush, "use_fixed_texture")
 

Modified: 
branches/soc-2012-bratwurst/source/blender/editors/sculpt_paint/paint_image.c
===================================================================
--- 
branches/soc-2012-bratwurst/source/blender/editors/sculpt_paint/paint_image.c   
    2012-06-25 21:08:45 UTC (rev 48290)
+++ 
branches/soc-2012-bratwurst/source/blender/editors/sculpt_paint/paint_image.c   
    2012-06-25 21:22:36 UTC (rev 48291)
@@ -4787,7 +4787,7 @@
 
        ps->is_airbrush = (brush->flag & BRUSH_AIRBRUSH) ? 1 : 0;
        ps->is_texbrush = (brush->mtex.tex) ? TRUE : FALSE;
-       ps->is_maskbrush = (brush->mask_mtex.tex) ? TRUE : FALSE;
+       ps->is_maskbrush = (brush->flag & BRUSH_USE_MASK && 
brush->mask_mtex.tex) ? TRUE : FALSE;
 
 
        /* these can be NULL */

Modified: branches/soc-2012-bratwurst/source/blender/makesdna/DNA_brush_types.h
===================================================================
--- branches/soc-2012-bratwurst/source/blender/makesdna/DNA_brush_types.h       
2012-06-25 21:08:45 UTC (rev 48290)
+++ branches/soc-2012-bratwurst/source/blender/makesdna/DNA_brush_types.h       
2012-06-25 21:22:36 UTC (rev 48291)
@@ -141,7 +141,8 @@
 
        /* temporary flag which sets up automatically for correct brush
         * drawing when inverted modal operator is running */
-       BRUSH_INVERTED = (1 << 29)
+       BRUSH_INVERTED = (1 << 29),
+       BRUSH_USE_MASK = (1 << 30)
 } BrushFlags;
 
 /* Brush.sculpt_tool */

Modified: branches/soc-2012-bratwurst/source/blender/makesrna/intern/rna_brush.c
===================================================================
--- branches/soc-2012-bratwurst/source/blender/makesrna/intern/rna_brush.c      
2012-06-25 21:08:45 UTC (rev 48290)
+++ branches/soc-2012-bratwurst/source/blender/makesrna/intern/rna_brush.c      
2012-06-25 21:22:36 UTC (rev 48291)
@@ -866,6 +866,11 @@
        RNA_def_property_ui_text(prop, "Fixed Texture", "Keep texture origin in 
fixed position");
        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);

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to