Easy Mesh Combiner Documentation
For support and contact
mtassets@windsoft.xyz
Script Code Viewer
Loading Documentation
Summary
...
Welcome to Easy Mesh Combiner Documentation! By reading this documentation, you will understand how Easy Mesh Combiner works and how to use it and get the most out of it. Come on! Make sure that this HTML file is in the same directory as the "DocumentationFiles" folder. This way you will not have problems with formatting and displaying the videos and images on the page. If you still have problems with the tool, even after consulting this documentation, please contact mtassets@windsoft.xyz for help and support. If you have any questions, problems or feedback, feel free to contact me!

I am always willing to help, open to suggestions and always do my best to offer a quick and useful service to my customers! 😀
What is the Easy Mesh Combiner? Easy Mesh Combiner is just a tool that allows you to merge your 3D meshes to reduce Draw Calls and optimize your game. You can use it either to merge the scenario's meshes or others. First Steps To Combine Before you combine your meshes, you must follow some prerequisites.

Step 1 - All objects that you want to combine must have the "Mesh Filter" and "Mesh Renderer" components. If any GameObject has only 1 of these components, you will see an error message. If any GameObject does not have these 2 components, it will only be ignored. One of the GameObjects selected to be merged has the 2 components correctly. Step 2 - Make sure that all "Mesh Filter" components do not have null meshes and that all "Mesh Renderer" components do not have null materials, otherwise you may see an error message. In the image, the Mesh Filter component is with the null mesh, the Mesh Renderer also has 1 null material. This will cause errors during merge. Step 3 - Make sure there is 1 material for each submesh of your mesh. A mesh that uses more than 1 material, has submeshes. For example, if a mesh has 2 materials, it has 2 submeshes. But if you provide less materials than this mesh requires, some parts of the mesh will not be visible. If you supply more materials than this mesh needs, Unity will show you a warning. Easy Mesh Combiner requires that all meshes have the same amount of material for the same amount of submeshes. In the image, Mesh Renderer is providing more materials than the precise mesh. If fewer materials were being supplied than the precise mesh, parts of the mesh would not be visible. This will generate errors during merge. Step 4 - Now that everything is ready, it's just you to combine the meshes! For this, keep reading.
How to Combine Meshes Combining the meshes through the Editor is super easy and you will not have to write even 1 line of code. You can even save the data in your project files. Let's start!

Step 1 - Select the GameObjects you want to combine, or select the GameObject root that you want to combine the children GameObjects. GameObjects selected to be combined. Step 2 - Right click on the selection, then click on Combine Meshes. (If this option is not showing for you, you can click the "Tools > MT Assets > Easy Mesh Combiner > Mesh Combiner Tool" tab). Right-click menu. Step 3 - The "Combiner Tool" window will open for you. Just choose the desired options and click on Combine Meshes! After combining, a new GameObject with the name of your choice will appear in your GameObjects hierarchy, containing the merged mesh and you can still manage or unmerge it later if you want. Window Combiner Tool. You can set your merge preferences in the Preferences of Merge box. When you select gameobjects, they will be validated, invalid GameObjects will throw error logs in the Logs of Merge frame. You can see the statistics of the selected meshes before the merge and after the desired merge. It will only be possible to combine meshes if this window detects at least one valid GameObject. Step 4 - Now that everything is ready, it's just you to combine the meshes! You can continue reading the next topics to learn more if you want! If you want to undo the merge, it is NOT recommended that you delete the mesh resulting from the merge manually. Always use the "Combined Meshes Manager" component for this!

(This component is automatically added to all meshes resulting from the merge)


This was the basics for you to combine the meshes of your scenes! Continue reading the documentation to understand more about all the features of the Easy Mesh Combiner and all its components too!
Mesh Combiner Tool: Explaining the Interface In this topic, the "Mesh Combiner Tool" window interface that merges in the Editor, will be explained in parts. Window top bar In this area you have quick access to a summary of your current merge. If you have not yet done a merge and are just selecting the GameObjects you want to merge, you can see how many GameObjects are currently selected, how many meshes have been detected, among other things. This area will also display a message if your merge has already been completed successfully. The "Preferences of Merge" board This is where you set your merge preferences. Here you can define the maximum resolution of your Atlas, if you want to activate Lightmap support and many other things. You control everything around here. The "Logs Of Merge" board While selecting GameObjects so you can combine them, Easy Mesh Combiner will validate them in real time as well. If Easy Mesh Combiner finds something that is good for you to know, it will show you warning or error logs here and this happens before you merge it, so you know everything in advance. In some merge methods, notification messages can also appear here at the end of a merge to inform you of something useful or that you need to know. The Statistics board Here, you have a quick summary of the current statistics for your selected meshes that will be combined and also an estimate of the statistics of the mesh resulting from the merge. Easy Mesh Combiner will even show you the estimated optimization rate you will achieve when combining your selected meshes! Window bottom bar This is the simplest part! This is where you can operate the Easy Mesh Combiner and start your mesh merging! Mesh Combiner Tool: Settings And Options Now see a table that contains all the settings, explanations and their corresponding variables of Window.
In the Editor Inspector, you can also always hover over a variable name, to see a detailed description of what the variable does. Name=>Description 20%=>auto After Combine=>What should the Easy Mesh Combiner do after combine? If you choose Disable Original Meshes, only the original meshes will be disabled, keeping all other components (such as collisors and etc), so you do not waste time having to modify your scene. If you choose "Disable Original GameObjects", the oringinal GameObjects will be disabled. Combine Method=>The merge method that will be used to combine the meshes. Combine Children=>Does the Easy Mesh Combiner have to look for child meshes in the selected GameObjects? Combine Inactives=>[Requires Combine Children as true]
Does the Easy Mesh Combiner have to combine childrens meshes, which are disabled?
Lightmap Support=>It causes the generated meshes to support lightmaps! Enable this option if you plan to generate lightmaps from the merged meshes. Keep in mind that enabling this option can greatly increase the merge time. Lightmap Mode=>[Requires Lightmap Support as true]
Defines the working mode of Lightmaps support.
Use Default Params=>[Requires Lightmap Mode as GenerateData]
Turn this parameter off if you want to use custom parameters for Lightmap generation.
Angle Error=>[Requires Use Default Params as false]
Maximum allowed angle distortion of Lightmap data.
Area Error=>[Requires Use Default Params as false]
Maximum allowed area distortion of Lightmap data.
Hard Angle=>[Requires Use Default Params as false]
This angle (in degrees) or greater between triangles will cause seam to be created.
Pack Margin=>[Requires Use Default Params as false]
How much uv-islands will be padded.
Save Mesh In Assets=>If this option is active, Easy Mesh Combiner will save the combined meshes in the files of your project. This makes it easy to create prefabs, and your game will already be meshed together after building. Save Prefab Of This=>Enable this option to save a prefab automatically after the merge. Prefab Name=>[Requires Save Prefab Of This as true]
The name that will be given to the prefab generated.
Name Of This Merge=>The name that the GameObject resulting from this merge will have. One Mesh Per Material
Parameters
=>[All Fields Below Requires Combine Method as OneMeshPerMaterial]
Add Mesh Collider=>If this option is enabled, a Mesh Collider will be automatically added to the mesh resulting from the merge. All In One
Parameters
=>[All Fields Below Requires Combine Method as AllInOne]
Material To Use=>The material that will be used in the mesh resulting from the merge. Max. Text. Per Atlas=>It represents the maximum amount of textures an Atlas can have. If the number of textures exceeds this limit, a new Atlas will be created. This avoids reducing the quality of textures in the Atlas. Atlas Max Resolution=>The maximum resolution that the Atlas resulting from the merge can have. Atlas Padding=>The spacing between each texture in the Atlas. Mip Map Edges Size=>The size of the border that each texture in the Atlas should have. The larger the border, the less chance of a transparency problem occurring while the mesh is further away from the camera. Merge Tiled Textures=>The treatment mode in which the EMC should use to combine the Tiled Textures. Default Main Tex. Prop.=>If this option is enabled, EMC will use the property names from the current SRP to find and apply the Main Textures of each mesh in its materials. Find Main Text. In=>[Requires Default Main Tex. Prop. as false]
The name of the property in which the EMC should look for textures, in the materials.
Apply Main Text. In=>[Requires Default Main Tex. Prop. as false]
The name of the property on which the EMC should apply the texture to the resulting mesh Material.
Material Color Support=>If this option is enabled, Easy Mesh Combiner will try to find the Main Texture color in the Materials and take it into account in the Atlas generation process. Find Colors In=>[Requires Material Color Support as true]
The name of the shader property, which is responsible for storing the main texture Colors, in the material of its meshes.
Metallic Map Support=>If this option is enabled, EMC will process Metallic Maps of the Meshes as well. Find Text. Maps In=>[Requires Metallic Map Support as true]
The name of the property that the EMC should look for the Metallic Maps in the materials.
Apply Merged Map In=>[Requires Metallic Map Support as true]
The name of the property that the EMC should apply the Metallic Map to the Material resulting from the merge.
Specu. Map Support=>If this option is enabled, EMC will process Specular Maps of the Meshes as well. Find Text. Maps In=>[Requires Specu. Map Support as true]
The name of the property that the EMC should look for the Specular Maps in the materials.
Apply Merged Map In=>[Requires Specu. Map Support as true]
The name of the property that the EMC should apply the Specular Map to the Material resulting from the merge.
Normal Map Support=>If this option is enabled, EMC will process Normal Maps of the Meshes as well. Find Text. Maps In=>[Requires Normal Map Support as true]
The name of the property that the EMC should look for the Normal Maps in the materials.
Apply Merged Map In=>[Requires Normal Map Support as true]
The name of the property that the EMC should apply the Normal Map to the Material resulting from the merge.
Normal Map 2 Support=>If this option is enabled, EMC will process Normal Maps 2 of the Meshes as well. Find Text. Maps In=>[Requires Normal Map 2 Support as true]
The name of the property that the EMC should look for the Normal Maps 2 in the materials.
Apply Merged Map In=>[Requires Normal Map 2 Support as true]
The name of the property that the EMC should apply the Normal Map 2 to the Material resulting from the merge.
Height Map Support=>If this option is enabled, EMC will process Height Maps of the Meshes as well. Find Text. Maps In=>[Requires Height Map Support as true]
The name of the property that the EMC should look for the Height Maps in the materials.
Apply Merged Map In=>[Requires Height Map Support as true]
The name of the property that the EMC should apply the Height Map to the Material resulting from the merge.
Occlus. Map Support=>If this option is enabled, EMC will process Occlusion Maps of the Meshes as well. Find Text. Maps In=>[Requires Occlus. Map Support as true]
The name of the property that the EMC should look for the Occlusion Maps in the materials.
Apply Merged Map In=>[Requires Occlus. Map Support as true]
The name of the property that the EMC should apply the Occlusion Map to the Material resulting from the merge.
Detail Map Support=>If this option is enabled, EMC will process Detail Maps of the Meshes as well. Find Text. Maps In=>[Requires Detail Map Support as true]
The name of the property that the EMC should look for the Detail Maps in the materials.
Apply Merged Map In=>[Requires Detail Map Support as true]
The name of the property that the EMC should apply the Detail Map to the Material resulting from the merge.
Detail Map Support=>If this option is enabled, EMC will process Detail Maps of the Meshes as well. Find Text. Maps In=>[Requires Detail Map Support as true]
The name of the property that the EMC should look for the Detail Mask in the materials.
Apply Merged Map In=>[Requires Detail Map Support as true]
The name of the property that the EMC should apply the Detail Mask to the Material resulting from the merge.
Emission Map Support=>If this option is enabled, the Easy Mesh Combiner will try to look up Emission Map textures in each material of this model and combine them as well. Find Text. Maps In=>[Requires Emission Map Support as true]
The name of the property that the EMC should look for the Emission Map in the materials.
Apply Merged Map In=>[Requires Emission Map Support as true]
The name of the property that the EMC should apply the Emission Map to the Material resulting from the merge.
Find Colors In=>[Requires Emission Map Support as true]
The name of the property that the EMC should look for the Emission Colors in the materials.
Global Illumination=>[Requires Emission Map Support as true]
Defines the type of Global Illumination to be used by the Emission, in the Material resulting from the merge.
Pink Normal Maps Fix=>[Requires Normal Map Support or Normal Map 2 Support as true]
If this option is enabled, EMC will use an algorithm to prevent the generated Normal Maps Atlas from being colored pink. This can be useful on a variety of platforms.
Texture Compression=>Texture compression reduces the size (in memory) of Textures generated during merge. Hover over this option in the Editor for more details. Add Mesh Collider=>If this option is enabled, a Mesh Collider will be automatically added to the mesh resulting from the merge. Just Material Colors
Parameters
=>[All Fields Below Requires Combine Method as JustMaterialColors]
Material To Use=>The material that will be used in the mesh resulting from the merge. Default Color Property=>If this option is enabled, EMC will use the property names from the current SRP to find and apply the colors of each mesh in its materials. Find Colors In=>[Requires Default Color Property as false]
The name of the property in which the EMC should look for colors in Materials of each mesh.
Apply Color Atlas In=>[Requires Default Color Property as false]
The name of the property to which the EMC should apply the color atlas in Material of mesh result.
Texture Compression=>Texture compression reduces the size (in memory) of Textures generated during merge. Hover over this option in the Editor for more details. Add Mesh Collider=>If this option is enabled, a Mesh Collider will be automatically added to the mesh resulting from the merge.
Mesh Combiner Tool: About the Merge Method "One Mesh Per Material" Briefly speaking, the "One Mesh Per Material" method combines all meshes that share the same material into one. So if you have 5 meshes that use material A, those 5 meshes will be combined in 1 mesh, which will use this material A. I will explain more precisely below.

First the Easy Mesh Combiner looks for the Meshes that are Selected. Then, the Easy Mesh Combiner groups meshes that use the same material. When you have a mesh that uses more than 1 material, the Easy Mesh Combiner will separate the faces of this mesh according to each material. Each box represents a GameObject containing the Mesh Filter + Mesh Renderer.
Green boxes use material A, blue boxes use material B and brown boxes use material C.
After separating each mesh, it creates a new GameObject. This new GameObject will group the new meshes resulting from the merge. Then after that, the Easy Mesh Combiner will combine all the meshes and submeshes that share the same material, and insert all into a one mesh inside the GameObject created in past step. And finally, the Easy Mesh Combiner simply disables the old meshes (if you selected this in After Combine). Pros Of "One Mesh Per Material" Merge Method It is the most optimized and fastest merge method Does not modify any texture, material or UV Can combine meshes that use any type of materials It is the simplest method of merge The lower the amount of materials, the greater the reduction of draw calls Fully compatible with mipmaps You do not need "Read/Write enabled" permissions in the textures/models import settings It is compatible with all types of meshes! It is compatible with Normal Maps, Height Maps and other types of effects. Maintains full control over the properties of all original materials, as the original materials will still be used in combined meshes that use the same material Cons Of "One Mesh Per Material" Merge Method It is not always possible to reduce Draw Calls too much
Mesh Combiner Tool: About the Merge Method "All In One" Briefly speaking, the "All In One" method will merge all meshes into one, and only one new mesh will be generated that will be the junction of all the others. Then it will merge all the textures into one atlas, and will insert that atlas into a new material. At the end, this material will be inserted into the unique mesh.

With this merge method, if you have 5 meshes, only 1 mesh, 1 material and 1 atlas will remain after the merge. This method is a bit more complex, so try to understand well how it works before using it. Some rare meshes can offer problems for this method, according to the way in which they were created. For example, some meshes may contain errors in your UV map, which can generate errors during the merge, however, the vast majority of the tested meshes did not result in errors during the merge and everything worked perfectly in tests! First, it merges all the meshes together, creating a new mesh that is the junction of all. However, this new mesh does not have any material. After you provide a custom material (Material To Use), the Easy Mesh Combiner will copy your material when creating the new material. This new created material will be inserted into the created mesh. After this, the Easy Mesh Combiner will extract the texture of each old mesh and will create an atlas texture. It will create atlas textures according to your preferences, being able to create atlas with textures, normal maps, occlusion maps and etc. You can even set a maximum texture limit for each Atlas, so if that limit is exceeded, the mesh can have more than 1 Atlas. This will help to maintain a better quality of the textures present in the Atlas, to prevent them from being too small to fit more textures. Then the created mesh will have its UVs modified so that it can receive the new atlas. Then the atlas is inserted into the new mesh created. Finally, old meshes are disabled (if you selected this in After Combine). Resting only the mesh created with its material and texture with atlas. Pros Of "All In One" Merge Method Most of the time, it dramatically reduces the amount of draw calls When you combine compatible meshes with this method, it returns optimum performance It can work with effects like Normal Maps, Height Maps and the like. It also supports effects such as Normal Maps, Height Maps and etc. Cons Of "All In One" Merge Method It has a longer processing time, depending on the size of the textures, amount of meshes and vertices. You need to enable the "Read/Write enabled" option for all model/textures in the import settings. Always be tested so you know if you will get a desired result
Mesh Combiner Tool: About the Merge Method "Just Material Colors" The "Just Material Colors" merge method only merges the colors of the materials in your meshes. To do this, it collects the color of each material that its meshes use, creates an atlas that contains a palette of colors for each mesh that was merged, then color that mesh with its respective color. It is a very simple merge method and made for people who need to merge their models that do not use textures, just material colors!

First, it merges all the meshes together, creating a new mesh that is the junction of all. However, this new mesh does not have any material. Then a new material is created from the material you provide (Material To Use). This new created material will be inserted into the created mesh. After this, the Easy Mesh Combiner extracts the color of each material that its meshes use, and inserts those colors into an atlas. Then the created mesh will have its UVs modified so that it can receive the new atlas. Then the atlas is inserted into the new mesh created. Finally, old meshes are disabled (if you selected this in After Combine). Resting only the mesh created with its material and texture with atlas. Pros Of "Just Material Colors" Merge Method Most of the time, it dramatically reduces the amount of draw calls Always reduce calls to 1 draw call, regardless of how many meshes you have Perfect for combining just the colors of your model, no need for textures. It is optimized and fastest merge method. It is the simplest method of merge You do not need "Read/Write enabled" permissions in the textures import settings It is compatible with all types of meshes! Cons Of "Just Material Colors" Merge Method This merge method works only with material colors. Any kind of texture is simply ignored. It does not support special effects like Normal Maps and the like.
Mesh Combiner Tool: Using additional effects like Normal Maps, Height Maps, and more It is very simple to process and combine the maps of your models too, using the Easy Mesh Combiner! See below how to include the maps of your models (Normal Map, Height Maps and etc.) in your merges too!

One Mesh Per Material: The "One Mesh Per Material" method can merge your meshes with special effects automatically without any problem, plus you will not have to configure anything other than your own shaders.

Just Material Colors: The "Just Material Colors" method is designed to support only material colors, so it does not support texture merging or special effects.

All In One: "All In One" supports special effects of your materials! You just need to enable support and configure it. After that, just merge! See below how to do the procedure.

Step 1 - First, activate support for the effect you want. When you activate support for an effect, the Easy Mesh Combiner, in addition to creating an atlas for your model's textures, it will also create an atlas with the textures of the effect you want. This atlas will be based on the texture atlas of your model. Step 2 - Select the property of your model materials, which store the Texture/Map of the desired effect! This is how the Easy Mesh Combiner will know where to look for the textures of the effect that you also want to apply, to combine them! Step 3 - Select the material property you provided Material To Use to store the atlas of the desired effect. In this case, the _BumpMap property of the material I supplied (my material is a Standard) will be responsible for storing the Normal Map atlas that the Easy Mesh Combiner generates. Property Name To Find: It is nothing more than the name of the variable that stores the textures of the desired effect in its materials. For example, if you have enabled Normal Maps support, the Easy Mesh Combiner will look for the variable _BumpMap in each shader of each material in your mesh, when the Easy Mesh Combiner finds this variable it will extract the texture of Normal Map of the variable. When it has all the normal map textures, it will merge them into an atlas.

Property Name To Insert: It is the variable that will store the atlas texture of normal maps, in the final material. For example, at the end of the merge, the Easy Mesh Combiner will look for the variable _BumpMap in the final material and will insert the normal maps atlas in this variable.
Mesh Combiner Tool: Warning before using EMC with HDRP, URP or Custom Shaders URP, LWRP and HDRP (rendering pipelines) have new default property names in the shaders. For example, in the Built-In pipeline (Unity default) the default name of the property that stores your meshes textures is _MainTex, however, in HDRP and URP this default name has been changed to _BaseMap. Therefore, if you use HDRP, URP shaders or different shaders (created by third parties for example), you can change the properties where the EMC seeks the textures. To do this, deselect the option Default Main Tex. Prop., Doing so the Easy Mesh Combiner will allow you to change the default properties where the textures will be searched and applied. Mesh Combiner Tool: About the Combined Meshes Manager The "Combined Meshes Manager" is a component automatically added by Easy Mesh Combiner, to all meshes resulting from the merge. Through this component you can manage your combined mesh. Among the functions that this component allows you, among them are: Undo your merge, export your combined mesh to an OBJ file, view files that are linked to the combined mesh, view merge information, etc. Mesh Combiner Tool: How to undo a previously made merge To undo a merge that was made in the Editor, you can undo the merge with just 2 clicks. After undoing the merge, the original meshes will return to their original state. To do this, follow the steps below.

Step 1 - Click the GameObject that contains the merged meshes. This GameObject contains the combined meshes and the "Combined Meshes Manager" component. Step 2 - In the Inspector, click "Undo And Delete This Merge!". That's it! Undoing a merge will restore all original GameObjects to their original state at the time the merge was performed. If your combined mesh is a prefab, don't worry, copies of this prefab will not be affected.
Mesh Combiner Tool: Current Limitations See the current limitations of the Easy Mesh Combiner.

Slow merging for meshes with Lightmaps Support
This is a limit of Unity. If you enabled the Lightmap Support option during merge, and a mesh ends up having more than 50.000/64.000 vertices, processing can become VERY slow. You can try reducing the mesh vertices count, or separating the merge into more parts.
Runtime Mesh Combiner: How This Component Works This component is the component that allows you to combine meshes on Runtime. By default, this component always uses the "One Mesh Per Material" merge method as the other methods are not possible in Runtime. With this component, you only need to indicate which GameObjects you want to combine and then use your C# API to control it to combine meshes or to undo your mesh combinations. After a merge is done using this component, the mesh resulting from the merge will be placed on the GameObject that the Runtime Mesh Combiner is on. For this reason, never place this component in a GameObject that already contains a Mesh Filter and/or Mesh Renderer component. If you place the Runtime Mesh Combiner on a GameObject that already contains one of these two components, the merge will not be possible. Runtime Mesh Combiner: Explaining the Interface In this topic, the interface of the "Runtime Mesh Combiner" component will be explained. The "Preferences" and "Target Meshes" Preferences - In preferences you can define parameters for the merge you do.

Target Meshes - This is a list, and you can define all the target GameObjects in which you want to combine them. The "Merge Events" and "Debug" Merge Events - Here you can register your own C# methods to be called whenever a merge is made or undone on this component.

Debug - Here you can consult variables to debug your merges.
Runtime Mesh Combiner: Combining Meshes that will NOT move across the scene This is the simplest type of mesh merging using the Runtime Mesh Combiner, as the meshes to be merged will not move around the scene. Bearing in mind that the Runtime Mesh Combiner stores the mesh resulting from the merge in the same GameObject where the Runtime Mesh Combiner is, the position of the mesh resulting from the merge will be the same as the position of the original meshes.

To do this kind of merge you can simply create a new GameObject in your scene. Then place the Runtime Mesh Combiner component on this new GameObject. Once this is done, add the GameObjects of the meshes you want to combine to the Target Meshes To Merge list of the Runtime Mesh Combiner. After that, just use the component's C# API to merge!

See the screenshot below for a simple example of how to arrange GameObjects to combine these meshes that won't move around the scene. The GameObject ParentGameObject is the parent of all meshes. It will not move around the scene and neither will the meshes move. Therefore, a new GameObject called Runtime Mesh Combiner was created and the Runtime Mesh Combiner component was added to it.

The GameObject "ParentGameObject" has been added to the Target Meshes To Merge list of the Runtime Mesh Combiner component and now when combining the meshes everything will work as expected!

Remembering that with the Combine Childrens Too option activated, we only need to add the GameObject "ParentGameObject" to the list, as the Runtime Mesh Combiner will automatically find its child meshes.
Runtime Mesh Combiner: Combining Meshes that WILL move across the scene Combining meshes that will move across the scene requires a little more attention and a slightly different approach. Bearing in mind that the Runtime Mesh Combiner places the mesh resulting from the merge in the same GameObject as the Runtime Mesh Combiner is. Following this logic, we notice that the mesh resulting from the merge will have the same position of the GameObject where the Runtime Mesh Combiner is and the resulting mesh will move along with the GameObject where the Runtime Mesh Combiner is.

To do this kind of merging, first find the mesh's parent GameObject, the GameObject that will move all its child meshes. This parent GameObject, which will move, cannot have Mesh Filter or Mesh Renderer components. After finding this GameObject, place the Runtime Mesh Combiner component in it and then place the GameObjects of the meshes you want to combine in the Target Meshes To Merge list of the Runtime Mesh Combiner. After that, just use the C# API of the Runtime Mesh Combiner to merge the meshes!

See the screenshot below for a simple example of how to arrange GameObjects to combine these meshes that will move around the scene. The GameObject ParentGameObjectThatWillMove is the parent of all meshes and it will move, and consequently when moving it will carry all child meshes with it. Then we add the Runtime Mesh Combiner component to it. Following the Runtime Mesh Combiner working logic, after the mesh resulting from the merge is generated it will be in the same GameObject where the Runtime Mesh Combiner is, and this GameObject is the ParentGameObjectThatWillMove. So when this GameObject moves, consequently it will also move the mesh resulting from the merge and the mesh resulting from the merge will behave as if it were the original meshes being moved!

The GameObject ParentGameObjectThatWillMove has been added to the Target Meshes To Merge list of the Runtime Mesh Combiner component and now when combining the meshes everything will work as expected! With the option Combine Childrens Too activated the Runtime Mesh Combiner will find the child meshes automatically, but if you prefer you can register all the GameObjects of the meshes manually or in other ways!
Runtime Mesh Combiner: Settings And Options Now see a table that contains all the settings, explanations and their corresponding variables, which can be changed in realtime.
In the Editor Inspector, you can also always hover over a variable name, to see a detailed description of what the variable does. Name=>Variable=>Description 20%=>20%=>auto After Combine=>afterMerge=>What should the Easy Mesh Combiner do after matching? If you choose Disable Original Meshes, only the original meshes will be disabled, keeping all other components (such as collisors and etc), so you do not waste time having to modify your scene. If you choose "Disable Original GameObjects", the oringinal GameObjects will be disabled. Add Mesh Collider After=>addMeshColliderAfter=>[Requires afterMerge as true]
This parameter is only available when selecting the option to disable the original GameObjects, after merging them. As they will be disabled, consequently their colliders will also be, so if this option is enabled, Easy Mesh Combiner can automatically add a Mesh Collider to the mesh resulting from the merge.
Combine On Start=>combineMeshesAtStartUp=>Should target meshes be combined at game start? Combine Childrens Too=>combineInChildren=>Does the Easy Mesh Combiner have to look for child meshes in the selected GameObjects? Combine Inactives Too=>combineInactives=>Does the Easy Mesh Combiner have to combine childrens meshes, which are disabled? Recalculate Normals=>recalculateNormals=>If this is active, the EMC will recalculate all normals from the model resulting from the merge and will not keep the original normals. Recalculate Tangents=>recalculateTangents=>If this is active, the EMC will recalculate all tangents from the model resulting from the merge and will not keep the original tangents. Optimize Resulting Mesh=>optimizeResultingMesh=>When you enable this option, the EMC will automatically optimize the mesh resulting from the merge. This option can slightly increase the mesh processing time. Run GC After Undo=>garbageCollectorAfterUndo=>If this variable is enabled, Easy Mesh Combiner will call Unity's garbage collector to get rid of unused assets after undoing a merge. This will help save memory for your game's heap, but can cause bottlenecks in your game as everything is processed. Target Meshes To Merge=>targetMeshes=>A list containing the target GameObjects to which they will have their meshes combined. On Done Merge=>onDoneMerge=>This is a event. Event that calls all registered methods to it, after combining the desired meshes with success. On Done Unmerge=>onDoneUnmerge=>Event that calls all registered methods to it, after undo merge of the desired meshes with success. Target Meshes Merged=>X=>It will show true whenever the target meshes are combined. Show Debug Logs=>showDebugLogs=>Check this option to have the Runtime Combiner display information about GameObjects processed during the merge. This makes debugging easier. While testing GameObjects being merged, leave this box enabled.
Runtime Mesh Combiner: Runtime API See now the complete C# API for Runtime Mesh Combiner component. using MTAssets.EasyMeshCombiner; public RuntimeMeshCombiner someRMeshCombiner; void Start() { //- isTargetMeshesMerged(); // Return true if target meshes is currently combined. bool isCombined = someRMeshCombiner.isTargetMeshesMerged(); //- CombineMeshes(); // Commands the Runtime Mesh Combiner component to make a merge. (If there is no merge already done) someRMeshCombiner.CombineMeshes(); //- UndoMerge(); // Commands the Runtime Mesh Combiner component to undo a merge. (If there is merge already done) someRMeshCombiner.UndoMerge(); } Runtime Mesh Combiner: Example Code To Combine Meshes In Runtime Below you can see an example code. You can use this code snippet as a basis for doing your blends using the Runtime Mesh Combiner. It's very simple! using MTAssets.EasyMeshCombiner; public GameObject[] arrayOfGameObjectsToMerge; public RuntimeMeshCombiner someRMeshCombiner; void Start() { //Fill the list of Target Meshes of Runtime Mesh Combiner foreach (GameObject obj in arrayOfGameObjectsToMerge) someRMeshCombiner.targetMeshes.Add(obj); //Set some preferences of merge someRMeshCombiner.afterMerge = RuntimeMeshCombiner.AfterMerge.DisableOriginalMeshes; someRMeshCombiner.combineInChildren = true; //Finally, start the merge if (someRMeshCombiner.isTargetMeshesMerged() == false) someRMeshCombiner.CombineMeshes(); //To undo the merge we use if (someRMeshCombiner.isTargetMeshesMerged() == true) someRMeshCombiner.UndoMerge(); } Incredible Tips That Can Be Useful: Avoid differences in positioning of Normal Maps and other Maps in the mesh resulting from the merge If you have Textures and Normal Maps (or other types of maps like Occlusion) and are trying to combine using the "All In One" method and your Textures have different and varied resolutions, you can end up with situations where Normal Map for example, looks like be positioned incorrectly. As in the example below. Note that after performing the merge, the normal map seemed more "expanded". This happened because the Textures have a lower resolution than the Normal Map textures. The textures are 256x256 while the normal maps are 512x512. So Normal maps end up being positioned only in the center of the texture and there are still some parts of Normal Maps left. Due to the fact that Normal Map is larger than the texture itself, it ends up being poorly positioned over the texture To correct this problem leave ALL the Textures and Maps of all meshes that will be merged, in uniform resolutions. In my example model, I fixed this problem by simply resizing all Textures, Normal Maps, Occlusion Maps and etc. to the uniform size of 512x512. So in the atlas, all textures will be the same size and the positioning will be perfect! Incredible Tips That Can Be Useful: Edges Mip Map Size Tip The edges in each texture of an atlas avoid distortions by mip maps, when the camera moves away from the 3D model, or remains at certain angles. The larger the border of each texture, the less chance of artifacts appearing. With EMC you have complete freedom to select the size of the borders you want to use in the textures of your atlases, and if you are noticing artifacts in your models, just increase the size of the borders. However, it is important that you never use borders larger than the textures resolutions themselves, because, in addition to increasing the time it takes to create the borders, you will also cause the texture to lose A LOT of quality. Incredible Tips That Can Be Useful: How to Create Prefabs With EMC You can easily create prefabs using the Easy Mesh Combiner. You can simply activate the Save Prefab Of This option or follow the steps below.

Step 1 - Activate Save Prefab Of This and name the prefab that will be generated. This is the main way, and the recommended way, to generate prefabs from the merge mesh. The prefab file will be saved to your project files and the combined mesh manager will still have power over it, as well as managing them normally.
Problems solution: Mesh Filter or Mesh Renderer component missing This problem occurs when a GameObject only has 1 of these two components. For Easy Mesh Combiner to consider a valid mesh, GameObject must have both Mesh Filter and Mesh Renderer. Use the Combiner Tool to see which GameObject is causing this error and correct it. Problems solution: Mesh Filter component missing This problem occurs when a GameObject does not have the Mesh Filter component. Use the Combiner Tool to detect which GameObject is faulty and correct. Problems solution: Mesh Renderer component missing This problem occurs when a GameObject does not have the Mesh Renderer component. Use the Combiner Tool to detect which GameObject is faulty and correct. Problems solution: Have null mesh in Mesh Filter This problem occurs when the Mesh Filter component has no mesh associated with it. To resolve, associate a mesh with the component, or de-select the GameObject. Problems solution: There are insufficient materials, or in excess Make sure there is 1 material for each submesh of your mesh. A mesh that uses more than 1 material, has submeshes. For example, if a mesh has 2 materials, it has 2 submeshes. But if you provide less materials than this mesh requires, some parts of the mesh will not be visible. If you supply more materials than this mesh needs, Unity will show you a warning. Easy Mesh Combiner requires that all meshes have the same amount of material for the same amount of submeshes. Problems solution: Have null materials in Mesh Renderer To resolve this problem, only associate materials with all material slots in Mesh Renderer. Problems solution: Assertion failed: Assertion failed on expression: 'count <= std::numeric_limits::max()'... This problem occurs when you try to combine multiple meshes, where each of these meshes has many materials and many vertices. This is due to a limitation of Unity and you can work around this by using a model editor (such as Blender, Maya, Cinema 4D and others) to reduce the amount of materials that the mesh uses. Problems solution: SetPerIndexUVs failed because the output has >64K vertices This error happens when you enable Lightmap support during merge. For example: If a merged mesh without lightmap support has only 5,000 vertices, and you enable support for lightmaps, this mesh will have 10,000 vertices. So if during conversion to lightmap support, the mesh have more than 64,000 vertices, the lightmap support for that mesh is canceled. This is a limitation of Unity. The only ways to avoid this limitation are to reduce the amount of vertices of the objects to be merged, or merge fewer meshes at once, creating more parts of the merged mesh. Problems solution: Runtime Merge Error "Cannot combine mesh that does not allow access: MeshName..." This error appears when you try to combine meshes at runtime, but the meshes are not marked "Read/Write Enabled" in the import settings. To correct this error, activate the option "Read/Write Enabled" in your meshes and then click "Apply". After that it will be possible to read these meshes and combine them at runtime! Fixing Problems solution: Why isn't my atlas completely filled with my Models textures? It is not always possible for textures to completely fill the atlas, even if they are perfect squares. Textures must have edges (as if they were tiled) in order to be able to support mipmaps with atlas. These borders increase the size of the textures and often make them no longer perfect squares. Another factor is the varying size of the textures or even the spacing between each texture in the atlas (which can be configured in the Easy Mesh Combiner). But these are some of the factors that make it not always possible for textures to completely fill the atlas. Problems solution: Why did the Verts/Tris count increase in my scene after merging? In some cases, after combining the meshes in your scene, you may notice a slight increase in the vertex count when compared to uncombined meshes, which is normal, as Unity renders the entire mesh, even if not all of its parts are being seen. As long as only a part of the mesh is being viewed, the entire mesh is rendered, which contributes to increasing the vertex count currently being viewed. This is generally not a problem, however, if you are seeing BIG increases in vertices after merging, it may indicate that your mesh resulting from the merging is VERY large, and so even if the player sees only a piece of that combined mesh, the whole it is rendered. To solve this, you can try to combine your meshes through groups, instead of combining a large area of ​​your scene in just 1 mesh. An example of this is, if you have a scene of 1000 meters, try to combine the meshes in groups of 100 or 200 meshes, and each group will only contain the closest meshes. Thus, if a camera sees a piece of the combined mesh only, only the group being viewed will be rendered by Unity. You can also use an LOD system like the Ultimate LOD System MT to generate smaller vertices versions of your combined mesh, all by the Editor and automatically! Problems Solution: After combining your meshes using the "All In One" method, did the atlas texture become distorted? See an example of distorted texture... Although this is rare, texture distortions, after merging, can occur for several reasons. One is the architecture (that is, the way) in which the model or its UV was created, which can make it difficult to merge and insert textures in an atlas. Unity or Easy Mesh Combiner configurations, etc.

Optimize Mesh - In Import Settings of yours models. Make sure your models does not have the Optimize Mesh option disabled. In some cases, depending on how the models was created, disabling this option may completely deform the atlas texture when the Easy Mesh Combiner will map it. Normal maps - In Import Settings of your normal map textures. Make sure your normal map textures is marked as Normal Map. Easy Mesh Combiner has normal map texture optimization algorithms and if your normal map textures are not checked, this can confuse the Easy Mesh Combiner.
Problems Solution: After combining my meshes, and Generating the Scene Lightmap, everything looks weird! See an example of the problem... If after combining your meshes and generating the scene's Lightmap, you encountered a similar situation, then this topic is for you. The above problem occurs due to the Lightmap Data being present (or missing) in the mesh resulting from the merge. The above problem can happen in one of the situations below...

Lightmaps support not enabled - If you haven't enabled the "Lightmaps Support" parameter before merging your meshes, try enabling the option first.

Error "SetPerIndexUVs failed..." - This error can occur in certain merges that have the "Lightmap Support" option enabled, and is sent to the Unity console. However, the merge still continues even though this error has occurred, and the resulting mesh from the merge has no Lightmap data. For more information on this error, read this thread.

Problems with original meshes - If the original meshes that make up the resulting mesh have problems in their Lightmap UV data, the resulting mesh may be affected. This mainly happens when the original meshes have UV Overlapping, or don't have Lightmap UVs. This can be noticed by looking at the Mesh Renderer of the mesh that had the problem generating the scene's Lightmap. One way to fix this problem is to go to the Import settings of the meshes that make up the merge, and activate UV Lightmap generation for them.

Wrong Lightmaps support mode - This issue can also happen if you selected the wrong Lightmap support mode before merging. Usually the "Generate Data" mode is the most compatible, and the mode can be selected under "Lightmap Mode".
Demo Scene The Easy Mesh Combiner has some demonstration scenes, in which you can see up close, examples that show how the Easy Mesh Combiner works, for example, use in Runtime or Editor, use of the other components and etc. The demo scenes start with the prefix "DemoScene". Contact and Support
mtassets@windsoft.xyz

Congratulations, you have reached the end of the documentation! Thanks for reading!

If you need to contact me for any difficulty, feature suggestion, bug fix, question or support, just contact me through my email above!