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:
Diffstat (limited to 'release/scripts/startup/bl_ui/space_image.py')
-rw-r--r--release/scripts/startup/bl_ui/space_image.py200
1 files changed, 133 insertions, 67 deletions
diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py
index 0fde128a906..f4e88b70281 100644
--- a/release/scripts/startup/bl_ui/space_image.py
+++ b/release/scripts/startup/bl_ui/space_image.py
@@ -742,6 +742,7 @@ class IMAGE_HT_header(Header):
layout = self.layout
sima = context.space_data
+ overlay = sima.overlay
ima = sima.image
iuser = sima.image_user
tool_settings = context.tool_settings
@@ -787,6 +788,13 @@ class IMAGE_HT_header(Header):
layout.separator_spacer()
+ # Overlay toggle & popover
+ row = layout.row(align=True)
+ row.prop(overlay, "show_overlays", icon='OVERLAY', text="")
+ sub = row.row(align=True)
+ sub.active = overlay.show_overlays
+ sub.popover(panel="IMAGE_PT_overlay", text="")
+
if show_uvedit:
uvedit = sima.uv_editor
@@ -986,74 +994,14 @@ class IMAGE_PT_view_display(Panel):
if ima:
col.prop(ima, "display_aspect", text="Aspect Ratio")
- col.prop(sima, "show_repeat", text="Repeat Image")
+ row = col.row()
+ row.active = ima.source != 'TILED'
+ row.prop(sima, "show_repeat", text="Repeat Image")
if show_uvedit:
col.prop(uvedit, "show_pixel_coords", text="Pixel Coordinates")
-class IMAGE_PT_view_display_uv_edit_overlays(Panel):
- bl_space_type = 'IMAGE_EDITOR'
- bl_region_type = 'UI'
- bl_label = "Overlays"
- bl_parent_id = 'IMAGE_PT_view_display'
- bl_category = "View"
- bl_options = {'DEFAULT_CLOSED'}
-
- @classmethod
- def poll(cls, context):
- sima = context.space_data
- return (sima and (sima.show_uvedit))
-
- def draw(self, context):
- layout = self.layout
- layout.use_property_split = True
- layout.use_property_decorate = False
-
- sima = context.space_data
- uvedit = sima.uv_editor
-
- col = layout.column()
-
- col.prop(uvedit, "edge_display_type", text="Display As")
- col.prop(uvedit, "show_faces", text="Faces")
-
- col = layout.column()
- if context.preferences.experimental.use_image_editor_legacy_drawing:
- col.prop(uvedit, "show_smooth_edges", text="Smooth")
- col.prop(uvedit, "show_modified_edges", text="Modified")
- col.prop(uvedit, "uv_opacity")
-
-
-class IMAGE_PT_view_display_uv_edit_overlays_stretch(Panel):
- bl_space_type = 'IMAGE_EDITOR'
- bl_region_type = 'UI'
- bl_label = "Stretching"
- bl_parent_id = 'IMAGE_PT_view_display_uv_edit_overlays'
- bl_category = "View"
- bl_options = {'DEFAULT_CLOSED'}
-
- @classmethod
- def poll(cls, context):
- sima = context.space_data
- return (sima and (sima.show_uvedit))
-
- def draw_header(self, context):
- sima = context.space_data
- uvedit = sima.uv_editor
- self.layout.prop(uvedit, "show_stretch", text="")
-
- def draw(self, context):
- layout = self.layout
- layout.use_property_split = True
-
- sima = context.space_data
- uvedit = sima.uv_editor
-
- layout.active = uvedit.show_stretch
- layout.prop(uvedit, "display_stretch_type", text="Type")
-
-
class IMAGE_UL_render_slots(UIList):
def draw_item(self, _context, layout, _data, item, _icon, _active_data, _active_propname, _index):
slot = item
@@ -1478,10 +1426,11 @@ class IMAGE_PT_uv_cursor(Panel):
sima = context.space_data
- col = layout.column()
+ layout.use_property_split = True
+ layout.use_property_decorate = False
col = layout.column()
- col.prop(sima, "cursor_location", text="Cursor Location")
+ col.prop(sima, "cursor_location", text="Location")
class IMAGE_PT_udim_grid(Panel):
@@ -1502,10 +1451,124 @@ class IMAGE_PT_udim_grid(Panel):
sima = context.space_data
uvedit = sima.uv_editor
+ layout.use_property_split = True
+ layout.use_property_decorate = False
+
col = layout.column()
col.prop(uvedit, "tile_grid_shape", text="Grid Shape")
+class IMAGE_PT_overlay(Panel):
+ bl_space_type = 'IMAGE_EDITOR'
+ bl_region_type = 'HEADER'
+ bl_label = "Overlays"
+ bl_ui_units_x = 13
+
+ def draw(self, context):
+ pass
+
+
+class IMAGE_PT_overlay_uv_edit(Panel):
+ bl_space_type = 'IMAGE_EDITOR'
+ bl_region_type = 'HEADER'
+ bl_label = "UV Editing"
+ bl_parent_id = 'IMAGE_PT_overlay'
+
+ @classmethod
+ def poll(cls, context):
+ sima = context.space_data
+ return (sima and (sima.show_uvedit))
+
+ def draw(self, context):
+ layout = self.layout
+
+ sima = context.space_data
+ uvedit = sima.uv_editor
+ overlay = sima.overlay
+
+ layout.active = overlay.show_overlays
+
+ # UV Stretching
+ row = layout.row()
+ row.prop(uvedit, "show_stretch")
+ subrow = row.row(align=True)
+ subrow.active = uvedit.show_stretch
+ subrow.prop(uvedit, "display_stretch_type", text="")
+
+
+
+class IMAGE_PT_overlay_uv_edit_geometry(Panel):
+ bl_space_type = 'IMAGE_EDITOR'
+ bl_region_type = 'HEADER'
+ bl_label = "Geometry"
+ bl_parent_id = 'IMAGE_PT_overlay'
+
+ @classmethod
+ def poll(cls, context):
+ sima = context.space_data
+ return (sima and (sima.show_uvedit))
+
+ def draw(self, context):
+ layout = self.layout
+
+ sima = context.space_data
+ uvedit = sima.uv_editor
+ overlay = sima.overlay
+
+ layout.active = overlay.show_overlays
+
+ # Edges
+ col = layout.column()
+ col.prop(uvedit, "uv_opacity")
+ col.prop(uvedit, "edge_display_type", text="")
+ col.prop(uvedit, "show_modified_edges", text="Modified Edges")
+
+ # Faces
+ row = col.row()
+ row.active = not uvedit.show_stretch
+ row.prop(uvedit, "show_faces", text="Faces")
+
+
+
+class IMAGE_PT_overlay_texture_paint(Panel):
+ bl_space_type = 'IMAGE_EDITOR'
+ bl_region_type = 'HEADER'
+ bl_label = "Geometry"
+ bl_parent_id = 'IMAGE_PT_overlay'
+
+ @classmethod
+ def poll(cls, context):
+ sima = context.space_data
+ return (sima and (sima.show_paint))
+
+ def draw(self, context):
+ layout = self.layout
+
+ sima = context.space_data
+ uvedit = sima.uv_editor
+ overlay = sima.overlay
+
+ layout.active = overlay.show_overlays
+ layout.prop(uvedit, "show_texpaint")
+
+
+class IMAGE_PT_overlay_image(Panel):
+ bl_space_type = 'IMAGE_EDITOR'
+ bl_region_type = 'HEADER'
+ bl_label = "Image"
+ bl_parent_id = 'IMAGE_PT_overlay'
+
+ def draw(self, context):
+ layout = self.layout
+
+ sima = context.space_data
+ uvedit = sima.uv_editor
+ overlay = sima.overlay
+
+ layout.active = overlay.show_overlays
+ layout.prop(uvedit, "show_metadata")
+
+
# Grease Pencil properties
class IMAGE_PT_annotation(AnnotationDataPanel, Panel):
bl_space_type = 'IMAGE_EDITOR'
@@ -1554,8 +1617,6 @@ classes = (
IMAGE_UL_udim_tiles,
IMAGE_PT_udim_tiles,
IMAGE_PT_view_display,
- IMAGE_PT_view_display_uv_edit_overlays,
- IMAGE_PT_view_display_uv_edit_overlays_stretch,
IMAGE_PT_paint_select,
IMAGE_PT_paint_settings,
IMAGE_PT_paint_color,
@@ -1581,6 +1642,11 @@ classes = (
IMAGE_PT_uv_cursor,
IMAGE_PT_annotation,
IMAGE_PT_udim_grid,
+ IMAGE_PT_overlay,
+ IMAGE_PT_overlay_uv_edit,
+ IMAGE_PT_overlay_uv_edit_geometry,
+ IMAGE_PT_overlay_texture_paint,
+ IMAGE_PT_overlay_image,
)