diff options
Diffstat (limited to 'release/scripts/startup/bl_ui/space_image.py')
-rw-r--r-- | release/scripts/startup/bl_ui/space_image.py | 91 |
1 files changed, 50 insertions, 41 deletions
diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py index bdb0ca7aa15..a75e0916c09 100644 --- a/release/scripts/startup/bl_ui/space_image.py +++ b/release/scripts/startup/bl_ui/space_image.py @@ -25,7 +25,11 @@ from bl_ui.properties_paint_common import ( brush_texpaint_common, brush_mask_texture_settings, ) -from bl_ui.properties_grease_pencil_common import GreasePencilPanel +from bl_ui.properties_grease_pencil_common import ( + GreasePencilDrawingToolsPanel, + GreasePencilStrokeEditPanel, + GreasePencilDataPanel, + ) from bpy.app.translations import pgettext_iface as iface_ @@ -82,6 +86,7 @@ class IMAGE_MT_view(Menu): layout.prop(uv, "show_other_objects") if paint.brush and (context.image_paint_object or sima.mode == 'PAINT'): layout.prop(uv, "show_texpaint") + layout.prop(toolsettings, "show_uv_local_view", text="Show same material") layout.separator() @@ -131,7 +136,7 @@ class IMAGE_MT_select(Menu): layout.separator() layout.operator("uv.select_pinned") - layout.operator("uv.select_linked") + layout.operator("uv.select_linked").extend = False layout.separator() @@ -510,12 +515,14 @@ class MASK_MT_editor_menus(Menu): # Mask (similar code in space_clip.py, keep in sync) # note! - panel placement does _not_ fit well with image panels... need to fix -from bl_ui.properties_mask_common import (MASK_PT_mask, - MASK_PT_layers, - MASK_PT_spline, - MASK_PT_point, - MASK_PT_display, - MASK_PT_tools) +from bl_ui.properties_mask_common import ( + MASK_PT_mask, + MASK_PT_layers, + MASK_PT_spline, + MASK_PT_point, + MASK_PT_display, + MASK_PT_tools, + ) class IMAGE_PT_mask(MASK_PT_mask, Panel): @@ -1037,17 +1044,27 @@ class IMAGE_PT_tools_mask(MASK_PT_tools, Panel): # --- end mask --- -class IMAGE_PT_view_histogram(Panel): +class ImageScopesPanel: + @classmethod + def poll(cls, context): + sima = context.space_data + if not (sima and sima.image): + return False + # scopes are not updated in paint modes, hide + if sima.mode in {'PAINT'}: + return False + ob = context.active_object + if ob and ob.mode in {'TEXTURE_PAINT'}: + return False + return True + + +class IMAGE_PT_view_histogram(ImageScopesPanel, Panel): bl_space_type = 'IMAGE_EDITOR' bl_region_type = 'TOOLS' bl_label = "Histogram" bl_category = "Scopes" - @classmethod - def poll(cls, context): - sima = context.space_data - return (sima and sima.image) - def draw(self, context): layout = self.layout @@ -1060,17 +1077,12 @@ class IMAGE_PT_view_histogram(Panel): row.prop(hist, "show_line", text="") -class IMAGE_PT_view_waveform(Panel): +class IMAGE_PT_view_waveform(ImageScopesPanel, Panel): bl_space_type = 'IMAGE_EDITOR' bl_region_type = 'TOOLS' bl_label = "Waveform" bl_category = "Scopes" - @classmethod - def poll(cls, context): - sima = context.space_data - return (sima and sima.image) - def draw(self, context): layout = self.layout @@ -1082,17 +1094,12 @@ class IMAGE_PT_view_waveform(Panel): row.prop(sima.scopes, "waveform_mode", text="") -class IMAGE_PT_view_vectorscope(Panel): +class IMAGE_PT_view_vectorscope(ImageScopesPanel, Panel): bl_space_type = 'IMAGE_EDITOR' bl_region_type = 'TOOLS' bl_label = "Vectorscope" bl_category = "Scopes" - @classmethod - def poll(cls, context): - sima = context.space_data - return (sima and sima.image) - def draw(self, context): layout = self.layout @@ -1101,17 +1108,12 @@ class IMAGE_PT_view_vectorscope(Panel): layout.prop(sima.scopes, "vectorscope_alpha") -class IMAGE_PT_sample_line(Panel): +class IMAGE_PT_sample_line(ImageScopesPanel, Panel): bl_space_type = 'IMAGE_EDITOR' bl_region_type = 'TOOLS' bl_label = "Sample Line" bl_category = "Scopes" - @classmethod - def poll(cls, context): - sima = context.space_data - return (sima and sima.image) - def draw(self, context): layout = self.layout @@ -1125,17 +1127,12 @@ class IMAGE_PT_sample_line(Panel): row.prop(hist, "show_line", text="") -class IMAGE_PT_scope_sample(Panel): +class IMAGE_PT_scope_sample(ImageScopesPanel, Panel): bl_space_type = 'IMAGE_EDITOR' bl_region_type = 'TOOLS' bl_label = "Scope Samples" bl_category = "Scopes" - @classmethod - def poll(cls, context): - sima = context.space_data - return sima - def draw(self, context): layout = self.layout @@ -1148,10 +1145,22 @@ class IMAGE_PT_scope_sample(Panel): sub.prop(sima.scopes, "accuracy") -class IMAGE_PT_tools_grease_pencil(GreasePencilPanel, Panel): +# Grease Pencil properties +class IMAGE_PT_grease_pencil(GreasePencilDataPanel, Panel): + bl_space_type = 'IMAGE_EDITOR' + bl_region_type = 'UI' + + # NOTE: this is just a wrapper around the generic GP Panel + + +# Grease Pencil drawing tools +class IMAGE_PT_tools_grease_pencil_draw(GreasePencilDrawingToolsPanel, Panel): + bl_space_type = 'IMAGE_EDITOR' + + +# Grease Pencil stroke editing tools +class IMAGE_PT_tools_grease_pencil_edit(GreasePencilStrokeEditPanel, Panel): bl_space_type = 'IMAGE_EDITOR' - bl_region_type = 'TOOLS' - bl_category = "Grease Pencil" if __name__ == "__main__": # only for live edit. |