[Bf-blender-cvs] [86059f0] master: Make clone tool UI slightly less horrible.

Antony Riakiotakis noreply at git.blender.org
Mon Jul 21 19:25:29 CEST 2014


Commit: 86059f03eb60bf3d37e8501ef278d4b090a86ae6
Author: Antony Riakiotakis
Date:   Mon Jul 21 19:24:03 2014 +0200
Branches: master
https://developer.blender.org/rB86059f03eb60bf3d37e8501ef278d4b090a86ae6

Make clone tool UI slightly less horrible.

Move clone tool options as well as layer selection to the brush panel.
That should make its use more apparent and, most importantly, easy.

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

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

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

diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py
index 8359ae6..80f7db3 100644
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@ -86,7 +86,7 @@ class UnifiedPaintPanel():
         parent.template_color_picker(ptr, prop_name, value_slider=value_slider)
 
 
-def brush_texpaint_common(panel, context, layout, brush, settings):
+def brush_texpaint_common(panel, context, layout, brush, settings, projpaint=False):
     capabilities = brush.image_paint_capabilities
 
     col = layout.column()
@@ -137,8 +137,31 @@ def brush_texpaint_common(panel, context, layout, brush, settings):
 
     elif brush.image_tool == 'CLONE':
         col.separator()
-        col.prop(brush, "clone_image", text="Image")
-        col.prop(brush, "clone_alpha", text="Alpha")
+        if projpaint:
+            col.prop(settings, "use_clone_layer", text="Clone from paint slot")
+
+            if settings.use_clone_layer:
+                ob = context.active_object
+                col = layout.column()
+
+                if len(ob.material_slots) > 1:
+                    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("Clone Slot")
+                    col.template_list("TEXTURE_UL_texpaintslots", "",
+                                      mat, "texture_paint_slots",
+                                      mat, "paint_clone_slot", rows=2)
+
+        else:
+            col.prop(brush, "clone_image", text="Image")
+            col.prop(brush, "clone_alpha", text="Alpha")
+
+
 
     col.separator()
 
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 99b2b85..256110a 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -982,7 +982,7 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel):
         # Texture Paint Mode #
 
         elif context.image_paint_object and brush:
-            brush_texpaint_common(self, context, layout, brush, settings)
+            brush_texpaint_common(self, context, layout, brush, settings, True)
 
         # Weight Paint Mode #
         elif context.weight_paint_object and brush:
@@ -1087,12 +1087,6 @@ class VIEW3D_PT_slots_projectpaint(View3DPanel, Panel):
                 row.prop(settings, "slot_yresolution_default")
                 col.prop(settings, "slot_color_default")
 
-            if brush.image_tool == 'CLONE' and settings.use_clone_layer:
-                col.label("Clone Slot")
-                col.template_list("TEXTURE_UL_texpaintslots", "",
-                                  mat, "texture_paint_slots",
-                                  mat, "paint_clone_slot", rows=2)
-
 
 class VIEW3D_PT_tools_brush_overlay(Panel, View3DPaintPanel):
     bl_category = "Options"
@@ -1637,10 +1631,6 @@ class VIEW3D_PT_tools_projectpaint(View3DPaintPanel, Panel):
         col.template_ID(ipaint, "stencil_image", new="image.new")
         col.prop(ipaint, "stencil_color")
 
-        col = layout.column()
-        col.active = (settings.brush.image_tool == 'CLONE')
-        col.prop(ipaint, "use_clone_layer", text="Clone from paint slot")
-
         layout.prop(ipaint, "seam_bleed")
         self.unified_paint_settings(layout, context)




More information about the Bf-blender-cvs mailing list