Using the Toolbox
What is the Toolbox ?
The Toolbox is a feature introduced in since the PiXYZ PLUGIN for Unity 2018.3.
It is part of the optimization and staging tools available in this plugin.
The Toolbox comes with out of the box with features giving the ability to optimize or stage your scene in a semi automatic way. Unlike the Rule Engine, the Toolbox actions are applied manually on the currently selected GameObjects in the scene. This allows after-import modifications, which can be useful for simple on-the-go tweaks, finding a convenient chain of actions for creating a rule, or for doing operations that the Rule Engine can't do.
The Toolbox isn't restricted to PiXYZ-imported models ; it can work on anything in your scene.
The Toolbox has a set of Default Toolbox Actions that contains common tools for optimizing / staging your scene. Some of them are directly using PiXYZ native Core algorithms.
Some actions will act as filters and will simply modify your selection, but some other, such as Merge, Decimate or Create Uvs for example will modify the asset itself.
How to use the Toolbox ?
First make sure you have an initial selection in the Unity Editor. The selection can be altered if you are using Filter Action (that will reduce the number of GameObjects selected) or a Get Action (that will increase the number of GameObjects selected).
Then, choose the action you want to run from the Toolbox.
The Toolbox is accessible in 3 maners :
- Through the PiXYZ menu in the main Unity ToolBar.
- Through a right click in the Hierarchy or even directly in the Scene View
- Through a right click on the hierarchy
WARNING Toolbox actions can't be undone
WARNING Since the Unity Editor doesn't handle well selections of larger than 1000 GameObjects, the Toolbox won't operate for these amounts of objects. Make sure selection isn't too large and that you are not using Get Actions that may select thousands of GameObjects. If that limitation is an issue, you can use the Rule Engine instead, which doesn't have any limitation.
Extending the Toolbox
If the Default Toolbox Actions doesn't offer what you need, you can implement you own Toolbox actions. Benefits are the simplicity & convenience, and the fact that it can also be used in the Rule Engine.
To proceed, simply click PiXYZ > Toolbox > Create New Custom Action
A new script will be created in your project. This script is by default named "NewCustomActions.cs" and it always placed in the Assets/Plugins/PiXYZ/Editor folder.
NOTE Click PiXYZ > Toolbox > Refresh Toolbox to refresh the Toolbox menu (this isn't automatic).
This will update the autogenerated file at Assets/Plugins/PiXYZ/Editor/ToolboxMenuItems.cs.
If the toolbox doesn't regenerate properly, you can edit this file manually.
For more information on how to implement your Action logic, please read Creating a Custom Action from the Scripting Documentation.