Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--release/scripts/startup/bl_ui/properties_paint_common.py29
-rw-r--r--release/scripts/startup/bl_ui/space_view3d_toolbar.py12
2 files changed, 27 insertions, 14 deletions
diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py
index 8359ae651ff..80f7db37faa 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 99b2b852936..256110a5d80 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)