[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59649] branches/soc-2013-paint/release/ scripts/startup/bl_ui/space_view3d_toolbar.py: Separate paint layer options to their own panel and put it above the

Antony Riakiotakis kalast at gmail.com
Fri Aug 30 01:31:30 CEST 2013


Revision: 59649
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59649
Author:   psy-fi
Date:     2013-08-29 23:31:30 +0000 (Thu, 29 Aug 2013)
Log Message:
-----------
Separate paint layer options to their own panel and put it above the
brush panel. Not sure if it's the best place to place this, will gather
artist feedback about placement

Modified Paths:
--------------
    branches/soc-2013-paint/release/scripts/startup/bl_ui/space_view3d_toolbar.py

Modified: branches/soc-2013-paint/release/scripts/startup/bl_ui/space_view3d_toolbar.py
===================================================================
--- branches/soc-2013-paint/release/scripts/startup/bl_ui/space_view3d_toolbar.py	2013-08-29 22:48:37 UTC (rev 59648)
+++ branches/soc-2013-paint/release/scripts/startup/bl_ui/space_view3d_toolbar.py	2013-08-29 23:31:30 UTC (rev 59649)
@@ -505,6 +505,46 @@
     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
+
+        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")
+
+
 class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
     bl_label = "Brush"
 
@@ -1216,21 +1256,7 @@
 
 # ********** default tools for texture-paint ****************
 
-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_tools_projectpaint(View3DPanel, Panel):
     bl_context = "imagepaint"
     bl_label = "Project Paint"
@@ -1251,15 +1277,6 @@
 
         col = layout.column()
 
-        if ob:
-            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.prop(ipaint, "input_samples")
 
         col.prop(ipaint, "use_occlude")




More information about the Bf-blender-cvs mailing list