UI: Object Types Visibility Popover Tweaks #111285

Merged
Harley Acheson merged 5 commits from Harley/blender:ObjectTypesVisibility into main 2023-08-25 22:17:54 +02:00
Member

Small visual changes to the Object Types Visibility Popover


Someone forwarded me the following tweet (post / xing) that compares this popover between Blender and Bforartists: https://twitter.com/bforartists/status/1692580912372809745

Comparing the two, what bugs me the most are the spacing between Name, Icon, Icon. There is more space between the icons than between name and icon.

I do realize that the gap below "Grease Pencil" is intentional, but it seems a bit wonky. We have only two sections (Geometry & Other) that are untitled, so I'm sure many people know the significance or if it actually helps anyone.

This also changes the alignment, adds icons, and also adds tooltips for all the buttons.

Current state on the left, the PR on the right:

image

Small visual changes to the Object Types Visibility Popover --- Someone forwarded me the following tweet (post / xing) that compares this popover between Blender and Bforartists: https://twitter.com/bforartists/status/1692580912372809745 Comparing the two, what bugs me the most are the spacing between Name, Icon, Icon. There is more space between the icons than between name and icon. I do realize that the gap below "Grease Pencil" is intentional, but it seems a bit wonky. We have only two sections (Geometry & Other) that are untitled, so I'm sure many people know the significance or if it actually helps anyone. This also changes the alignment, adds icons, and also adds tooltips for all the buttons. Current state on the left, the PR on the right: ![image](/attachments/f1e957ff-d464-42ca-9626-76f96521c189)
Harley Acheson added 1 commit 2023-08-19 00:20:39 +02:00
2ba661a9b1 UI: Object Types Visibility Popover Tweaks
Small visual changes to the Object Types Visibility Popover
Harley Acheson added this to the User Interface project 2023-08-19 00:20:52 +02:00
Harley Acheson requested review from Pablo Vazquez 2023-08-19 00:20:59 +02:00
Harley Acheson added 1 commit 2023-08-19 00:37:48 +02:00
Member

Indeed, the gap looks weird since it's not even in all places where it is in other lists such as the Add menu or Select by Type.

But there are some good points there, we usually left-align text in popovers so it'd make sense to have it that way too.

About the icon I'm not sure, since we usually have it on operators or specific menus (Add menu). I thought of making the label an operator to select all objects of the that type but it felt like a hidden feature so I'd rather not.

However, icons are good for accessibility, readability and easy to recognize even in translated UIs.

It's also a good point to have icons follow the order of the Outliner for consistency.

No Icon Icon
Screenshot 2023-08-19 at 02.23.38.jpg Screenshot 2023-08-19 at 02.24.19.jpg

I also made the column align=True so it's a bit more compact.

What do you think? This is the code to test:

diff --git a/scripts/startup/bl_ui/space_view3d.py b/scripts/startup/bl_ui/space_view3d.py
index b42ec798be2..a8c08e737b1 100644
--- a/scripts/startup/bl_ui/space_view3d.py
+++ b/scripts/startup/bl_ui/space_view3d.py
@@ -6089,8 +6089,8 @@ class VIEW3D_PT_collections(Panel):
 class VIEW3D_PT_object_type_visibility(Panel):
     bl_space_type = 'VIEW_3D'
     bl_region_type = 'HEADER'
-    bl_label = "View Object Types"
-    bl_ui_units_x = 7
+    bl_label = "Object Types Visibility"
+    bl_ui_units_x = 8
 
     # Allows derived classes to pass view data other than context.space_data.
     # This is used by the official VR add-on, which passes XrSessionSettings
@@ -6102,31 +6102,28 @@ class VIEW3D_PT_object_type_visibility(Panel):
 
         layout.label(text="Object Types Visibility")
         layout.separator()
-        col = layout.column()
+        col = layout.column(align=True)
 
         attr_object_types = (
-            # Geometry
-            ("mesh", "Mesh"),
-            ("curve", "Curve"),
-            ("surf", "Surface"),
-            ("meta", "Meta"),
-            ("font", "Text"),
-            ("curves", "Hair Curves"),
-            ("pointcloud", "Point Cloud"),
-            ("volume", "Volume"),
-            ("grease_pencil", "Grease Pencil"),
-            (None, None),
-            # Other
-            ("armature", "Armature"),
-            ("lattice", "Lattice"),
-            ("empty", "Empty"),
-            ("light", "Light"),
-            ("light_probe", "Light Probe"),
-            ("camera", "Camera"),
-            ("speaker", "Speaker"),
+            ("mesh", "Mesh", "OUTLINER_OB_MESH"),
+            ("curve", "Curve", "OUTLINER_OB_CURVE"),
+            ("surf", "Surface", "OUTLINER_OB_SURFACE"),
+            ("meta", "Meta", "OUTLINER_OB_META"),
+            ("font", "Text", "OUTLINER_OB_FONT"),
+            ("curves", "Hair Curves", "OUTLINER_OB_CURVES"),
+            ("pointcloud", "Point Cloud", "OUTLINER_OB_POINTCLOUD"),
+            ("volume", "Volume", "OUTLINER_OB_VOLUME"),
+            ("grease_pencil", "Grease Pencil", "OUTLINER_OB_GREASEPENCIL"),
+            ("armature", "Armature", "OUTLINER_OB_ARMATURE"),
+            ("lattice", "Lattice", "OUTLINER_OB_LATTICE"),
+            ("empty", "Empty", "OUTLINER_OB_EMPTY"),
+            ("light", "Light", "OUTLINER_OB_LIGHT"),
+            ("light_probe", "Light Probe", "OUTLINER_OB_LIGHTPROBE"),
+            ("camera", "Camera", "OUTLINER_OB_CAMERA"),
+            ("speaker", "Speaker", "OUTLINER_OB_SPEAKER"),
         )
 
-        for attr, attr_name in attr_object_types:
+        for attr, attr_name, attr_icon in attr_object_types:
             if attr is None:
                 col.separator()
                 continue
@@ -6140,10 +6137,7 @@ class VIEW3D_PT_object_type_visibility(Panel):
             icon_v = 'HIDE_OFF' if getattr(view, attr_v) else 'HIDE_ON'
 
             row = col.row(align=True)
-            row.alignment = 'RIGHT'
-
-            row.label(text=attr_name)
-            row.prop(view, attr_v, text="", icon=icon_v, emboss=False)
+            row.label(text=attr_name + ' ', icon=attr_icon)
 
             if show_select:
                 attr_s = "show_object_select_" + attr
@@ -6153,6 +6147,8 @@ class VIEW3D_PT_object_type_visibility(Panel):
                 rowsub.active = getattr(view, attr_v)
                 rowsub.prop(view, attr_s, text="", icon=icon_s, emboss=False)
 
+            row.prop(view, attr_v, text="", icon=icon_v, emboss=False)
+
     def draw(self, context):
         view = context.space_data
         self.draw_ex(context, view, True)

Indeed, the gap looks weird since it's not even in all places where it is in other lists such as the Add menu or Select by Type. But there are some good points there, we usually left-align text in popovers so it'd make sense to have it that way too. About the icon I'm not sure, since we usually have it on operators or specific menus (Add menu). I thought of making the label an operator to select all objects of the that type but it felt like a hidden feature so I'd rather not. However, icons are good for accessibility, readability and easy to recognize even in translated UIs. It's also a good point to have icons follow the order of the Outliner for consistency. |No Icon|Icon| |---|---| |![Screenshot 2023-08-19 at 02.23.38.jpg](/attachments/e87ab506-6fc7-4abd-9354-4201d6d81257)|![Screenshot 2023-08-19 at 02.24.19.jpg](/attachments/3f9313ae-9589-48be-a5c4-658d0e107416)| I also made the column `align=True` so it's a bit more compact. What do you think? This is the code to test: ```diff diff --git a/scripts/startup/bl_ui/space_view3d.py b/scripts/startup/bl_ui/space_view3d.py index b42ec798be2..a8c08e737b1 100644 --- a/scripts/startup/bl_ui/space_view3d.py +++ b/scripts/startup/bl_ui/space_view3d.py @@ -6089,8 +6089,8 @@ class VIEW3D_PT_collections(Panel): class VIEW3D_PT_object_type_visibility(Panel): bl_space_type = 'VIEW_3D' bl_region_type = 'HEADER' - bl_label = "View Object Types" - bl_ui_units_x = 7 + bl_label = "Object Types Visibility" + bl_ui_units_x = 8 # Allows derived classes to pass view data other than context.space_data. # This is used by the official VR add-on, which passes XrSessionSettings @@ -6102,31 +6102,28 @@ class VIEW3D_PT_object_type_visibility(Panel): layout.label(text="Object Types Visibility") layout.separator() - col = layout.column() + col = layout.column(align=True) attr_object_types = ( - # Geometry - ("mesh", "Mesh"), - ("curve", "Curve"), - ("surf", "Surface"), - ("meta", "Meta"), - ("font", "Text"), - ("curves", "Hair Curves"), - ("pointcloud", "Point Cloud"), - ("volume", "Volume"), - ("grease_pencil", "Grease Pencil"), - (None, None), - # Other - ("armature", "Armature"), - ("lattice", "Lattice"), - ("empty", "Empty"), - ("light", "Light"), - ("light_probe", "Light Probe"), - ("camera", "Camera"), - ("speaker", "Speaker"), + ("mesh", "Mesh", "OUTLINER_OB_MESH"), + ("curve", "Curve", "OUTLINER_OB_CURVE"), + ("surf", "Surface", "OUTLINER_OB_SURFACE"), + ("meta", "Meta", "OUTLINER_OB_META"), + ("font", "Text", "OUTLINER_OB_FONT"), + ("curves", "Hair Curves", "OUTLINER_OB_CURVES"), + ("pointcloud", "Point Cloud", "OUTLINER_OB_POINTCLOUD"), + ("volume", "Volume", "OUTLINER_OB_VOLUME"), + ("grease_pencil", "Grease Pencil", "OUTLINER_OB_GREASEPENCIL"), + ("armature", "Armature", "OUTLINER_OB_ARMATURE"), + ("lattice", "Lattice", "OUTLINER_OB_LATTICE"), + ("empty", "Empty", "OUTLINER_OB_EMPTY"), + ("light", "Light", "OUTLINER_OB_LIGHT"), + ("light_probe", "Light Probe", "OUTLINER_OB_LIGHTPROBE"), + ("camera", "Camera", "OUTLINER_OB_CAMERA"), + ("speaker", "Speaker", "OUTLINER_OB_SPEAKER"), ) - for attr, attr_name in attr_object_types: + for attr, attr_name, attr_icon in attr_object_types: if attr is None: col.separator() continue @@ -6140,10 +6137,7 @@ class VIEW3D_PT_object_type_visibility(Panel): icon_v = 'HIDE_OFF' if getattr(view, attr_v) else 'HIDE_ON' row = col.row(align=True) - row.alignment = 'RIGHT' - - row.label(text=attr_name) - row.prop(view, attr_v, text="", icon=icon_v, emboss=False) + row.label(text=attr_name + ' ', icon=attr_icon) if show_select: attr_s = "show_object_select_" + attr @@ -6153,6 +6147,8 @@ class VIEW3D_PT_object_type_visibility(Panel): rowsub.active = getattr(view, attr_v) rowsub.prop(view, attr_s, text="", icon=icon_s, emboss=False) + row.prop(view, attr_v, text="", icon=icon_v, emboss=False) + def draw(self, context): view = context.space_data self.draw_ex(context, view, True) ```
Harley Acheson added 1 commit 2023-08-19 05:48:14 +02:00
Author
Member

@pablovazquez - That's awesome. I updated the PR with your changes and also added tooltips to all the buttons. The wording of them would need some thought, all "Show this" and "Selectable that"

@pablovazquez - That's awesome. I updated the PR with your changes and also added tooltips to all the buttons. The wording of them would need some thought, all "Show this" and "Selectable that"
Author
Member

I'm not quite certain about the change of toggle order.

Probably just my L2R language bias, but the visibility icon seems the more likely-used., and has a clearer icon representation so explains the column a bit better. What I mean for the latter is that I would be okay with some hypothetical dialog that had only the column of eyes, but having only the arrows would need more explanation.

Deselecting the eye disables the selectability, so there is a right-to-left effect flow that I liked better when it was left-to-right.

But... this is totally not my call and I should be given very little weight for this kind of thing as I don't use this popover. I'd rather @pablovazquez just made the call.

I'm not quite certain about the change of toggle order. Probably just my L2R language bias, but the visibility icon seems the more likely-used., and has a clearer icon representation so explains the column a bit better. What I mean for the latter is that I would be okay with some hypothetical dialog that had only the column of eyes, but having only the arrows would need more explanation. Deselecting the eye disables the selectability, so there is a right-to-left effect flow that I liked better when it was left-to-right. But... this is totally not my call and I should be given very little weight for this kind of thing as I don't use this popover. I'd rather @pablovazquez just made the call.
Member

I'm not quite certain about the change of toggle order. Probably just my L2R language bias, but the visibility icon seems the more likely-used.

It is probably more used, but this is about keeping consistency with how these icons are displayed in other areas.

The "downside" in usability would be having to click a couple pixels to the right, which I think is less bad than having different order in icons in the entire column.
image

So I think we should go with the same order as the Outliner.

> I'm not quite certain about the change of toggle order. Probably just my L2R language bias, but the visibility icon seems the more likely-used. It is probably more used, but this is about keeping consistency with how these icons are displayed in other areas. The "downside" in usability would be having to click a couple pixels to the right, which I think is less bad than having different order in icons in the entire column. ![image](/attachments/e11ceec8-be4e-43e4-a440-f2a549b4a980) So I think we should go with the same order as the Outliner.
Pablo Vazquez approved these changes 2023-08-25 16:46:10 +02:00
Harley Acheson added 2 commits 2023-08-25 21:14:31 +02:00
Author
Member

@blender-bot build

@blender-bot build
Harley Acheson merged commit 7405993cb7 into main 2023-08-25 22:17:54 +02:00
Harley Acheson deleted branch ObjectTypesVisibility 2023-08-25 22:17:56 +02:00
First-time contributor

Why not in alphabetical order?

Why not in alphabetical order?
Member

Why not in alphabetical order?

They mirror the order in the Add menu. Which is sorted by functionality/frequency of use.

image

> Why not in alphabetical order? They mirror the order in the `Add` menu. Which is sorted by functionality/frequency of use. ![image](/attachments/2548edd6-c916-4223-8a52-e84405ab0564)
First-time contributor

I would have not imagined that Surface would be the third type of element in order of use 😮

I would have not imagined that Surface would be the third type of element in order of use 😮
Member

I would have not imagined that Surface would be the third type of element in order of use 😮

It's not. It's legacy, I guess because of how "similar" to Curve it was.

> I would have not imagined that Surface would be the third type of element in order of use 😮 It's not. It's legacy, I guess because of how "similar" to `Curve` it was.
First-time contributor

I would have not imagined that Surface would be the third type of element in order of use 😮

It's not. It's legacy, I guess because of how "similar" to Curve it was.

Makes sense.
I guess this could be a matter for a separate UI update conversation, then.

> > I would have not imagined that Surface would be the third type of element in order of use 😮 > > It's not. It's legacy, I guess because of how "similar" to `Curve` it was. Makes sense. I guess this could be a matter for a separate UI update conversation, then.
Member

I guess this could be a matter for a separate UI update conversation, then.

Yes, if you have any suggestions please make a proposal. Thanks!

> I guess this could be a matter for a separate UI update conversation, then. Yes, if you have any suggestions please make [a proposal](https://blender.community/c/rightclickselect/). Thanks!
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#111285
No description provided.