[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48872] branches/soc-2012-bratwurst/ release/scripts/startup/bl_ui/space_view3d_toolbar.py: python refactoring: separate mask texture properties to their own panel.

Antony Riakiotakis kalast at gmail.com
Thu Jul 12 21:11:39 CEST 2012


Revision: 48872
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48872
Author:   psy-fi
Date:     2012-07-12 19:11:38 +0000 (Thu, 12 Jul 2012)
Log Message:
-----------
python refactoring: separate mask texture properties to their own panel.
Also remove 'Fixed Texture' property from 3D toolbar as it is only
relevant for 2D painting

Modified Paths:
--------------
    branches/soc-2012-bratwurst/release/scripts/startup/bl_ui/space_view3d_toolbar.py

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-07-12 18:43:07 UTC (rev 48871)
+++ branches/soc-2012-bratwurst/release/scripts/startup/bl_ui/space_view3d_toolbar.py	2012-07-12 19:11:38 UTC (rev 48872)
@@ -715,8 +715,7 @@
     @classmethod
     def poll(cls, context):
         settings = cls.paint_settings(context)
-        return (settings and settings.brush and (context.sculpt_object or
-                             context.image_paint_object))
+        return (settings and settings.brush and (context.sculpt_object or context.image_paint_object))
 
     def draw(self, context):
         layout = self.layout
@@ -729,14 +728,7 @@
         col = layout.column()
 
         col.template_ID_preview(brush, "texture", new="texture.new", rows=3, cols=8)
-        if context.image_paint_object:
-            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")
-
         if context.sculpt_object or context.image_paint_object:
             brush_texture_settings(col, brush, context.sculpt_object)
 
@@ -754,6 +746,48 @@
             sub.prop(brush, "texture_overlay_alpha", text="Alpha")
 
 
+class VIEW3D_PT_tools_mask_texture(View3DPanel, Panel):
+    bl_context = "imagepaint"
+    bl_label = "Texture Mask"
+    bl_options = {'DEFAULT_CLOSED'}
+
+    @classmethod
+    def poll(cls, context):
+        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
+
+        brush = context.tool_settings.image_paint.brush
+        tex_slot_alpha = brush.mask_texture_slot
+
+        col = layout.column()
+
+        col.template_ID_preview(brush, "mask_texture", new="texture.new", rows=3, cols=8)
+
+        brush_texture_settings(col, brush, context.sculpt_object)
+
+        # use_texture_overlay and texture_overlay_alpha
+        col = layout.column(align=True)
+        col.active = brush.paint_capabilities.has_overlay
+        col.label(text="Overlay:")
+
+        row = col.row()
+        if brush.use_texture_overlay:
+            row.prop(brush, "use_texture_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF')
+        else:
+            row.prop(brush, "use_texture_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
+        sub = row.row()
+        sub.prop(brush, "texture_overlay_alpha", text="Alpha")
+
+
+
 class VIEW3D_PT_tools_brush_stroke(Panel, View3DPaintPanel):
     bl_label = "Stroke"
     bl_options = {'DEFAULT_CLOSED'}
@@ -1049,6 +1083,7 @@
 # ********** default tools for texture-paint ****************
 
 
+
 class VIEW3D_PT_tools_projectpaint(View3DPanel, Panel):
     bl_context = "imagepaint"
     bl_label = "Project Paint"




More information about the Bf-blender-cvs mailing list