Published using Google Docs
MeshBake Manual v1
Updated automatically every 5 minutes

MeshBake Manual v1.4

1.   Overview

MeshBake is a UE4 Editor plugin that allows in-editor baking and merging of SkeletalMesh and StaticMesh materials and sections. Since MeshBake runs in the editor, the cumbersome process of importing and exporting as well as any lossy data conversions between UE4 and Third-Party materials can be avoided.

NOTE: For this plugin, baking materials and merging mesh sections can be thought of as equivalent. The relationship between materials and mesh sections should be one-to-one, any duplicate input materials are treated as separate unique input materials. Mesh sections with an empty material are assigned a default material.

Where to Buy?

Purchase on the Unreal Marketplace 

Need support?

Email: support@4hinteractive.com

How to use MeshBake:

MeshBake tries to give the user as much control as possible over the baking process. A user can choose to fully bake all materials to one output material, or only bake a few materials and copy the rest.

One way to use the tool is to first attempt to bake/merge as many materials as possible and then exclude any materials/sections that don’t bake acceptably. For example, with this technique a mesh that uses 18 materials can be baked down into 1 baked plus 7 copied materials and produce acceptable results. Meshes that only use opaque default-lit materials can often be baked down into one single output material without noticeable loss in quality.

Handling of non-baked materials:

By default MeshBake will attempt to bake/merge every material it can into one output baked material. If a material is not able to be baked/merged, then that material will be duplicated and copied to the baked mesh.

Copying a source mesh material to the output mesh without baking it requires reusing the source mesh UVs. For this reason, the source mesh UVs are copied to the output mesh. Since the UV index of the source mesh UVs in the output mesh will no longer be 0, all the texture coordinate nodes in the duplicated material are updated to the new uv index. The UV index of the source mesh uvs in the output mesh will either be 1 or 2, depending on the number of baked output materials.

                  

2.   MeshBake Setup Menu

 Create Physics Volumes – This option will copy existing skeletal mesh physics assets if they exist and create them if they do not exist. For static meshes it will create complex type collision geometry.

Allow Distance Field – This option enables generation of distance field data for the mesh. Disable if not used to save a small amount of memory per mesh.

Transfer Vertex Color Data – This option will copy vertex color data from the input mesh/component to the baked mesh. This does NOT bake the vertex colors into the baked material textures, it only copies the mesh vertex color data.  (“Bake Vertex Color Data” option is the one that bakes the data)


Auto-Merge Sections – This option enables auto-merging of mesh sections. It uses the Shading Model Auto Merge Settings to determine which shading model types can be merged together.

NOTE: When this option is off, any input mesh sections that are not specified in the Merged Section Source Map, Exclude from Baking array, or Remove Sections array will be copied to the output mesh without being baked or merged.

Merged Section Source Map – This field allows you to define the input to output section mapping for either 1 or 2 baked output sections. The maximum of 2 baked output sections is due to the limit of only 4 UV map slots for a SkeletalMesh. (One UV map slot is needed for the original UV map to allow mesh sections to be copied without being baked, and one UV map slot is needed for the StaticMesh lightmap, so that leaves only 2 UV map slots available for baking).

Exclude from Baking – Any mesh section added to this array will be excluded from baking. This option is just a quick way to tell the tool to bake and merge every section except the ones added here.  When combined with Auto-Merging, this option can be thought of as the inverse of the Merged Section Source Map.

 Example:

 

Two different ways to specify, “bake sections 0,2,3 and don’t bake 1”

 

Remove Sections – Any sections added to this array will be removed from the baked mesh. This option takes precedence over Merged Section Source Map and Exclude from Baking.

 

Force Merge All Material Types – This option ignores all Shading Model Auto-Merge Settings and will attempt to bake all material sections down to 1 baked/merged material section if possible.

 

Shading Model Auto-Merge Settings – These settings determine which shading model types the  Auto-Merge logic will attempt to merge and bake together into a “default lit” output.

                    Auto Merge – This type will be baked/merged whenever possible.

                    Manual Merge Only – This type will only be baked/merged if it exists as an input in the manually defined Merged Section Source Map.

                    Never Merge – This type will never be baked/merged with other material sections, even if it is manually specified in the Merged Section Source Map.  

 

Recreate Sections for Attached Clothing – This will copy any existing SkeletalMesh clothing to the output baked mesh. If in Auto-Merge Sections mode, clothing sections will not be baked to allow clothing to work properly on the baked mesh. If not in Auto-Merge Sections mode, clothing will be copied, but will only be attached to a mesh section if the section wasn’t baked/merged or removed.

 Regenerate Light Map UV – Create a lightmap UV for the mesh.

 Use Mesh Light Map Resolution – Compute lightmap resolution from input mesh lightmap resolution. If lightmap resolution is 0, it defaults to 64.

Target Light Map Resolution – Manually specify lightmap resolution.


Remove Masked Out Polygons from Geometry – This option will find polygons that are fully masked out by the input mesh material opacity mask and remove those polygons from the mesh geometry. This is intended to clean up leftover opacity masked geometry that would normally prevent baking to a default-lit material. This option currently does not remesh the geometry, so this option will not work when parts of the opacity masked area are smaller than the size of individual polygons.

 Example:

 

 

Bake Vertex Color Data – Bake vertex color data into the baked mesh material. Does not transfer vertex color mesh data, see Transfer Vertex Color Data for that.

 

Allow Two Sided Material – Allow two sided baked material to be created. Will only make the material two-sided if the source materials are also two-sided.

 

Blend Mode – Output baked material blend mode.

 

Default Texture Size – Default map texture size if not manually overridden.

3.   Menu Screenshot


Output & Mesh Settings

Material Settings

4. Changelist

Version 1.3

        Fixes:

New Features:

Version 1.2

        Fixes:

New Features:

Version 1.1

        Fixes:

New Features: