The Select Hierarchy keyboard shortcut fails to select nested meshes #103723

Open
opened 2023-01-07 21:31:41 +01:00 by M. Clark · 13 comments

System Information
Operating system: Windows-10-10.0.19042-SP0 64 Bits
Graphics card: Quadro #2000 with Max-Q Design/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 516.94

Blender Version
Broken: version: 3.4.0, branch: blender-v3.4-release, commit date: 2022-12-06 18:46, hash: a95bf1ac01
Worked: (newest version of Blender that worked as expected)

Short description of error
In the Outliner, Select Hierarchy on the context menu works as expected. The corresponding keyboard shortcut (Shift-RightBracket) fails to select meshes that are nested in an empty.

Exact steps for others to reproduce the error

  1. Add an empty, called "Parent empty".
  2. In "Parent empty" add a mesh ("Mesh A") and an empty ("Nested empty")
  3. In "Nested empty" add a mesh called "Nested mesh".
  4. In the Outliner, right-click "Parent empty" and select Select Hierarchy. "Mesh A" and "Nested mesh" are selected, as expected.
  5. In the Outliner, select "Parent empty". In the Viewport, press Shift-RightBracket. "Nested mesh" is not selected.

selections.png

Select_Hierarchy_keyboard_shortcut.blend

**System Information** Operating system: Windows-10-10.0.19042-SP0 64 Bits Graphics card: Quadro #2000 with Max-Q Design/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 516.94 **Blender Version** Broken: version: 3.4.0, branch: blender-v3.4-release, commit date: 2022-12-06 18:46, hash: `a95bf1ac01` Worked: (newest version of Blender that worked as expected) **Short description of error** In the Outliner, Select Hierarchy on the context menu works as expected. The corresponding keyboard shortcut (Shift-RightBracket) fails to select meshes that are nested in an empty. **Exact steps for others to reproduce the error** 1. Add an empty, called "Parent empty". 2. In "Parent empty" add a mesh ("Mesh A") and an empty ("Nested empty") 3. In "Nested empty" add a mesh called "Nested mesh". 4. In the Outliner, right-click "Parent empty" and select Select Hierarchy. "Mesh A" and "Nested mesh" are selected, as expected. 5. In the Outliner, select "Parent empty". In the Viewport, press Shift-RightBracket. **"Nested mesh" is not selected.** ![selections.png](https://archive.blender.org/developer/F14131812/selections.png) [Select_Hierarchy_keyboard_shortcut.blend](https://archive.blender.org/developer/F14131818/Select_Hierarchy_keyboard_shortcut.blend)
Author

Added subscriber: @EightSix

Added subscriber: @EightSix
Member

Added subscriber: @PratikPB2123

Added subscriber: @PratikPB2123
Member

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'

Changed status from 'Needs Triage' to: 'Needs Developer To Reproduce'
Member

Hi, thanks for the report. Nested objects can still be selected with multiple select_hierarchy call
From code side, we're not checking childern object recursively: here : select_new.extend([child for child in obj.children if child.visible_get()])
Not sure if this was done intentionally. Forwarding to devs
But this can be fixed by replacing obj.children to obj.children_recursive

index 6a130edbb38..3cd5a85eae7 100644
    - a/release/scripts/startup/bl_operators/object.py
+++ b/release/scripts/startup/bl_operators/object.py
@@ -185,7 +185,7 @@ class SelectHierarchy(Operator):

   else:
       for obj in selected_objects:
- select_new.extend([child for child in obj.children if child.visible_get()])
+                select_new.extend([child for child in obj.children_recursive if child.visible_get()])

       if select_new:
           select_new.sort(key=lambda obj_iter: obj_iter.name)```
Hi, thanks for the report. Nested objects can still be selected with multiple `select_hierarchy` call From code side, we're not checking childern object recursively: [here ](https://developer.blender.org/diffusion/B/browse/master/release/scripts/startup/bl_operators/object.py$188): `select_new.extend([child for child in obj.children if child.visible_get()])` Not sure if this was done intentionally. Forwarding to devs But this can be fixed by replacing `obj.children` to `obj.children_recursive` ```diff --git a/release/scripts/startup/bl_operators/object.py b/release/scripts/startup/bl_operators/object.py index 6a130edbb38..3cd5a85eae7 100644 - a/release/scripts/startup/bl_operators/object.py +++ b/release/scripts/startup/bl_operators/object.py @@ -185,7 +185,7 @@ class SelectHierarchy(Operator): ``` else: for obj in selected_objects: ``` - select_new.extend([child for child in obj.children if child.visible_get()]) + select_new.extend([child for child in obj.children_recursive if child.visible_get()]) ``` if select_new: select_new.sort(key=lambda obj_iter: obj_iter.name)```
Author

Hi @pratik-2,

Thank you for that solution—it worked beautifully!

Right before I saw your message I discovered that I can press Shift ] multiple times in a row to extend the selection down into the hierarchy. That's good news insofar as there is a way. But in addition to my concern that its behavior is inconsistent with the command of the same name in the Outliner:

  • One don't always know how deep the hierarchy is, and therefore how many times to press Shift ] to get everything.
  • One could watch the selection grow in the Outliner, but using a Viewport shortcut is to save time by not interacting with the Outliner at all. But you have to, you may as well use its Select Hierarchy command, which begs the question of why the shortcut?

There may be a very valid use case for the shortcut behaving differently, but if that's the case, then I'd propose to the devs:

  • The current shortcut be renamed in the keymap to something like Select Hierarchy Level(s).
  • Create a new shortcut called Select Hierarchy that is bound to Alt ] or Ctrl ] that selects the entire hierarchy.
Hi @pratik-2, Thank you for that solution—it worked beautifully! Right before I saw your message I discovered that I can press **Shift ]** multiple times in a row to extend the selection down into the hierarchy. That's good news insofar as there *is* a way. But in addition to my concern that its behavior is inconsistent with the command of the same name in the Outliner: - One don't always know how deep the hierarchy is, and therefore how many times to press **Shift ]** to get everything. - One could watch the selection grow in the Outliner, but using a Viewport shortcut is to save time by not interacting with the Outliner at all. But you have to, you may as well use its Select Hierarchy command, which begs the question of why the shortcut? There may be a very valid use case for the shortcut behaving differently, but if that's the case, then I'd propose to the devs: - The current shortcut be renamed in the keymap to something like Select Hierarchy Level(s). - Create a new shortcut called Select Hierarchy that is bound to **Alt ]** or **Ctrl ]** that selects the entire hierarchy.
Author

Added subscriber: @pratik-2

Added subscriber: @pratik-2
Member

Removed subscriber: @pratik-2

Removed subscriber: @pratik-2
Member

Hi, which function you're calling in new shortcut? I'm not able to select entire hierarchy by doing so.
Of course we could either rename the keymap or commit the proposed solution from above

Hi, which function you're calling in new shortcut? I'm not able to select entire hierarchy by doing so. Of course we could either rename the keymap or commit the proposed solution from above
Author

I changed obj.children to obj.children_recursive in object.py and Shift ] is grabbing what I need. Here's a screenshot of it working in the blend file attached to this report.

add _recursive.png

I may have mis-worded my last message. I was suggesting either:

  • Implement only your solution of using obj.children_recursive
    or
  • Implement your solution of using obj.children_recursive AND
  • Create a new shortcut for the obj.children version called Select Hierarchy Level(s) in order to preserve the current behavior, just in case there are users that depend on it. I can't think of why anybody would want this, so maybe the simple fix is fine. But there are a lot of users out there doing things that I can barely begin to imagine, so maybe I'm not a good judge of such things :-)
I changed obj.children to **obj.children_recursive** in object.py and **Shift ]** is grabbing what I need. Here's a screenshot of it working in the blend file attached to this report. ![add _recursive.png](https://archive.blender.org/developer/F14137779/add__recursive.png) I may have mis-worded my last message. I was suggesting either: - Implement *only* your solution of using obj.children_recursive or - Implement your solution of using obj.children_recursive AND - Create a new shortcut for the obj.children version called **Select Hierarchy Level(s)** in order to preserve the current behavior, just in case there are users that depend on it. I can't think of why anybody would want this, so maybe the simple fix is fine. But there are a lot of users out there doing things that I can barely begin to imagine, so maybe I'm not a good judge of such things :-)

Added subscriber: @1D_Inc

Added subscriber: @1D_Inc

A tiny bit if context.
I think such a behaviour was made to provide correspondance to viewport action - for example it is useful for navigating bones.
I think it is reasonable to add a recursive method to the both viewport and outliner parenting hierarchies as ctrl+] or ctrl+shift+] and also keep them corresponding with viewport actions.
(For example, Shift part stands for "expanding" and ctrl part stands for "recursive")
Alt hotkey usually mean "antiaction" (for example, alt+G, atl+R resets objects transform), it is better to keep use it in that way (this is not the case for using Alt).

In mesh modeling L hotkey allow to select the entire mesh chunk/island on mouse hover, but as far as I remembel there is no such an action available for parenting hierarchies in object mode while is demanded.

Quite similar behaviour can be found in nodes handling as well, so linear hierarchies handling behaviour is supposed to be unified across the program.

Also, a side note, autoselecting the entire hierarchy by picking some its part is a behaviour of a common groups paradigm, which was requested is not presented in Blender yet because of cumulativity of a collections (the ability to store the same object in multiple collections) which is not compatible with linear hierarchies.

A tiny bit if context. I think such a behaviour was made to provide correspondance to viewport action - for example it is useful for navigating bones. I think it is reasonable to add a recursive method to the both viewport and outliner parenting hierarchies as ctrl+] or ctrl+shift+] and also keep them corresponding with viewport actions. (For example, Shift part stands for "expanding" and ctrl part stands for "recursive") Alt hotkey usually mean "antiaction" (for example, alt+G, atl+R resets objects transform), it is better to keep use it in that way (this is not the case for using Alt). In mesh modeling L hotkey allow to select the entire mesh chunk/island on mouse hover, but as far as I remembel there is no such an action available for parenting hierarchies in object mode while is demanded. Quite similar behaviour can be found in nodes handling as well, so linear hierarchies handling behaviour is supposed to be unified across the program. Also, a side note, autoselecting the entire hierarchy by picking some its part is a behaviour of a **common groups** paradigm, which was requested is not presented in Blender yet because of cumulativity of a collections (the ability to store the same object in multiple collections) which is not compatible with linear hierarchies.
Member

I think it is reasonable to add a recursive method to the both viewport and outliner parenting hierarchies as ctrl+] or ctrl+shift+] and also keep them corresponding with viewport actions.

This suggestion looks perfect. Lets wait for module devs answer as there is now clear indication how select hierarchy should behave.

> I think it is reasonable to add a recursive method to the both viewport and outliner parenting hierarchies as ctrl+] or ctrl+shift+] and also keep them corresponding with viewport actions. This suggestion looks perfect. Lets wait for module devs answer as there is now clear indication how `select hierarchy` should behave.
Philipp Oeser removed the
Interest
User Interface
label 2023-02-10 09:21:23 +01:00
Member
cc @pablovazquez
Sign in to join this conversation.
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#103723
No description provided.