Creating a character for games in Godot using MakeHuman

An expanded and expanded edition of the MH into Godot tutorial (part 2)

In 3 volumes.

This is not really a tutorial, but more of a developer's diary type of thing.

It is intended for game developers and is supposed to be published on the Godot site. I will be grateful for comments, suggestions and other constructive criticism.

Volume 1. MakeHuman

  1. Creating a character in MakeHuman. Plugins, Assets.
  2. Selection of clothing. Additional settings.
  3. Importing into Blender.

Volume 2. Blender

  1. Exporting to Blender.
  2. Assigning Animations.
  3. Importing into Godot.

Volume 3. Conclusion

  1. Change of hair (eyebrows, eyelashes, teeth).
  2. Body Shapes (Shape Keys).

Volume 1

Creating a character in MakeHuman

Creating a character for the game with a change of clothes and several animations.

Introduction. MakeHuman Overview

FAQ:What is MakeHuman?

MakeHuman is a completely free, innovative and professional software for the modelling of 3-Dimensional humanoid characters.

Documentation:What is MakeHuman?

MakeHuman is an open source (AGPL3) tool designed to simplify the creation of virtual humans using a Graphical User Interface, also commonly referred to as a GUI.

Humans are created through the manipulation of controls that allow for the blending of different human attributes to create unique 3D human characters. The controls are intended to provide the user with a simple way to create characters that give expression to the widest possible range of human forms.

The MakeHuman project strives to provide a complete tool that allows for the management of all things needed to create realistic virtual humans.

Distinguished by a large number of settings and easily expandable features. There is a plugin for mass character creation "Mass produce". Has a lot of ready-made clothing and accessories. You can create new ones yourself. Easy to integrate with Blender.

Has options not found in other similar programs:

  • Allows you to change the age of a character. It is enough to create a model and you can change the age with one parameter. Very convenient if you are making a game about growing up.

  • Allows you to assign different rigs to characters. Large selection of ready-made skeletons or you can make your own.

Sliders do not have the ability to enter a numerical value, which is sometimes not very convenient.

The program is mainly aimed at artists who create static images or videos. It is still little adapted for use in games, but has a lot of opportunities in this regard.

I will try to show how you can make a character with a change of clothes and assign him animation.

Programs used:

  1. MakeHuman 1.2.0
  2. Blender 2.93.9
  3. Godot 3.4.4 (3.5 compatible)

Some remarks about working with newer versions of the software:

  • In Blender 3, the Retarget BVH plugin does not work yet.
  • Godot 4 does not import .blend files correctly. It is recommended to import via glTF.

Addons:

For Blender

For Godot

Step 0

Program Installation

Download the program, install it.

User data is located in the folder:

Windows:
C:\Users\[Name]\Documents\makehuman\v1py3\data\

Linux:
~/Documents/makehuman/v1py3/data

This is where you install additional assets: clothes, hair, poses ect.

You can install them directly from the program, tab "Community". Or manually from the site — User contributed assets.

They are very well represented in the gallery, but it's a bit difficult to get there.

The following assets were used in the tutorial:

Author

  • Asset

punkduck

Elvaerwyn

RehmanPolanski

callharvey3d

sonntag78

Hatshj

blindsaypatten

Joel Palmius

Animation used from the cgspeed

Step 1

Modeling

Run the program and customize the character. By default, it offers a middle-gendered and middle-aged character.

Since there are no numeric values to enter, you have to move the sliders, like this:

General body settings, head, torso, arms, legs...

Apply the modifiers
Custom

  • Orkifyhead
  • Elf ears
  • Fully close mouth

Geometry

The following sequence is not important, we need to equip our character with everything necessary for life and combat: hair, teeth, tongue, eyebrows, eyelashes… if it is supposed that the character will not open his mouth, you can skip the teeth and tongue setup.

Hair

  • Scalp Viking

Fangs

  • Fangs (from the Clothes[Accessory] tab)

Making the body parts modifiable is possible, but difficult. At the end I'll tell you how.

Materials

Assigning textures.

Body

  • Orkifyheadtarget custom skin

Eyes

  • Alien Eyes

Step 2

Dress up your character.

Geometry
Choose clothing

If a change of clothes is expected, then we put all the necessary clothes on the character. In this case there are 2 sets: casual and sports.

Casual

  1. Short jeans
  2. Sleeveless Shirt
  3. Martial-Arts Shoes
  4. Ladies Sunglass

Sporty

  1. port briefs 01
  2. sport bra 01
  3. sun visor (sports visor)
  4. tennis shoes

The option "Hide face under clothing"
If you don't intend to change clothes, it's better to leave this option. If this option is disabled, then it will be visible when the body goes beyond the clothes. When exporting, this function will be enabled in any case.

Step 3

Pose/Animate
Assign a rig

The rig should match the animation. For this example I use the CMU Motion Capture animation and assign the corresponding rig CMU mb.

The character is ready for export.

Step 4

Export to Blender

You can put the character from MH into Blender in several ways.

  1. The most reliable one is exporting to .mhx2 (MHX2 - MakeHuman eXchange format 2). This is the only way to correctly transfer the textures to the game engine.
  2. If you use export to Blender via Socket (tab in MH "Community"), you will have to assign textures in the engine manually.

It is desirable not to forget to switch "Scale units" to a meter.

To be continued…

Funds

I'd like to try to raise finances to work on gamedev. I suppose, in addition to the engine site, also to put up on Patreon. Of course in completely free, but with an offer of donations. Considered an option with itch.io, but I could not find there section for tutorials. Are there any thoughts and suggestions on this topic, where else you can publish a tutorial?

_
Translated with http://www.DeepL.com/Translator (free version)

8 days later

Volume 2

Importing into Blender and assigning animations. Importing into Godot

Need two addons for Blender:

Step 1

Import

The import panel can be called in 2 ways:

  1. File –> Import –> MakeHuman (.mhx2)
  2. N-панель –> Import MHX2

result is identical:

If you need facial animation, you can:

  1. to enable the "Face Shapes" option for emotions via shape keys;
  2. if you choose a rig with face bones, then the emotions can be realised by poses.

In Rigging turn on Add Rig and choose Rig Type [Exported].

The rig assigned to the MH will be imported.

[Import MHX2]

Remove all the masks:

If the clothes will be the only one, it's better to leave masks.

Step 2

Assignment of animation

*A little note. For the game, the animation must be played without moving the character. Moving the character is done in the game engine by moving the object itself. As the animation in the example contains movement, you need to get rid of it (or take the animation already prepared). You can choose any convenient way for the character to stay in place. In my opinion, the easiest is to tie the Hips(root) bone to the position at rest. The way is not the best, but simple and fast. To do this, I make a copy of the skeleton at rest position. This is only necessary for binding.

To assign the animation use Retarget BVH plugin finalized by punkduck [MakeHuman Team] (for which he is very thankful).

[Load And Retarget] allows you to load animation and immediately apply to the character.

Select animation (02_01.bvh) and load it.

*Now bind the Hips animation bone to the rest pose bone for the character to walk in place.

Add the running animation (02_03.bvh).

Now the file is ready to be exported to Godot.

The documentation for the engine recommends that you triangulate the models.

But Blender does not allow you to triangulate an object that contains shape keys:
Modifier cannot be applied to a mesh with shape keys

Step 3

Godot. Import

The Blender Importer Addon for Godot allows you to open Blender files as Godot scenes.

This feature is built into Godot 4, but it doesn't work correctly there.

Just save the .blend file in your project folder and it will be automatically imported into the engine.

In an open scene, you can remove the resting pose skeleton you don't need anymore and separate clothes by scene for easy switching:

Video

Face morphs will be transferred, but you must remember to set the same Shapes settings for different body parts.

The main part of the tutorial is finished.

_
Translated with http://www.DeepL.com/Translator (free version)

Some suggestions that arose during the creation of the tutorial

  1. Make an option in .mhx2 to save body parts and clothes separately, so they would be automatically put into Blender collections (for example, body parts into "body parts" collection, and clothes into "clothes" collection, maybe even by categories: "sports", "casual"…).
  2. Support importing collections from Blender, so that Blender collections open as nodes in Godot.
23 days later

Final part of the tutorial.

Volume 3

Creating a character for games in Godot using MakeHuman

  1. Change of hair (eyebrows, eyelashes, teeth).
  2. Body Shapes (Shape Keys).

It is assumed that there are already:

  1. the original MakeHuman model, which needs to be modified;
  2. a Blender file derived from this model.

Part 1

Change of hair (eyebrows, eyelashes, teeth)

Step 1

Changing body parts is somewhat different from choosing clothes. Since you can't have a character with several hairstyles (unlike clothes), you have to work with each hairstyle individually.

Load the model for which you want to change the hairstyle. Choose the hairstyle you want:

bob02 (In the standard installation)
author
Joel Palmius
Jonas Hauquier

If you want, you can add eyebrows, eyelashes, teeth to transfer. It is better to remove unnecessary things.

The model is exported in .mhx2 format ("Scale units" in meters).

Step 2

Blender

Opens the previously saved file with the original model.

  1. The file with the new hairstyle is imported into it.

  2. The hairstyle is transferred to the collection to the original model and linked (with a Shift).

  3. The armature from the original model is assigned.

  4. The entire new collection should be deleted.

  5. The file is saved to the Godot project folder.

Step 3

Godot

The Blender file imported into Godot can be saved as a new scene. If the previous file was already saved as a scene, the hair can be transferred to it as a node.

Part 2

Body Shapes (Shape Keys)

Assignment of shape keys

Step 1

MakeHuman

Load the model into which you want to add the shape key. The model should have clothes, to which a key will be applied to the form. Apply the modifier:

The operation must be repeated for each key.

The model is exported in .mhx2 format (units in meters).

Step 2

Blender

Opens the previously saved file with the original model.

Triangulation

The engine documentation recommends triangulating the models.

But Blender does not allow you to triangulate an object that contains shape keys.

Modifier cannot be applied to a mesh with shape keys

If the model does not contain shape keys, then that model can be triangulated before they are assigned.

Choice of modifiers for shape keys

You may only assign modifiers that do not change the size of the model skeleton! If the modifier changes the dimensionality of the skeleton (e.g. arm/leg length, shoulder width etc.), the result of the animation will be unpredictable.

  1. The modified model is imported into the file with the original model.

  2. The part (body) of the modified model is selected first.

  3. Then the same part of the original model is selected (with CTRL).

  4. Assign a shape key (Object Data Properties –> Shape Keys –> Join as shapes)

  5. The procedure is repeated with the clothing elements.

  6. The entire new collection should be deleted.

  7. The file is saved in the Godot project folder.

Step 3

Godot

The Blender file imported into Godot is saved as a new scene.

There is a bug: if "Bland Shape" is set to 1, artifacts appear:

It is desirable to set the value to less than 1.0:

A huge grateful thanks to those who have helped and supported me:

_
Translated with http://www.DeepL.com/Translator (free version)

check the possibility of posting a video from Mastodon.

5 days later

Some remarks about working with newer versions of the software:

  • In Blender 3, the Retarget BVH plugin does not work yet.
  • Godot 4 does not import .blend files correctly. It is recommended to import via glTF.
15 days later

Volume 4

Adding animation

It is assumed that there are already:

  1. Blender file with animation;
  2. a scene in Godot derived from this file.

Step 1

Blender

Opens a previously saved file with the original model and animations.

  1. A new animation is imported.
  2. The file is saved in the Godot project folder.

Note. In this example, the jump animation is applied in place. In general, it is desirable to move the model in the game engine, as a node, then it will be possible to change the height of the jump. But in this case, I will show a fixed jump. To do this, leave the constraint of the bone fixed on the X-axis only. This change will affect the existing animations, but they are already in the scene file in Godot.

Step 2

Godot

  1. From the new file imported into Godot, only a new animation is needed:

  2. It can be copied or saved for future use:

  3. Open AnimationPlayer in an existing scene and load the new animation file there by copying or exporting:

That's it, the animation is added to the scene file.

_
Translated with http://www.DeepL.com/Translator (free version)

a month later
a month later
4 months later

Since MakeHuman can be used to create characters for games, I guess this news can be relevant here.

Recruiting for Makehumans Future!

The makehuman standalone program is aging and in need of a serious overhaul to keep her current and viable going forward.

And if someone who knows Blender and Python can help with this issue, that would be great!

MakeHuman could be the basis for creating a character generator for Godot.

    Tomcat I wonder if this wouldn't make more sense for them. Rather than maintaining all the technical debt from their own totally custom solution it might be better to stand on the shoulders of giants as the saying goes...

      I can't help in term of coding but how about having an option the create Anime style character (like vroid). I think it'd make the program more popular.

        Megalomaniak Gowydot It is noteworthy that these suggestions have already been proposed in that thread. And the same link was even shared. 😎

        Megalomaniak I wonder if this wouldn't make more sense for them.

        This is a highly autonomous program. I don't know what the developers will decide, but there's a lot of legacy stuff in there. I'm not sure how to just move everything over.

        My idea is to create a character generator for Godot, based on MakeHuman. Actually, this tutorial, was the first step towards that work. But… the situation around me (both personal and political) is not conducive to any thoughtful creative work.

        Gowydot I can't help in term of coding but how about having an option the create Anime style character (like vroid).

        MakeHuman allows those who wish to greatly modify the original models. Anime stylization already exists:

        a year later

        Some comments on the current state of affairs.

        Diffeomorphic Add-ons Version 4.1.0 [BVH and FBX Retargeter] for Blender 4.1 is out. To make it work you need to first “Load BVH or FBX Files” and then “Retarget Selected To Active”. Then the animation will be assigned.