Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/space_image.py
| Show All 23 Lines | from bl_ui.properties_paint_common import ( | ||||
| brush_texture_settings, | brush_texture_settings, | ||||
| brush_mask_texture_settings, | brush_mask_texture_settings, | ||||
| ) | ) | ||||
| from bpy.app.translations import pgettext_iface as iface_ | from bpy.app.translations import pgettext_iface as iface_ | ||||
| class ImagePaintPanel(UnifiedPaintPanel): | class ImagePaintPanel(UnifiedPaintPanel): | ||||
| bl_space_type = 'IMAGE_EDITOR' | bl_space_type = 'IMAGE_EDITOR' | ||||
| bl_region_type = 'UI' | bl_region_type = 'TOOLS' | ||||
| bl_category = "Tools" | |||||
| class BrushButtonsPanel: | class BrushButtonsPanel: | ||||
| bl_space_type = 'IMAGE_EDITOR' | bl_space_type = 'IMAGE_EDITOR' | ||||
| bl_region_type = 'UI' | bl_region_type = 'TOOLS' | ||||
| bl_category = "Tools" | |||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| sima = context.space_data | sima = context.space_data | ||||
| toolsettings = context.tool_settings.image_paint | toolsettings = context.tool_settings.image_paint | ||||
| return sima.show_paint and toolsettings.brush | return sima.show_paint and toolsettings.brush | ||||
| ▲ Show 20 Lines • Show All 475 Lines • ▼ Show 20 Lines | def draw(self, context): | ||||
| col = split.column() | col = split.column() | ||||
| col.label(text="Clamp:") | col.label(text="Clamp:") | ||||
| col.prop(ima, "use_clamp_x", text="X") | col.prop(ima, "use_clamp_x", text="X") | ||||
| col.prop(ima, "use_clamp_y", text="Y") | col.prop(ima, "use_clamp_y", text="Y") | ||||
| col.separator() | col.separator() | ||||
| col.prop(ima, "mapping", expand=True) | col.prop(ima, "mapping", expand=True) | ||||
| class IMAGE_PT_view_histogram(Panel): | |||||
| bl_space_type = 'IMAGE_EDITOR' | |||||
| bl_region_type = 'PREVIEW' | |||||
| bl_label = "Histogram" | |||||
| @classmethod | |||||
| def poll(cls, context): | |||||
| sima = context.space_data | |||||
| return (sima and sima.image) | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| sima = context.space_data | |||||
| hist = sima.scopes.histogram | |||||
| layout.template_histogram(sima.scopes, "histogram") | |||||
| row = layout.row(align=True) | |||||
| row.prop(hist, "mode", expand=True) | |||||
| row.prop(hist, "show_line", text="") | |||||
| class IMAGE_PT_view_waveform(Panel): | |||||
| bl_space_type = 'IMAGE_EDITOR' | |||||
| bl_region_type = 'PREVIEW' | |||||
| bl_label = "Waveform" | |||||
| @classmethod | |||||
| def poll(cls, context): | |||||
| sima = context.space_data | |||||
| return (sima and sima.image) | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| sima = context.space_data | |||||
| layout.template_waveform(sima, "scopes") | |||||
| row = layout.split(percentage=0.75) | |||||
| row.prop(sima.scopes, "waveform_alpha") | |||||
| row.prop(sima.scopes, "waveform_mode", icon_only=True) | |||||
| class IMAGE_PT_view_vectorscope(Panel): | |||||
| bl_space_type = 'IMAGE_EDITOR' | |||||
| bl_region_type = 'PREVIEW' | |||||
| bl_label = "Vectorscope" | |||||
| @classmethod | |||||
| def poll(cls, context): | |||||
| sima = context.space_data | |||||
| return (sima and sima.image) | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| sima = context.space_data | |||||
| layout.template_vectorscope(sima, "scopes") | |||||
| layout.prop(sima.scopes, "vectorscope_alpha") | |||||
| class IMAGE_PT_sample_line(Panel): | |||||
| bl_space_type = 'IMAGE_EDITOR' | |||||
| bl_region_type = 'PREVIEW' | |||||
| bl_label = "Sample Line" | |||||
| @classmethod | |||||
| def poll(cls, context): | |||||
| sima = context.space_data | |||||
| return (sima and sima.image) | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| sima = context.space_data | |||||
| hist = sima.sample_histogram | |||||
| layout.operator("image.sample_line") | |||||
| layout.template_histogram(sima, "sample_histogram") | |||||
| row = layout.row(align=True) | |||||
| row.prop(hist, "mode", expand=True) | |||||
| row.prop(hist, "show_line", text="") | |||||
| class IMAGE_PT_scope_sample(Panel): | |||||
| bl_space_type = 'IMAGE_EDITOR' | |||||
| bl_region_type = 'PREVIEW' | |||||
| bl_label = "Scope Samples" | |||||
| @classmethod | |||||
| def poll(cls, context): | |||||
| sima = context.space_data | |||||
| return sima | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| sima = context.space_data | |||||
| row = layout.row() | |||||
| row.prop(sima.scopes, "use_full_resolution") | |||||
| sub = row.row() | |||||
| sub.active = not sima.scopes.use_full_resolution | |||||
| sub.prop(sima.scopes, "accuracy") | |||||
| class IMAGE_PT_view_properties(Panel): | class IMAGE_PT_view_properties(Panel): | ||||
| bl_space_type = 'IMAGE_EDITOR' | bl_space_type = 'IMAGE_EDITOR' | ||||
| bl_region_type = 'UI' | bl_region_type = 'UI' | ||||
| bl_label = "Display" | bl_label = "Display" | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| sima = context.space_data | sima = context.space_data | ||||
| ▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | def draw(self, context): | ||||
| col = split.column() | col = split.column() | ||||
| col.prop(uvedit, "show_stretch", text="Stretch") | col.prop(uvedit, "show_stretch", text="Stretch") | ||||
| sub = col.column() | sub = col.column() | ||||
| sub.active = uvedit.show_stretch | sub.active = uvedit.show_stretch | ||||
| sub.row().prop(uvedit, "draw_stretch_type", expand=True) | sub.row().prop(uvedit, "draw_stretch_type", expand=True) | ||||
| class IMAGE_PT_paint(Panel, ImagePaintPanel): | class IMAGE_PT_paint(Panel, ImagePaintPanel): | ||||
| bl_space_type = 'IMAGE_EDITOR' | |||||
| bl_region_type = 'UI' | |||||
| bl_label = "Paint" | bl_label = "Paint" | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| sima = context.space_data | sima = context.space_data | ||||
| return sima.show_paint | return sima.show_paint | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| ▲ Show 20 Lines • Show All 239 Lines • ▼ Show 20 Lines | def draw(self, context): | ||||
| col = layout.column(align=True) | col = layout.column(align=True) | ||||
| col.prop(brush, "use_custom_icon") | col.prop(brush, "use_custom_icon") | ||||
| if brush.use_custom_icon: | if brush.use_custom_icon: | ||||
| col.prop(brush, "icon_filepath", text="") | col.prop(brush, "icon_filepath", text="") | ||||
| class IMAGE_UV_sculpt_curve(Panel): | class IMAGE_UV_sculpt_curve(Panel): | ||||
| bl_space_type = 'IMAGE_EDITOR' | bl_space_type = 'IMAGE_EDITOR' | ||||
| bl_region_type = 'UI' | bl_region_type = 'TOOLS' | ||||
| bl_label = "UV Sculpt Curve" | bl_label = "UV Sculpt Curve" | ||||
| bl_category = "Tools" | |||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| sima = context.space_data | sima = context.space_data | ||||
| toolsettings = context.tool_settings.image_paint | toolsettings = context.tool_settings.image_paint | ||||
| return sima.show_uvedit and context.tool_settings.use_uv_sculpt and not (sima.show_paint and toolsettings.brush) | return sima.show_uvedit and context.tool_settings.use_uv_sculpt and not (sima.show_paint and toolsettings.brush) | ||||
| Show All 12 Lines | def draw(self, context): | ||||
| row.operator("brush.curve_preset", icon='ROOTCURVE', text="").shape = 'ROOT' | row.operator("brush.curve_preset", icon='ROOTCURVE', text="").shape = 'ROOT' | ||||
| row.operator("brush.curve_preset", icon='SHARPCURVE', text="").shape = 'SHARP' | row.operator("brush.curve_preset", icon='SHARPCURVE', text="").shape = 'SHARP' | ||||
| row.operator("brush.curve_preset", icon='LINCURVE', text="").shape = 'LINE' | row.operator("brush.curve_preset", icon='LINCURVE', text="").shape = 'LINE' | ||||
| row.operator("brush.curve_preset", icon='NOCURVE', text="").shape = 'MAX' | row.operator("brush.curve_preset", icon='NOCURVE', text="").shape = 'MAX' | ||||
| class IMAGE_UV_sculpt(Panel, ImagePaintPanel): | class IMAGE_UV_sculpt(Panel, ImagePaintPanel): | ||||
| bl_space_type = 'IMAGE_EDITOR' | bl_space_type = 'IMAGE_EDITOR' | ||||
| bl_region_type = 'UI' | bl_region_type = 'TOOLS' | ||||
| bl_category = "Tools" | |||||
| bl_label = "UV Sculpt" | bl_label = "UV Sculpt" | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| sima = context.space_data | sima = context.space_data | ||||
| toolsettings = context.tool_settings.image_paint | toolsettings = context.tool_settings.image_paint | ||||
| return sima.show_uvedit and context.tool_settings.use_uv_sculpt and not (sima.show_paint and toolsettings.brush) | return sima.show_uvedit and context.tool_settings.use_uv_sculpt and not (sima.show_paint and toolsettings.brush) | ||||
| Show All 33 Lines | from bl_ui.properties_mask_common import (MASK_PT_mask, | ||||
| MASK_PT_spline, | MASK_PT_spline, | ||||
| MASK_PT_point, | MASK_PT_point, | ||||
| MASK_PT_display, | MASK_PT_display, | ||||
| MASK_PT_tools) | MASK_PT_tools) | ||||
| class IMAGE_PT_mask(MASK_PT_mask, Panel): | class IMAGE_PT_mask(MASK_PT_mask, Panel): | ||||
| bl_space_type = 'IMAGE_EDITOR' | bl_space_type = 'IMAGE_EDITOR' | ||||
| bl_region_type = 'PREVIEW' | bl_region_type = 'UI' | ||||
| class IMAGE_PT_mask_layers(MASK_PT_layers, Panel): | class IMAGE_PT_mask_layers(MASK_PT_layers, Panel): | ||||
| bl_space_type = 'IMAGE_EDITOR' | bl_space_type = 'IMAGE_EDITOR' | ||||
| bl_region_type = 'PREVIEW' | bl_region_type = 'UI' | ||||
| class IMAGE_PT_mask_display(MASK_PT_display, Panel): | class IMAGE_PT_mask_display(MASK_PT_display, Panel): | ||||
| bl_space_type = 'IMAGE_EDITOR' | bl_space_type = 'IMAGE_EDITOR' | ||||
| bl_region_type = 'PREVIEW' | bl_region_type = 'UI' | ||||
| class IMAGE_PT_active_mask_spline(MASK_PT_spline, Panel): | class IMAGE_PT_active_mask_spline(MASK_PT_spline, Panel): | ||||
| bl_space_type = 'IMAGE_EDITOR' | bl_space_type = 'IMAGE_EDITOR' | ||||
| bl_region_type = 'PREVIEW' | bl_region_type = 'UI' | ||||
| class IMAGE_PT_active_mask_point(MASK_PT_point, Panel): | class IMAGE_PT_active_mask_point(MASK_PT_point, Panel): | ||||
| bl_space_type = 'IMAGE_EDITOR' | bl_space_type = 'IMAGE_EDITOR' | ||||
| bl_region_type = 'PREVIEW' | bl_region_type = 'UI' | ||||
| class IMAGE_PT_tools_mask(MASK_PT_tools, Panel): | class IMAGE_PT_tools_mask(MASK_PT_tools, Panel): | ||||
| bl_space_type = 'IMAGE_EDITOR' | bl_space_type = 'IMAGE_EDITOR' | ||||
| bl_region_type = 'UI' # is 'TOOLS' in the clip editor | bl_region_type = 'TOOLS' | ||||
| bl_category = 'Mask' | |||||
| # --- end mask --- | # --- end mask --- | ||||
| class IMAGE_PT_view_histogram(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 | |||||
| sima = context.space_data | |||||
| hist = sima.scopes.histogram | |||||
| layout.template_histogram(sima.scopes, "histogram") | |||||
| row = layout.row(align=True) | |||||
| row.prop(hist, "mode", expand=True) | |||||
| row.prop(hist, "show_line", text="") | |||||
| class IMAGE_PT_view_waveform(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 | |||||
| sima = context.space_data | |||||
| layout.template_waveform(sima, "scopes") | |||||
| row = layout.split(percentage=0.75) | |||||
| row.prop(sima.scopes, "waveform_alpha") | |||||
| row.prop(sima.scopes, "waveform_mode", icon_only=True) | |||||
| class IMAGE_PT_view_vectorscope(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 | |||||
| sima = context.space_data | |||||
| layout.template_vectorscope(sima, "scopes") | |||||
| layout.prop(sima.scopes, "vectorscope_alpha") | |||||
| class IMAGE_PT_sample_line(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 | |||||
| sima = context.space_data | |||||
| hist = sima.sample_histogram | |||||
| layout.operator("image.sample_line") | |||||
| layout.template_histogram(sima, "sample_histogram") | |||||
| row = layout.row(align=True) | |||||
| row.prop(hist, "mode", expand=True) | |||||
| row.prop(hist, "show_line", text="") | |||||
| class IMAGE_PT_scope_sample(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 | |||||
| sima = context.space_data | |||||
| row = layout.row() | |||||
| row.prop(sima.scopes, "use_full_resolution") | |||||
| sub = row.row() | |||||
| sub.active = not sima.scopes.use_full_resolution | |||||
| sub.prop(sima.scopes, "accuracy") | |||||
| if __name__ == "__main__": # only for live edit. | if __name__ == "__main__": # only for live edit. | ||||
| bpy.utils.register_module(__name__) | bpy.utils.register_module(__name__) | ||||