diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-10-30 19:07:21 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-10-30 19:16:48 +0300 |
commit | d9bce6bcf5bcc1c34d6e24adcc8babe757ae827d (patch) | |
tree | 304fa80505eff6aa3ee91cb37b0bb4eb47e894aa | |
parent | 5043003584e223d996e94abb1dc68e9d80d20d76 (diff) |
Fix image paint showing project-paint settings
Also make projpaint a keyword-only argument to avoid copy-paste errors
like this re-occurring in the future.
-rw-r--r-- | release/scripts/startup/bl_ui/properties_paint_common.py | 10 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_image.py | 8 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d_toolbar.py | 12 |
3 files changed, 15 insertions, 15 deletions
diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py index d21a3456e61..6720c2cd24d 100644 --- a/release/scripts/startup/bl_ui/properties_paint_common.py +++ b/release/scripts/startup/bl_ui/properties_paint_common.py @@ -108,7 +108,7 @@ class VIEW3D_MT_tools_projectpaint_clone(Menu): props.value = i -def brush_texpaint_common(panel, context, layout, brush, _settings, projpaint=False): +def brush_texpaint_common(panel, context, layout, brush, _settings, *, projpaint=False): col = layout.column() if brush.image_tool == 'FILL' and not projpaint: @@ -132,7 +132,7 @@ def brush_texpaint_common(panel, context, layout, brush, _settings, projpaint=Fa brush_basic_texpaint_settings(col, context, brush) -def brush_texpaint_common_clone(_panel, context, layout, _brush, settings, projpaint=False): +def brush_texpaint_common_clone(_panel, context, layout, _brush, settings, *, projpaint=False): ob = context.active_object col = layout.column() @@ -160,7 +160,7 @@ def brush_texpaint_common_clone(_panel, context, layout, _brush, settings, projp col.menu("VIEW3D_MT_tools_projectpaint_clone", text=clone_text, translate=False) -def brush_texpaint_common_color(_panel, context, layout, brush, _settings, projpaint=False): +def brush_texpaint_common_color(_panel, context, layout, brush, _settings, *, projpaint=False): UnifiedPaintPanel.prop_unified_color_picker(layout, context, brush, "color", value_slider=True) row = layout.row(align=True) @@ -170,7 +170,7 @@ def brush_texpaint_common_color(_panel, context, layout, brush, _settings, projp row.operator("paint.brush_colors_flip", icon='FILE_REFRESH', text="", emboss=False) -def brush_texpaint_common_gradient(_panel, context, layout, brush, _settings, projpaint=False): +def brush_texpaint_common_gradient(_panel, context, layout, brush, _settings, *, projpaint=False): layout.template_color_ramp(brush, "gradient", expand=True) layout.use_property_split = True @@ -186,7 +186,7 @@ def brush_texpaint_common_gradient(_panel, context, layout, brush, _settings, pr col.prop(brush, "gradient_fill_mode") -def brush_texpaint_common_options(_panel, _context, layout, brush, _settings, projpaint=False): +def brush_texpaint_common_options(_panel, _context, layout, brush, _settings, *, projpaint=False): capabilities = brush.image_paint_capabilities col = layout.column() diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py index cf5283d65cb..8de12f759fc 100644 --- a/release/scripts/startup/bl_ui/space_image.py +++ b/release/scripts/startup/bl_ui/space_image.py @@ -1106,9 +1106,9 @@ class IMAGE_PT_paint_color(Panel, ImagePaintPanel): layout.prop(brush, "color_type", expand=True) if brush.color_type == 'COLOR': - brush_texpaint_common_color(self, context, layout, brush, settings, True) + brush_texpaint_common_color(self, context, layout, brush, settings) elif brush.color_type == 'GRADIENT': - brush_texpaint_common_gradient(self, context, layout, brush, settings, True) + brush_texpaint_common_gradient(self, context, layout, brush, settings) class IMAGE_PT_paint_swatches(Panel, ImagePaintPanel): @@ -1160,7 +1160,7 @@ class IMAGE_PT_paint_clone(Panel, ImagePaintPanel): layout.active = settings.use_clone_layer - brush_texpaint_common_clone(self, context, layout, brush, settings, True) + brush_texpaint_common_clone(self, context, layout, brush, settings) class IMAGE_PT_paint_options(Panel, ImagePaintPanel): @@ -1186,7 +1186,7 @@ class IMAGE_PT_paint_options(Panel, ImagePaintPanel): layout.use_property_split = True layout.use_property_decorate = False # No animation. - brush_texpaint_common_options(self, context, layout, brush, settings, True) + brush_texpaint_common_options(self, context, layout, brush, settings) class IMAGE_PT_tools_brush_display(BrushButtonsPanel, Panel): diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index a4100003340..bef1f510ec7 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -503,7 +503,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, True) + brush_texpaint_common(self, context, layout, brush, settings, projpaint=True) # Weight Paint Mode # elif context.weight_paint_object and brush: @@ -551,15 +551,15 @@ class VIEW3D_PT_tools_brush_color(Panel, View3DPaintPanel): brush = settings.brush if context.vertex_paint_object: - brush_texpaint_common_color(self, context, layout, brush, settings, True) + brush_texpaint_common_color(self, context, layout, brush, settings, projpaint=True) else: layout.prop(brush, "color_type", expand=True) if brush.color_type == 'COLOR': - brush_texpaint_common_color(self, context, layout, brush, settings, True) + brush_texpaint_common_color(self, context, layout, brush, settings, projpaint=True) elif brush.color_type == 'GRADIENT': - brush_texpaint_common_gradient(self, context, layout, brush, settings, True) + brush_texpaint_common_gradient(self, context, layout, brush, settings, projpaint=True) class VIEW3D_PT_tools_brush_swatches(Panel, View3DPaintPanel): @@ -613,7 +613,7 @@ class VIEW3D_PT_tools_brush_clone(Panel, View3DPaintPanel): layout.active = settings.use_clone_layer - brush_texpaint_common_clone(self, context, layout, brush, settings, True) + brush_texpaint_common_clone(self, context, layout, brush, settings, projpaint=True) class VIEW3D_PT_tools_brush_options(Panel, View3DPaintPanel): @@ -635,7 +635,7 @@ class VIEW3D_PT_tools_brush_options(Panel, View3DPaintPanel): col = layout.column() if context.image_paint_object and brush: - brush_texpaint_common_options(self, context, layout, brush, settings, True) + brush_texpaint_common_options(self, context, layout, brush, settings, projpaint=True) elif context.sculpt_object and brush: col.prop(brush, "use_automasking_topology") |