Home

Awesome

What does it do?

Running the wizard will combine all the meshes on the chosen Game Object and its children which share the same material. If there is more than a single material in all sub-objects, sub-objects will be created in the result so that each corresponds to a single material. A prefab will be created from the combined Game Object, with all the newly created merged meshes. The original will be set inactive in the scene and the combined Game Object will be put in its position.

How does it work?

Put the provided script in a folder called Editor. In the Menu Bar a new entry will appear ("Ennoble Tools/Mesh Combine Wizard"). Picking this option will show the wizard dialog. The parent of objects to be combined should be assigned to a field called Combine Parent, which may be auto-assigned based on existing editor selection.

Variable Result Path is an optional string representing a path relative to the 'Assets/' folder, inside which the result mesh and prefab will be created. Leave blank to place the result in the 'Assets/' folder.

Generate secondary UVs option is explained by Unity's documentation:

When you import a model asset, you can instruct Unity to compute a lightmap UV layout for it using [[ModelImporter-generateSecondaryUV]] or the Model Import Settings Inspector. This function allows you to do the same to procedurally generated meshes.

Benefits:

Known limitations:

Versions:

3.0 - Fixed obsoletion warnings. Added option for secondary UVs generation. Added a few more options. 2.0 - Added proper support for meshes with over 65K verts. Hardened the script and commented for public consumption. 1.0 - Original release

State

This small script is updated to work with Unity 2022.2. It is not being regularly maintained.