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.py44
1 files changed, 34 insertions, 10 deletions
diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py
index 3ee668888f3..6a769b1aecc 100644
--- a/release/scripts/startup/bl_ui/space_image.py
+++ b/release/scripts/startup/bl_ui/space_image.py
@@ -598,16 +598,10 @@ class IMAGE_HT_tool_header(Header):
def draw(self, context):
layout = self.layout
- layout.template_header()
-
self.draw_tool_settings(context)
layout.separator_spacer()
- IMAGE_HT_header.draw_xform_template(layout, context)
-
- layout.separator_spacer()
-
self.draw_mode_settings(context)
def draw_tool_settings(self, context):
@@ -762,8 +756,7 @@ class IMAGE_HT_header(Header):
show_uvedit = sima.show_uvedit
show_maskedit = sima.show_maskedit
- if not show_region_tool_header:
- layout.template_header()
+ layout.template_header()
if sima.mode != 'UV':
layout.prop(sima, "ui_mode", text="")
@@ -784,8 +777,7 @@ class IMAGE_HT_header(Header):
layout.separator_spacer()
- if not show_region_tool_header:
- IMAGE_HT_header.draw_xform_template(layout, context)
+ IMAGE_HT_header.draw_xform_template(layout, context)
layout.template_ID(sima, "image", new="image.new", open="image.open")
@@ -934,6 +926,10 @@ class IMAGE_PT_snapping(Panel):
row = col.row(align=True)
row.prop(tool_settings, "snap_target", expand=True)
+ col.separator()
+ if 'INCREMENT' in tool_settings.snap_uv_element:
+ col.prop(tool_settings, "use_snap_uv_grid_absolute")
+
col.label(text="Affect")
row = col.row(align=True)
row.prop(tool_settings, "use_snap_translate", text="Move", toggle=True)
@@ -1467,6 +1463,33 @@ class IMAGE_PT_udim_grid(Panel):
col = layout.column()
col.prop(uvedit, "tile_grid_shape", text="Grid Shape")
+class IMAGE_PT_custom_grid(Panel):
+ bl_space_type = 'IMAGE_EDITOR'
+ bl_region_type = 'UI'
+ bl_category = "View"
+ bl_label = "Custom Grid"
+
+ @classmethod
+ def poll(cls, context):
+ sima = context.space_data
+ return sima.show_uvedit
+
+ def draw_header(self, context):
+ sima = context.space_data
+ uvedit = sima.uv_editor
+ self.layout.prop(uvedit, "use_custom_grid", text="")
+
+ def draw(self, context):
+ layout = self.layout
+
+ sima = context.space_data
+ uvedit = sima.uv_editor
+
+ layout.use_property_split = True
+ layout.use_property_decorate = False
+
+ col = layout.column()
+ col.prop(uvedit, "custom_grid_subdivisions", text="Subdivisions")
class IMAGE_PT_overlay(Panel):
bl_space_type = 'IMAGE_EDITOR'
@@ -1652,6 +1675,7 @@ classes = (
IMAGE_PT_uv_cursor,
IMAGE_PT_annotation,
IMAGE_PT_udim_grid,
+ IMAGE_PT_custom_grid,
IMAGE_PT_overlay,
IMAGE_PT_overlay_uv_edit,
IMAGE_PT_overlay_uv_edit_geometry,