Morph Tools For Unreal Engine 4#

Bake Morph Targets. Combine Morph Targets. Copy Morph Targets. All without leaving the editor.

Buy on the Marketplace

Want the TLDR? Go straight to the feature list

Why#

Morph tools is a product born out of the needs from my ongoing game project. I was designing a character creation system primarily based around morph targets. My mesh size began to rapidly increase as I added more and more customization options. Eventually I had around 2000 morph targets and my mesh size on disc was around 1GB. Anytime I needed to make an edit to a single morph, it took at least 30 minutes to reimport the mesh it back into the editor; my workflow was stifled.

I realized I needed a system to make it feasible to actually use a mesh with this many morph targets in a real game.

The first, and most important feature I implemented was morph target "baking".

Morph Baking: permanently apply the deformation of the morph target the the mesh data (and optionally remove the morph target entirely).

Baking morphs is essential to performance in my project. For example, my character meshes have a lot of "set and forget" morph targets, like nose size, body size, or other things that don't change over time. There is no need to recalculate the vertex positions every frame if I only never need to set them once. At runtime I had hundreds of morph targets eating up RAM and being needlessly calculated even though I didn't need them to be.

With my baking system I can set the morphs once during a controlled scenario (in my case, character generation) and then immediately bake and delete them from the mesh once character creation is over. In my extreme example this saved about 500mb of runtime memory.

Once baked, the skeletal mesh can then be saved to disc and loaded from a save game later without ever having to set the targets again. In the example project, I show you how to do this.

Baking works both at runtime (in a packaged game) and in the editor via a custom asset editor.

Next, I needed a faster way to iterate on morph targets. It took almost 30 minutes each time I needed to reimport my mesh after tweaking a morph, so I implemented morph target copying.

Morph Copying: Copy morphs from one mesh to another based on vertex proximity.

Using the morph copy tool, I can import my mesh with a single morph target, then use the Morph Tools editor to copy the morph over to my "master" mesh. This process cuts morph target iteration time down significantly.

Feature List#

Everything is written entirely in c++, no blueprints. However, all relevant functions have been exposed to blueprint as a blueprint function library.

Editor#

  1. Bake and remove morph targets from skeletal meshes
  2. Create morph presets
  3. Custom Morph Tools Asset editor
    • COPY MORPHS from one mesh to another
      • Based on vertex proximity: Vertex ordering is irrelevant
      • Works great for clothing with similar topology to the base mesh
    • COMBINE morphs
      • Combine multiple morph targets into a single morph target. Save RAM at runtime.
    • Random mesh generation based on the morphs of the mesh.
      • Easily create hundreds of different NPC meshes with customizable random mesh generation.

see: Editor Documentation

Runtime#

  1. Bake and remove morph targets from skeletal meshes
  2. Save and load the baked mesh to your save game
  3. Set morphs based on a morph preset
    • presets can be constructed at runtime or in the Morph Tools Editor

see: Runtime Documentation

Thanks#

Me

CoquiGames On the forums for helping me test.

Support#

Support Forum Thread

Discord Server