[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60627] trunk/blender/release/scripts/ startup/bl_ui: Segregate all paint cursor overlay options under their own " Overlay"

Antony Riakiotakis kalast at gmail.com
Wed Oct 9 16:57:48 CEST 2013


Revision: 60627
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60627
Author:   psy-fi
Date:     2013-10-09 14:57:48 +0000 (Wed, 09 Oct 2013)
Log Message:
-----------
Segregate all paint cursor overlay options under their own "Overlay"
panel in paint modes. Also expose all options of mask textures in the
mask texture panel, even if there is no texture, just like regular
textures are presented.

Modified Paths:
--------------
    trunk/blender/release/scripts/startup/bl_ui/properties_paint_common.py
    trunk/blender/release/scripts/startup/bl_ui/space_image.py
    trunk/blender/release/scripts/startup/bl_ui/space_view3d_toolbar.py

Modified: trunk/blender/release/scripts/startup/bl_ui/properties_paint_common.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/properties_paint_common.py	2013-10-09 14:35:25 UTC (rev 60626)
+++ trunk/blender/release/scripts/startup/bl_ui/properties_paint_common.py	2013-10-09 14:57:48 UTC (rev 60627)
@@ -134,13 +134,12 @@
             layout.operator("brush.stencil_fit_image_aspect").mask = True
         layout.operator("brush.stencil_reset_transform").mask = True
 
-    if brush.mask_texture:
-        col = layout.column()
-        col.label(text="Angle:")
-        col.active = brush.brush_capabilities.has_texture_angle
-        col.prop(mask_tex_slot, "angle", text="")
+    col = layout.column()
+    col.label(text="Angle:")
+    col.active = brush.brush_capabilities.has_texture_angle
+    col.prop(mask_tex_slot, "angle", text="")
 
-        # scale and offset
-        split = layout.split()
-        split.prop(mask_tex_slot, "offset")
-        split.prop(mask_tex_slot, "scale")
+    # scale and offset
+    split = layout.split()
+    split.prop(mask_tex_slot, "offset")
+    split.prop(mask_tex_slot, "scale")

Modified: trunk/blender/release/scripts/startup/bl_ui/space_image.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_image.py	2013-10-09 14:35:25 UTC (rev 60626)
+++ trunk/blender/release/scripts/startup/bl_ui/space_image.py	2013-10-09 14:57:48 UTC (rev 60627)
@@ -715,8 +715,8 @@
                 col.prop(brush, "clone_alpha", text="Alpha")
 
 
-class IMAGE_PT_tools_brush_texture(BrushButtonsPanel, Panel):
-    bl_label = "Texture"
+class IMAGE_PT_tools_brush_overlay(BrushButtonsPanel, Panel):
+    bl_label = "Overlay"
     bl_options = {'DEFAULT_CLOSED'}
 
     def draw(self, context):
@@ -725,17 +725,24 @@
         toolsettings = context.tool_settings.image_paint
         brush = toolsettings.brush
         tex_slot = brush.texture_slot
+        tex_slot_mask = brush.mask_texture_slot
 
         col = layout.column()
-        col.template_ID_preview(brush, "texture", new="texture.new", rows=3, cols=8)
+        
+        col.label(text="Curve:")
 
-        brush_texture_settings(col, brush, 0)
+        row = col.row(align=True)
+        if brush.use_cursor_overlay:
+            row.prop(brush, "use_cursor_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF')
+        else:
+            row.prop(brush, "use_cursor_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
 
-        # use_texture_overlay and texture_overlay_alpha
-        col = layout.column(align=True)
+        sub = row.row(align=True)
+        sub.prop(brush, "cursor_overlay_alpha", text="Alpha")
+        sub.prop(brush, "use_cursor_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
+
         col.active = brush.brush_capabilities.has_overlay
-        col.label(text="Overlay:")
-
+        col.label(text="Texture:")
         row = col.row(align=True)
         if tex_slot.map_mode != 'STENCIL':
             if brush.use_primary_overlay:
@@ -747,7 +754,37 @@
         sub.prop(brush, "texture_overlay_alpha", text="Alpha")
         sub.prop(brush, "use_primary_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
 
+        col.label(text="Mask Texture:")
 
+        row = col.row(align=True)
+        if tex_slot_mask.map_mode != 'STENCIL':
+            if brush.use_secondary_overlay:
+                row.prop(brush, "use_secondary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF')
+            else:
+                row.prop(brush, "use_secondary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
+
+        sub = row.row(align=True)
+        sub.prop(brush, "mask_overlay_alpha", text="Alpha")
+        sub.prop(brush, "use_secondary_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
+
+
+class IMAGE_PT_tools_brush_texture(BrushButtonsPanel, Panel):
+    bl_label = "Texture"
+    bl_options = {'DEFAULT_CLOSED'}
+
+    def draw(self, context):
+        layout = self.layout
+
+        toolsettings = context.tool_settings.image_paint
+        brush = toolsettings.brush
+        tex_slot = brush.texture_slot
+
+        col = layout.column()
+        col.template_ID_preview(brush, "texture", new="texture.new", rows=3, cols=8)
+
+        brush_texture_settings(col, brush, 0)
+
+
 class IMAGE_PT_tools_mask_texture(BrushButtonsPanel, Panel):
     bl_label = "Texture Mask"
     bl_options = {'DEFAULT_CLOSED'}
@@ -764,22 +801,7 @@
 
         brush_mask_texture_settings(col, brush)
 
-        col = layout.column(align=True)
-        col.active = brush.brush_capabilities.has_overlay
-        col.label(text="Overlay:")
 
-        row = col.row(align=True)
-        if tex_slot_alpha.map_mode != 'STENCIL':
-            if brush.use_secondary_overlay:
-                row.prop(brush, "use_secondary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF')
-            else:
-                row.prop(brush, "use_secondary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
-
-        sub = row.row(align=True)
-        sub.prop(brush, "mask_overlay_alpha", text="Alpha")
-        sub.prop(brush, "use_secondary_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
-
-
 class IMAGE_PT_tools_brush_tool(BrushButtonsPanel, Panel):
     bl_label = "Tool"
     bl_options = {'DEFAULT_CLOSED'}

Modified: trunk/blender/release/scripts/startup/bl_ui/space_view3d_toolbar.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_view3d_toolbar.py	2013-10-09 14:35:25 UTC (rev 60626)
+++ trunk/blender/release/scripts/startup/bl_ui/space_view3d_toolbar.py	2013-10-09 14:57:48 UTC (rev 60627)
@@ -673,19 +673,6 @@
                     col.prop(brush, "use_persistent")
                     col.operator("sculpt.set_persistent_base")
 
-            col = layout.column(align=True)
-            col.label(text="Overlay:")
-
-            row = col.row(align=True)
-            if brush.use_cursor_overlay:
-                row.prop(brush, "use_cursor_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF')
-            else:
-                row.prop(brush, "use_cursor_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
-
-            sub = row.row(align=True)
-            sub.prop(brush, "cursor_overlay_alpha", text="Alpha")
-            sub.prop(brush, "use_cursor_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
-
         # Texture Paint Mode #
 
         elif context.image_paint_object and brush:
@@ -709,19 +696,6 @@
             col.active = (brush.blend not in {'ERASE_ALPHA', 'ADD_ALPHA'})
             col.prop(brush, "use_alpha")
 
-            col = layout.column(align=True)
-            col.label(text="Overlay:")
-
-            row = col.row(align=True)
-            if brush.use_cursor_overlay:
-                row.prop(brush, "use_cursor_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF')
-            else:
-                row.prop(brush, "use_cursor_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
-
-            sub = row.row(align=True)
-            sub.prop(brush, "cursor_overlay_alpha", text="Alpha")
-            sub.prop(brush, "use_cursor_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
-
         # Weight Paint Mode #
         elif context.weight_paint_object and brush:
 
@@ -765,18 +739,58 @@
 
             col.prop(brush, "vertex_tool", text="Blend")
 
-            col = layout.column(align=True)
-            col.label(text="Overlay:")
+class IMAGE_PT_tools_brush_overlay(View3DPaintPanel, Panel):
+    bl_label = "Overlay"
+    bl_options = {'DEFAULT_CLOSED'}
 
-            row = col.row(align=True)
-            if brush.use_cursor_overlay:
-                row.prop(brush, "use_cursor_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF')
+    def draw(self, context):
+        layout = self.layout
+
+        toolsettings = context.tool_settings.image_paint
+        brush = toolsettings.brush
+        tex_slot = brush.texture_slot
+        tex_slot_mask = brush.mask_texture_slot
+
+        col = layout.column()
+        
+        col.label(text="Curve:")
+
+        row = col.row(align=True)
+        if brush.use_cursor_overlay:
+            row.prop(brush, "use_cursor_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF')
+        else:
+            row.prop(brush, "use_cursor_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
+
+        sub = row.row(align=True)
+        sub.prop(brush, "cursor_overlay_alpha", text="Alpha")
+        sub.prop(brush, "use_cursor_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
+
+        col.active = brush.brush_capabilities.has_overlay
+        col.label(text="Texture:")
+        row = col.row(align=True)
+        if tex_slot.map_mode != 'STENCIL':
+            if brush.use_primary_overlay:
+                row.prop(brush, "use_primary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF')
             else:
-                row.prop(brush, "use_cursor_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
+                row.prop(brush, "use_primary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
 
+        sub = row.row(align=True)
+        sub.prop(brush, "texture_overlay_alpha", text="Alpha")
+        sub.prop(brush, "use_primary_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
+
+        if context.image_paint_object:
+            col.label(text="Mask Texture:")
+
+            row = col.row(align=True)
+            if tex_slot_mask.map_mode != 'STENCIL':
+                if brush.use_secondary_overlay:
+                    row.prop(brush, "use_secondary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_OFF')
+                else:
+                    row.prop(brush, "use_secondary_overlay", toggle=True, text="", icon='RESTRICT_VIEW_ON')
+
             sub = row.row(align=True)
-            sub.prop(brush, "cursor_overlay_alpha", text="Alpha")
-            sub.prop(brush, "use_cursor_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
+            sub.prop(brush, "mask_overlay_alpha", text="Alpha")
+            sub.prop(brush, "use_secondary_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
 
 
 class VIEW3D_PT_tools_brush_texture(Panel, View3DPaintPanel):
@@ -802,23 +816,7 @@
 

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list