MHX for Blender 2.49 FAQ

MHX for Blender 2.49 - Frequently asked questions


The location of the import script does not exist

By mistake, the mhx files where located in a subfolder of a utility directory, which was not included in the alpha 4 release. The files have now been moved to the importers/mhx/blender249 directory, which will be included in the next release. In themeantime, download the most recent files from svn trunk as described below.


My system does not behave as described in the documentation.

How do I download the most recent version of MakeHuman?

MakeHuman and its Blender export is very much work in progress; it is still in the alpha phase. Therefore you should make sure that you have the most recent versions of all files.

Linux users can download nightly builds for Joel Palmius' site http://mh.jwp.se/deb.php . The builds are compiled into .deb packages, making them fit for installation on any debian-based distribution.

Windows users either have to wait for the next release, or compile directly from svn. To checkout a copy of svn trunk, goto http://code.google.com/p/makehuman/source/checkout and follow the instructions there. Checking out the code is simplified by the use of a graphical svn client like TortoiseSVN, which can be downloaded for free from http://tortoisesvn.net/downloads .

Note that the downloaded copy needs to be compiled. Do the following steps to compile MakeHuman under Windows:
  1. Download and install Mingw from http://sourceforge.net/projects/mingw/
  2. Download and extract SDL from http://www.libsdl.org/download-1.2.php . You need the development libraries for Mingw32.
  3. Copy the content of the SDL include and lib folders to the corresponding Mingw folders, presumably located at C:\Mingw.
  4. Copy all dll files from the most recent MakeHuman release to the same place in your svn copy.
  5. Compile MakeHuman by double-clicking on compile_src.bat.
  6. Run makehuman.exe

I just want the updated MHX files, without having to compile MakeHuman

It is not really necessary to deal with compilation to only bring the Blender exporter up to date. There are only six files which affect Blender export, and I think that they can be replaced without affecting the rest of the system. You can download the most recent versions of the files from  http://code.google.com/p/makehuman/source/browse/#svn/trunk/makehuman and its subfolders:

mhx_import.py and pydrivers.py in importers/mhx/blender249

mhxbase.py, mhxipos.py in data/3dobjs

mh2mhx.py, mhxbones.py in mh_plugins.

Download the files and replace the corresponding files in your MakeHuman directory. The importers directory does not exist in alpha4, but this is ok because these files are used by the importer on the Blender side. Put mhx2mhx.py in your Blender scripts directory and load pydrivers.py into a text window in Blender, as described elsewhere.

When importing the MHX file, I get a warning about incompatible MHX versions

Make sure that you have the most recent versions of all files, as described above.

Which versions of Blender are supported by the MHX import script?

Blender 2.49b only.

In 2.49a and earlier versions of Blender there is a bug which makes it impossible to set driven bones from python. Mhx files can still be loaded, but you receive a warning at load time and dynamical FK/IK switch will not work.Since there is little reason not to upgrade to 2.49b, I suggest that you do so.

Blender 2.5x has a very different python API, and the current import script will not work at all. A version of mhx_import.py which does work for the new Blender is planned, but the builds presently available on graphicall.org are not stable and complete enough yet. The current method to load a MakeHuman character into Blender 2.50 is to import it into 2.49b, save the .blend file and open it in 2.50.

Nothing happens when I move the FK/IK switch bones in the panel

FK/IK switching only takes place after you click in an IPO or Action editor window. This is a known bug, due to a limitation in Blender's python API. See further http://sites.google.com/site/makehumandocs/blender-export-and-mhx/fk-ik .

Nothing happens to the face when I move the bones in the face panel

There are two possible causes:
  1. The Facial shapes button in the MHX interface was deactivated when the character was imported. Reimport the character with the button activated.
  2. The file pydrivers.py was not loaded into a text window in Blender. Load the file (it can be found at importers/mhx/blender249 folder in the directory where the MakeHuman program is located), and reimport the file.
To load the file into the text editor, choose the scripting context on the top of the Blender screen, and then open the file file in the editor. Note that pydriviers.py should not be executed; it only needs to exist in the text window before the character is loaded. This is simply the way Py-drivers work in Blender.


The face is stuck in an ugly shape and does not respond to the panel bones.

The character becomes generally unresponsive or Blender quits unexpectedly.

Under some circumstances, the import script seems to corrupt Blender's memory heap. Most often this happens if a character is imported several times, and both facial shapes and FK/IK switch are activated. This is likely a Blender bug; even a faulty python script should not corrupt the memory. If a Blender python guru reads this, please tell me if something in mhx_import.py does something that may corrupt memory, e.g. the calls to the Draw module at the end of the file.

To avoid this kind of problem, do this:
  1. Import the character into a pristine Blender session.
  2. Save the blend file.
  3. Quit and restart Blender.
  4. Load the blend file.
Note that it is not enough to Ctrl-X start a fresh scene if Blender's memory is corrupt.

The character does not render on Linux, but only results in a blank blue screen

This appears to be a Blender bug on Linux, at least in some distributions. Apparently Blender can not read tif files (at least not the MH textures) under Linux. MakeHuman, Gimp and Linux' image editor all understand these files, as does Blender under Windows.

Workaround:

  1. Convert the textures in makehuman/data/3dobjs/mhxbase.mhx from .tif to .png.
  2. Copy the PNG versions of the three textures (texture.png, texture-ref.png, texture-opacity,png) to the default MakeHuman export directory (~/makehuman/exports in the current version, makehuman/data/textures in alpha4). The mxh import script will look for PNG files first and TIF files later, and thus the PNG textures will be loaded.
Alternatively, you can load the textures in Blender after the character has been loaded.

How do I convert a texture to PNG?

The simplest way to do this in Ubuntu is
  1. Double-click on the tif file, e.g. texture.tif.
  2. The file is opened in a program which calls itself Eye of GNOME - the GNOME image viewer.
  3. File > Save as.
  4. Change the filename to texture.png and click OK.
Gimp of course gives you better control.

What is this bug, precisely?

Unfortunately the bug seems to be present in Blender 2.50 as well. In the material editor,  the skin shader material is invisible, and that the textures are black (except for the procedural bump). In the terminal window, the following text is printed:

DDS: not valid; header follows
Flags: 0x4FA02180
DDSD_DEPTH
Height: 18091248
Width: -507542777
Depth: 8913408
Mipmap count: 1144574239
Pixel Format:
Flags: 0xB31F4C84
DDPF_FOURCC
DDPF_PALETTEINDEXED1
DDPF_NORMAL
FourCC: '(t� '
Bit count: 558539266
Red mask: 0x2ACDE9D2
Green mask: 0x447F132D
Blue mask: 0x3D8A93A2
Alpha mask: 0x91502B26
Caps:
Caps 1: 0x68B369D5
Caps 2: 0x17B732FD
DDSCAPS2_VOLUME
Caps 3: 0xB0A556AC
Caps 4: 0x930AC5BA
Unknown fileformat


The import script still does not find the textures, but I know that they are there

There can be two reasons for this:

1. The alpha4 version looks for two textures (texture2.png and bump5.png) that are not part of the release. Download the current version of mhxbase.mhx as described above, and export from MakeHuman again.

2. Blender may have problems with very long pathnames. In Windows, the path to your exports directory can be quite long (e.g. "C:\Documents and Settings\Thomas\makehuman\exports"), especially if you have chosen a long user name. I don't know how long pathnames the import script can use, but try to move the folder with textures closer to the root, and use the Texture Directory (10) button to navigate there.

The eyebrows seem to be floating on top of the head in my renders

The eyes and eyebrows turn out black in my renders

Turn off ray-tracing the the render settings. For high-quality renders, keep sub-surface scattering (SSS), for fast renders turn it off to. Here is the result of some render settings.




What to do about slow renders?

You might find that rendering takes a lot of time, and that you want to reduce it, especially for test renders. The simplest and most effective way to reduce render time is to turn off sub-surface scattering (SSS) in the Render context. Other tricks include reducing the size of the rendered image, turning off ray-tracing, and turning off OSA.