Luca Pierabella
Menu

About

Filter Hierarchy

· Original project page

Often in my experience in Unity I heavily retouched the scene, when I bake lights or ambient occlusion for example, props are never “ordered” as they should be. So I needed to write a tool that allows me to filter items based on the components in them and then rearrange them and parents at my leisure

The Filter Hierarchy window in Unity, listing the components of the selected objects
FIG 1 Full size

In this first sequence of images, you see how when you have selected multiple objects, the tool highlights the components of which this is made Once you choose the criteria by which simply filter them by clicking on one of the three options, in this case, “Filter Selected” the selection is precisely filtered according to selected parameters.

Filter by Selection:

The selection filtered to the objects with a MeshRenderer
FIG 2 Full size

Otherwise, it is likely that on certain occasions however you want to remove objects from the selection, if they have a certain component, “Filter Exclusion” in fact detract from the selection of items that include the required components

FilterByExclusion:

The selection without the objects that have the excluded components
FIG 3 Full size

Subsequently, after filtering the selection, it can be used to have to parent him to a new group or simply to an existing object. As you can see by specifying the new group or the “father” to contain objects the tool will rearrange the objects in our place

Main Camera and Terrain selected, with Sky Dome set as the group object
FIG 4 Full size
Main Camera and Terrain moved under Sky Dome in the hierarchy
FIG 5 Full size
Main Camera and Terrain selected, with NewGroup as the name of the new group
FIG 6 Full size
Main Camera and Terrain moved under the new NewGroup object
FIG 7 Full size

Video on Vimeo

Filter Hierarchy from Luca Pierabella on Vimeo.