Users often want to select all objects in a collection, or all (direct or indirect) children of an object to transform them together, or apply different operations. For this, the Outliner context menu already provides Select Objects when right-clicking on a collection, and Select Hierarchy when right-clicking on an object. Since these are such common/useful operations, faster access would be a good quality of life improvement.
- Double clicking on the icon of a collection should select all contained objects, even those contained in nested collections. I.e. execute the Select Objects logic. The collection itself does not need to be selected (although it might be fine to do it).
- Double clicking on the icon of an object should select the hierarchy including the clicked on parent object. Ie. execute the Select Hierarchy logic.
- The collapsed or opened state of tree elements should be ignored. So the children should be selected when double clicking on an object for example, even if the object element is collapsed and thus doesn't show its children in the Outliner.
Note that both cases are an operation acting on the entire hierarchy, so they are recursive. With the difference that the first doesn't keep the clicked on element selected, while the second does. Other than that these are consistent operations.
Corner Cases to Consider
- If an object has a child that is not in the same collection as the parent, double clicking the collection icon should not select that child object. Only the objects actually contained in that collection (directly or indirectly) should be selected.
- Ideally: When objects or collections are linked into multiple collections, only the hierarchy that was clicked on should be selected in the Outliner, not the other occurrence of it. This is better explained visually: Note how even though the Suzanne object gets selected properly (orange font), only the clicked on Outliner element gets selected (blue element highlight). Note that the existing Select Objects and Select Hierarchy don't behave this way, they select all occurrences in the Outliner. Therefore this is more of a nice-to-have feature.
- An new operator can be added that is invoked with a double-click in the Outliner, checks if the cursor is over a relevant icon, and executes the logic then.
- The last corner case mentioned above (with the video explanation) can be done by selecting the tree element and updating the object selection from this with ED_outliner_select_sync_from_outliner(). If done the other way around (object is selected and outliner tree is synced from that), all occurrences would be selected in the Outliner. This is what the existing Select Objects and Select Hierachy do, and it's a bit tricky to correct that.