Search Unity

Feature Request Add option to prevent selection of objects excluded by Hierarchy search (greyed out)

Discussion in 'Editor & General Support' started by huulong, Jul 24, 2022.

  1. huulong

    huulong

    Joined:
    Jul 1, 2013
    Posts:
    224
    I noticed that the Hierarchy search will filter some objects, gray out the others (if Preferences > Scene View > Search > Enable filtering while searching is checked), so it's easier to spot and select remaining objects.

    However, if you click on them in the Scene View, you can still accidentally select excluded objects if they overlap the ones of interest!


    upload_2022-7-24_21-7-56.png

    Here, clicking on a flower will still select the Background, which is not even in the filtered Hierarchy.



    It would be nice to have an option to exclude greyed out objects also from selection with mouse.

    Currently, the only reliable way is to select those objects while filtering directly in the Hierarchy, but when there are many instances of some prefab with the same name, it's not convenient.

    And of course you can lock selection when not filtering, but while this works well with objects grouped under a common parent (you just have to lock the parent), when those objects are scattered or siblings of the ones of interest, you cannot just lock their parent (either they don't have a common parent, or it is also the parent of your objects of interest!). And there is no way to batch lock many objects (if you multi-select objects then click lock icon, it will only lock one object). In fact, that would be the topic for another Feature Request: allow batch lock select/toggle view.

    But for now, reliably selecting items not filtered out would help.

    Bonus suggestion: option to select sprite (and other visual) object entirely based on raycast/visual. While not convenient when selecting sprites with many "holes", it would help a lot when you select a sprite that is covered by a bunch of invisible objects (like canvases), and bigger sprites whose bounding box is covering theirs, but they are not visually covering it.

    As an alternative to avoid the "hole in sprite" issue, use the bounding box of all sprite pixels whose alpha is not 0 to determine mouse selection.

    Example:

    2022-07-24 even during Hierarchy filter clicking on sprite doesnt guarantee selection 2.png

    Bounding box of rose in green
     
    mgear likes this.