[Bf-blender-cvs] [7ee5ea77511] master: Fix T65010: Affect options not being displayed in the UV editor snap settings.

mano-wii noreply at git.blender.org
Thu Jun 27 17:24:13 CEST 2019


Commit: 7ee5ea77511a800a2442f786839366aa15678276
Author: mano-wii
Date:   Thu Jun 27 12:24:03 2019 -0300
Branches: master
https://developer.blender.org/rB7ee5ea77511a800a2442f786839366aa15678276

Fix T65010: Affect options not being displayed in the UV editor snap settings.

Reviewers: brecht, billreynish

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D5141

===================================================================

M	release/scripts/startup/bl_ui/space_image.py

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py
index 2aba440bf1d..e3f4ceb7ed1 100644
--- a/release/scripts/startup/bl_ui/space_image.py
+++ b/release/scripts/startup/bl_ui/space_image.py
@@ -645,11 +645,18 @@ class IMAGE_HT_header(Header):
             tool_settings = context.tool_settings
 
             # Snap.
+            snap_uv_element = tool_settings.snap_uv_element
+            act_snap_uv_element = tool_settings.bl_rna.properties['snap_uv_element'].enum_items[snap_uv_element]
+
             row = layout.row(align=True)
             row.prop(tool_settings, "use_snap", text="")
-            row.prop(tool_settings, "snap_uv_element", icon_only=True)
-            if tool_settings.snap_uv_element != 'INCREMENT':
-                row.prop(tool_settings, "snap_target", text="")
+
+            sub = row.row(align=True)
+            sub.popover(
+                panel="IMAGE_PT_snapping",
+                icon=act_snap_uv_element.icon,
+                text="",
+            )
 
             # Proportional Editing
             row = layout.row(align=True)
@@ -811,6 +818,30 @@ class IMAGE_PT_active_mask_point(MASK_PT_point, Panel):
 
 # --- end mask ---
 
+class IMAGE_PT_snapping(Panel):
+    bl_space_type = 'IMAGE_EDITOR'
+    bl_region_type = 'HEADER'
+    bl_label = "Snapping"
+
+    def draw(self, context):
+        tool_settings = context.tool_settings
+
+        layout = self.layout
+        col = layout.column()
+        col.label(text="Snapping")
+        col.prop(tool_settings, "snap_uv_element", expand=True)
+
+        if tool_settings.snap_uv_element != 'INCREMENT':
+            col.label(text="Target")
+            row = col.row(align=True)
+            row.prop(tool_settings, "snap_target", expand=True)
+
+        col.label(text="Affect")
+        row = col.row(align=True)
+        row.prop(tool_settings, "use_snap_translate", text="Move", toggle=True)
+        row.prop(tool_settings, "use_snap_rotate", text="Rotate", toggle=True)
+        row.prop(tool_settings, "use_snap_scale", text="Scale", toggle=True)
+
 
 class IMAGE_PT_image_properties(Panel):
     bl_space_type = 'IMAGE_EDITOR'
@@ -1647,6 +1678,7 @@ classes = (
     IMAGE_PT_mask_display,
     IMAGE_PT_active_mask_spline,
     IMAGE_PT_active_mask_point,
+    IMAGE_PT_snapping,
     IMAGE_PT_image_properties,
     IMAGE_UL_render_slots,
     IMAGE_PT_render_slots,



More information about the Bf-blender-cvs mailing list