[Bf-blender-cvs] [655c790] soc-2013-paint: move layers to their own panel

Antony Riakiotakis noreply at git.blender.org
Wed Mar 5 21:35:14 CET 2014


Commit: 655c790c90914c639fc7d51a00b1965654304a6f
Author: Antony Riakiotakis
Date:   Wed Mar 5 22:34:54 2014 +0200
https://developer.blender.org/rB655c790c90914c639fc7d51a00b1965654304a6f

move layers to their own panel

===================================================================

M	release/scripts/startup/bl_ui/space_view3d_toolbar.py

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 8033594..79c1851 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -731,54 +731,6 @@ class View3DPaintPanel(UnifiedPaintPanel):
     bl_region_type = 'TOOLS'
 
 
-class TEXTURE_UL_texpaintslots(UIList):
-    def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
-        # assert(isinstance(item, bpy.types.MaterialTextureSlot)
-        ma = data
-        slot = item
-        tex = slot.texture if slot else None
-
-        if self.layout_type in {'DEFAULT', 'COMPACT'}:
-            # layout.label(text=tex.image.name, translate=False)
-            layout.label(text=tex.name, translate=False, icon_value=icon)
-        elif self.layout_type in {'GRID'}:
-            layout.alignment = 'CENTER'
-            layout.label(text="")
-
-
-class VIEW3D_PT_layers_projectpaint(View3DPanel, Panel):
-    bl_context = "imagepaint"
-    bl_label = "Layers"
-
-    @classmethod
-    def poll(cls, context):
-        brush = context.tool_settings.image_paint.brush
-        ob = context.active_object
-        return (brush is not None and ob is not None)
-
-    def draw(self, context):
-        layout = self.layout
-
-        settings = context.tool_settings.image_paint
-
-        ob = context.active_object
-        col = layout.column()
-
-        col.label("Materials")
-        col.template_list("MATERIAL_UL_matslots", "", ob, "material_slots", ob, "active_material_index", rows=2)
-        mat = ob.active_material;
-        if mat:
-            col.label("Available Paint layers")
-            col.template_list("TEXTURE_UL_texpaintslots", "", mat, "texture_paint_slots", mat, "active_paint_texture_index", rows=2)
-            #col.label("Only slots with UV mapping and image textures are available")
-            
-            col.operator_menu_enum("paint.add_layer", "type")
-        
-        row = col.row(align=True)
-        row.prop(settings, "new_layer_xresolution")
-        row.prop(settings, "new_layer_yresolution")
-
-
 class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
     bl_category = "Tools"
     bl_label = "Brush"
@@ -1063,6 +1015,55 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
             col.prop(brush, "vertex_tool", text="Blend")
 
 
+class TEXTURE_UL_texpaintslots(UIList):
+    def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
+        # assert(isinstance(item, bpy.types.MaterialTextureSlot)
+        ma = data
+        slot = item
+        tex = slot.texture if slot else None
+
+        if self.layout_type in {'DEFAULT', 'COMPACT'}:
+            # layout.label(text=tex.image.name, translate=False)
+            layout.label(text=tex.name, translate=False, icon_value=icon)
+        elif self.layout_type in {'GRID'}:
+            layout.alignment = 'CENTER'
+            layout.label(text="")
+
+
+class VIEW3D_PT_layers_projectpaint(View3DPanel, Panel):
+    bl_context = "imagepaint"
+    bl_label = "Layers"
+    bl_category = "Layers"
+
+    @classmethod
+    def poll(cls, context):
+        brush = context.tool_settings.image_paint.brush
+        ob = context.active_object
+        return (brush is not None and ob is not None)
+
+    def draw(self, context):
+        layout = self.layout
+
+        settings = context.tool_settings.image_paint
+
+        ob = context.active_object
+        col = layout.column()
+
+        col.label("Materials")
+        col.template_list("MATERIAL_UL_matslots", "", ob, "material_slots", ob, "active_material_index", rows=2)
+        mat = ob.active_material;
+        if mat:
+            col.label("Available Paint layers")
+            col.template_list("TEXTURE_UL_texpaintslots", "", mat, "texture_paint_slots", mat, "active_paint_texture_index", rows=2)
+            #col.label("Only slots with UV mapping and image textures are available")
+            
+            col.operator_menu_enum("paint.add_layer", "type")
+        
+        row = col.row(align=True)
+        row.prop(settings, "new_layer_xresolution")
+        row.prop(settings, "new_layer_yresolution")
+
+
 class VIEW3D_PT_tools_brush_overlay(Panel, View3DPaintPanel):
     bl_category = "Options"
     bl_label = "Overlay"




More information about the Bf-blender-cvs mailing list