Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/space_image.py
| Show First 20 Lines • Show All 1,183 Lines • ▼ Show 20 Lines | def poll(cls, context): | ||||
| ob = context.active_object | ob = context.active_object | ||||
| if ob and ob.mode in {'TEXTURE_PAINT', 'EDIT'}: | if ob and ob.mode in {'TEXTURE_PAINT', 'EDIT'}: | ||||
| return False | return False | ||||
| return True | return True | ||||
| class IMAGE_PT_view_scopes(ImageScopesPanel, Panel): | |||||
| bl_space_type = 'IMAGE_EDITOR' | |||||
| bl_region_type = 'UI' | |||||
| bl_category = "Image" | |||||
| bl_label = "Scopes" | |||||
| def draw(self, layout): | |||||
| return # nothing to draw. | |||||
| class IMAGE_PT_view_histogram(ImageScopesPanel, Panel): | class IMAGE_PT_view_histogram(ImageScopesPanel, Panel): | ||||
| bl_space_type = 'IMAGE_EDITOR' | bl_space_type = 'IMAGE_EDITOR' | ||||
| bl_region_type = 'UI' | bl_region_type = 'UI' | ||||
| bl_category = "Image" | bl_category = "Scopes" | ||||
| bl_label = "Histogram" | bl_label = "Histogram" | ||||
| bl_parent_id = 'IMAGE_PT_view_scopes' | |||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| sima = context.space_data | sima = context.space_data | ||||
| hist = sima.scopes.histogram | hist = sima.scopes.histogram | ||||
| layout.template_histogram(sima.scopes, "histogram") | layout.template_histogram(sima.scopes, "histogram") | ||||
| row = layout.row(align=True) | row = layout.row(align=True) | ||||
| row.prop(hist, "mode", expand=True) | row.prop(hist, "mode", expand=True) | ||||
| row.prop(hist, "show_line", text="") | row.prop(hist, "show_line", text="") | ||||
| class IMAGE_PT_view_waveform(ImageScopesPanel, Panel): | class IMAGE_PT_view_waveform(ImageScopesPanel, Panel): | ||||
| bl_space_type = 'IMAGE_EDITOR' | bl_space_type = 'IMAGE_EDITOR' | ||||
| bl_region_type = 'UI' | bl_region_type = 'UI' | ||||
| bl_category = "Image" | bl_category = "Scopes" | ||||
| bl_label = "Waveform" | bl_label = "Waveform" | ||||
| bl_parent_id = 'IMAGE_PT_view_scopes' | |||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| sima = context.space_data | sima = context.space_data | ||||
| layout.template_waveform(sima, "scopes") | layout.template_waveform(sima, "scopes") | ||||
| row = layout.split(factor=0.75) | row = layout.split(factor=0.75) | ||||
| row.prop(sima.scopes, "waveform_alpha") | row.prop(sima.scopes, "waveform_alpha") | ||||
| row.prop(sima.scopes, "waveform_mode", text="") | row.prop(sima.scopes, "waveform_mode", text="") | ||||
| class IMAGE_PT_view_vectorscope(ImageScopesPanel, Panel): | class IMAGE_PT_view_vectorscope(ImageScopesPanel, Panel): | ||||
| bl_space_type = 'IMAGE_EDITOR' | bl_space_type = 'IMAGE_EDITOR' | ||||
| bl_region_type = 'UI' | bl_region_type = 'UI' | ||||
| bl_category = "Image" | bl_category = "Scopes" | ||||
| bl_label = "Vectorscope" | bl_label = "Vectorscope" | ||||
| bl_parent_id = 'IMAGE_PT_view_scopes' | |||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| sima = context.space_data | sima = context.space_data | ||||
| layout.template_vectorscope(sima, "scopes") | layout.template_vectorscope(sima, "scopes") | ||||
| layout.prop(sima.scopes, "vectorscope_alpha") | layout.prop(sima.scopes, "vectorscope_alpha") | ||||
| class IMAGE_PT_sample_line(ImageScopesPanel, Panel): | class IMAGE_PT_sample_line(ImageScopesPanel, Panel): | ||||
| bl_space_type = 'IMAGE_EDITOR' | bl_space_type = 'IMAGE_EDITOR' | ||||
| bl_region_type = 'UI' | bl_region_type = 'UI' | ||||
| bl_category = "Image" | bl_category = "Scopes" | ||||
| bl_label = "Sample Line" | bl_label = "Sample Line" | ||||
| bl_parent_id = 'IMAGE_PT_view_scopes' | |||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| sima = context.space_data | sima = context.space_data | ||||
| hist = sima.sample_histogram | hist = sima.sample_histogram | ||||
| layout.operator("image.sample_line") | layout.operator("image.sample_line") | ||||
| layout.template_histogram(sima, "sample_histogram") | layout.template_histogram(sima, "sample_histogram") | ||||
| row = layout.row(align=True) | row = layout.row(align=True) | ||||
| row.prop(hist, "mode", expand=True) | row.prop(hist, "mode", expand=True) | ||||
| row.prop(hist, "show_line", text="") | row.prop(hist, "show_line", text="") | ||||
| class IMAGE_PT_scope_sample(ImageScopesPanel, Panel): | class IMAGE_PT_scope_sample(ImageScopesPanel, Panel): | ||||
| bl_space_type = 'IMAGE_EDITOR' | bl_space_type = 'IMAGE_EDITOR' | ||||
| bl_region_type = 'UI' | bl_region_type = 'UI' | ||||
| bl_category = "Image" | bl_category = "Scopes" | ||||
| bl_label = "Samples" | bl_label = "Samples" | ||||
| bl_parent_id = 'IMAGE_PT_view_scopes' | |||||
| bl_options = {'DEFAULT_CLOSED'} | bl_options = {'DEFAULT_CLOSED'} | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=True) | flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=True) | ||||
| sima = context.space_data | sima = context.space_data | ||||
| ▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | classes = ( | ||||
| IMAGE_PT_tools_brush_texture, | IMAGE_PT_tools_brush_texture, | ||||
| IMAGE_PT_tools_mask_texture, | IMAGE_PT_tools_mask_texture, | ||||
| IMAGE_PT_paint_stroke, | IMAGE_PT_paint_stroke, | ||||
| IMAGE_PT_paint_curve, | IMAGE_PT_paint_curve, | ||||
| IMAGE_PT_tools_imagepaint_symmetry, | IMAGE_PT_tools_imagepaint_symmetry, | ||||
| IMAGE_PT_tools_brush_appearance, | IMAGE_PT_tools_brush_appearance, | ||||
| IMAGE_PT_uv_sculpt, | IMAGE_PT_uv_sculpt, | ||||
| IMAGE_PT_uv_sculpt_curve, | IMAGE_PT_uv_sculpt_curve, | ||||
| IMAGE_PT_view_scopes, | |||||
| IMAGE_PT_view_histogram, | IMAGE_PT_view_histogram, | ||||
| IMAGE_PT_view_waveform, | IMAGE_PT_view_waveform, | ||||
| IMAGE_PT_view_vectorscope, | IMAGE_PT_view_vectorscope, | ||||
| IMAGE_PT_sample_line, | IMAGE_PT_sample_line, | ||||
| IMAGE_PT_scope_sample, | IMAGE_PT_scope_sample, | ||||
| IMAGE_PT_grease_pencil, | IMAGE_PT_grease_pencil, | ||||
| ) | ) | ||||
| if __name__ == "__main__": # only for live edit. | if __name__ == "__main__": # only for live edit. | ||||
| from bpy.utils import register_class | from bpy.utils import register_class | ||||
| for cls in classes: | for cls in classes: | ||||
| register_class(cls) | register_class(cls) | ||||