[Bf-blender-cvs] [5fd2ea58a6d] blender2.8: UI: Header consistency

Pablo Vazquez noreply at git.blender.org
Mon Jul 2 15:53:57 CEST 2018


Commit: 5fd2ea58a6d521ff5dc8875c9f2e159f8238ec85
Author: Pablo Vazquez
Date:   Mon Jul 2 15:53:46 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB5fd2ea58a6d521ff5dc8875c9f2e159f8238ec85

UI: Header consistency

Snap before proportional editing, pivot after

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

M	release/scripts/startup/bl_ui/space_dopesheet.py
M	release/scripts/startup/bl_ui/space_graph.py
M	release/scripts/startup/bl_ui/space_image.py
M	release/scripts/startup/bl_ui/space_nla.py
M	release/scripts/startup/bl_ui/space_view3d.py

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

diff --git a/release/scripts/startup/bl_ui/space_dopesheet.py b/release/scripts/startup/bl_ui/space_dopesheet.py
index f245fc92a8f..e03d53a1870 100644
--- a/release/scripts/startup/bl_ui/space_dopesheet.py
+++ b/release/scripts/startup/bl_ui/space_dopesheet.py
@@ -262,10 +262,6 @@ class DOPESHEET_HT_editor_buttons(Header):
             row = layout.row(align=True)
             row.prop(st.dopesheet, "filter_text", text="")
 
-        # Grease Pencil mode doesn't need snapping, as it's frame-aligned only
-        if st.mode != 'GPENCIL':
-            layout.prop(st, "auto_snap", text="")
-
         layout.popover(
             space_type='DOPESHEET_EDITOR',
             region_type='HEADER',
@@ -274,6 +270,10 @@ class DOPESHEET_HT_editor_buttons(Header):
             icon='FILTER',
         )
 
+        # Grease Pencil mode doesn't need snapping, as it's frame-aligned only
+        if st.mode != 'GPENCIL':
+            layout.prop(st, "auto_snap", text="")
+
         row = layout.row(align=True)
         row.prop(toolsettings, "use_proportional_action", text="", icon_only=True)
         sub = row.row(align=True)
diff --git a/release/scripts/startup/bl_ui/space_graph.py b/release/scripts/startup/bl_ui/space_graph.py
index f7e3357e1bc..0a6077e6b57 100644
--- a/release/scripts/startup/bl_ui/space_graph.py
+++ b/release/scripts/startup/bl_ui/space_graph.py
@@ -59,8 +59,6 @@ class GRAPH_HT_header(Header):
         else:
             row.operator("graph.ghost_curves_create", text="", icon='GHOST_ENABLED')
 
-        layout.prop(st, "auto_snap", text="")
-
         layout.popover(
             space_type='GRAPH_EDITOR',
             region_type='HEADER',
@@ -69,6 +67,8 @@ class GRAPH_HT_header(Header):
             icon='FILTER',
         )
 
+        layout.prop(st, "auto_snap", text="")
+
         row = layout.row(align=True)
         row.prop(toolsettings, "use_proportional_fcurve", text="", icon_only=True)
         sub = row.row(align=True)
diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py
index 28f5fab4a3c..ba63b2b216e 100644
--- a/release/scripts/startup/bl_ui/space_image.py
+++ b/release/scripts/startup/bl_ui/space_image.py
@@ -520,9 +520,13 @@ class IMAGE_HT_header(Header):
             mesh = context.edit_object.data
             layout.prop_search(mesh.uv_layers, "active", mesh, "uv_layers", text="")
 
-        layout.prop(sima, "pivot_point", icon_only=True)
+            # Snap
+            row = layout.row(align=True)
+            row.prop(toolsettings, "use_snap", text="")
+            row.prop(toolsettings, "snap_uv_element", icon_only=True)
+            if toolsettings.snap_uv_element != 'INCREMENT':
+                row.prop(toolsettings, "snap_target", text="")
 
-        if show_uvedit:
             row = layout.row(align=True)
             row.prop(toolsettings, "proportional_edit", icon_only=True)
             # if toolsettings.proportional_edit != 'DISABLED':
@@ -530,11 +534,7 @@ class IMAGE_HT_header(Header):
             sub.active = toolsettings.proportional_edit != 'DISABLED'
             sub.prop(toolsettings, "proportional_edit_falloff", icon_only=True)
 
-            row = layout.row(align=True)
-            row.prop(toolsettings, "use_snap", text="")
-            row.prop(toolsettings, "snap_uv_element", icon_only=True)
-            if toolsettings.snap_uv_element != 'INCREMENT':
-                row.prop(toolsettings, "snap_target", text="")
+        layout.prop(sima, "pivot_point", icon_only=True)
 
         if ima:
             if ima.is_stereo_3d:
diff --git a/release/scripts/startup/bl_ui/space_nla.py b/release/scripts/startup/bl_ui/space_nla.py
index d85f7711c1a..304fc799fea 100644
--- a/release/scripts/startup/bl_ui/space_nla.py
+++ b/release/scripts/startup/bl_ui/space_nla.py
@@ -43,8 +43,6 @@ class NLA_HT_header(Header):
 
         dopesheet_filter(layout, context)
 
-        layout.prop(st, "auto_snap", text="")
-
         layout.popover(
             space_type='NLA_EDITOR',
             region_type='HEADER',
@@ -53,6 +51,8 @@ class NLA_HT_header(Header):
             icon='FILTER',
         )
 
+        layout.prop(st, "auto_snap", text="")
+
 
 class NLA_PT_filters(DopesheetFilterPopoverBase, Panel):
     bl_space_type = 'NLA_EDITOR'
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index df1c39084d4..432e5703805 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -117,23 +117,51 @@ class VIEW3D_HT_header(Header):
         # Mode & Transform Settings
         scene = context.scene
 
-        # Orientation & Pivot
+        # Orientation
         if object_mode in {'OBJECT', 'EDIT', 'POSE'}:
             layout.prop(scene, "transform_orientation", text="")
 
-            pivot_point = tool_settings.transform_pivot_point
-            act_pivot_point = bpy.types.ToolSettings.bl_rna.properties["transform_pivot_point"].enum_items[pivot_point]
+        # Snap
+        show_snap = False
+        if obj is None:
+            show_snap = True
+        else:
+            if object_mode not in {'SCULPT', 'VERTEX_PAINT', 'WEIGHT_PAINT', 'TEXTURE_PAINT'}:
+                show_snap = True
+            else:
+
+                from .properties_paint_common import UnifiedPaintPanel
+                paint_settings = UnifiedPaintPanel.paint_settings(context)
+
+                if paint_settings:
+                    brush = paint_settings.brush
+                    if brush and brush.stroke_method == 'CURVE':
+                        show_snap = True
+
+        if show_snap:
+            snap_items = bpy.types.ToolSettings.bl_rna.properties['snap_elements'].enum_items
+            for elem in tool_settings.snap_elements:
+                # TODO: Display multiple icons.
+                # (Currently only one of the enabled modes icons is displayed)
+                icon = snap_items[elem].icon
+                break
+            else:
+                icon = 'NONE'
+
             row = layout.row(align=True)
-            row.popover(
+            row.prop(tool_settings, "use_snap", text="")
+
+            sub = row.row(align=True)
+            sub.popover(
                 space_type='TOPBAR',
                 region_type='HEADER',
-                panel_type="TOPBAR_PT_pivot_point",
-                icon=act_pivot_point.icon,
-                text="",
+                panel_type="TOPBAR_PT_snapping",
+                icon=icon,
+                text=""
             )
 
+        # Proportional editing
         if obj:
-            # Proportional editing
             if context.gpencil_data and context.gpencil_data.use_stroke_edit_mode:
                 row = layout.row(align=True)
                 row.prop(tool_settings, "proportional_edit", icon_only=True)
@@ -156,7 +184,6 @@ class VIEW3D_HT_header(Header):
                 sub.active = tool_settings.use_proportional_edit_objects
                 sub.prop(tool_settings, "proportional_edit_falloff", icon_only=True)
         else:
-            # Proportional editing
             if context.gpencil_data and context.gpencil_data.use_stroke_edit_mode:
                 row = layout.row(align=True)
                 row.prop(tool_settings, "proportional_edit", icon_only=True)
@@ -164,43 +191,17 @@ class VIEW3D_HT_header(Header):
                 sub.active = tool_settings.proportional_edit != 'DISABLED'
                 sub.prop(tool_settings, "proportional_edit_falloff", icon_only=True)
 
-        # Snap
-        show_snap = False
-        if obj is None:
-            show_snap = True
-        else:
-            if object_mode not in {'SCULPT', 'VERTEX_PAINT', 'WEIGHT_PAINT', 'TEXTURE_PAINT'}:
-                show_snap = True
-            else:
-
-                from .properties_paint_common import UnifiedPaintPanel
-                paint_settings = UnifiedPaintPanel.paint_settings(context)
-
-                if paint_settings:
-                    brush = paint_settings.brush
-                    if brush and brush.stroke_method == 'CURVE':
-                        show_snap = True
-
-        if show_snap:
-            snap_items = bpy.types.ToolSettings.bl_rna.properties['snap_elements'].enum_items
-            for elem in tool_settings.snap_elements:
-                # TODO: Display multiple icons.
-                # (Currently only one of the enabled modes icons is displayed)
-                icon = snap_items[elem].icon
-                break
-            else:
-                icon = 'NONE'
-
+        # Orientation & Pivot
+        if object_mode in {'OBJECT', 'EDIT', 'POSE'}:
+            pivot_point = tool_settings.transform_pivot_point
+            act_pivot_point = bpy.types.ToolSettings.bl_rna.properties["transform_pivot_point"].enum_items[pivot_point]
             row = layout.row(align=True)
-            row.prop(tool_settings, "use_snap", text="")
-
-            sub = row.row(align=True)
-            sub.popover(
+            row.popover(
                 space_type='TOPBAR',
                 region_type='HEADER',
-                panel_type="TOPBAR_PT_snapping",
-                icon=icon,
-                text=""
+                panel_type="TOPBAR_PT_pivot_point",
+                icon=act_pivot_point.icon,
+                text="",
             )



More information about the Bf-blender-cvs mailing list