# Filter Hierarchy

January 2016 · 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](https://pierabellaluca.com/assets/archive/filter-hierarchy/to-order-1440.jpg)

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](https://pierabellaluca.com/assets/archive/filter-hierarchy/filter-by-selected-1440.jpg)

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](https://pierabellaluca.com/assets/archive/filter-hierarchy/filter-by-exclusion-1440.jpg)

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](https://pierabellaluca.com/assets/archive/filter-hierarchy/parent-to-obj.jpg)

![Main Camera and Terrain moved under Sky Dome in the hierarchy](https://pierabellaluca.com/assets/archive/filter-hierarchy/parent-to-obj-2.jpg)

![Main Camera and Terrain selected, with NewGroup as the name of the new group](https://pierabellaluca.com/assets/archive/filter-hierarchy/parent-to-group.jpg)

![Main Camera and Terrain moved under the new NewGroup object](https://pierabellaluca.com/assets/archive/filter-hierarchy/parent-to-group-2.jpg)

[Video on Vimeo](https://vimeo.com/166687701)

[Filter Hierarchy](https://vimeo.com/166687701) from [Luca Pierabella](https://vimeo.com/user1489637) on [Vimeo](https://vimeo.com).

## Let's talk.

Tell me about the pipeline, the workflow, the system, or the game. I answer every message myself.

- [hello@nephelos.com](mailto:hello@nephelos.com)
- [Book a call](https://cal.com/luca-pierabella/quick-chat)
- [LinkedIn](https://www.linkedin.com/in/luca-pierabella-93308413/)
- [GitHub](https://github.com/elpie89)

Luca Pierabella · Bordeaux, France

Writing: [Hectiq Devlog](https://hectiqgames.substack.com/)
