MHX2

For the last five years it has been possible to use MHX (MakeHuman eXchange) to transfer a rigged MakeHuman character into Blender. However, the MHX format had a number of issues. To remedy these, it will be replaced by a new MHX2 format.

For a variety of reasons, MHX2 is not bundled with MakeHuman, but is available as a separate third-party plugin. The currently stable version of the MHX2 exporter and importer, v 0.26, can be downloaded from here. For other versions see this page. The purpose of this blog is to host the MHX2 documentation. The starting page for the documentation is https://thomasmakehuman.wordpress.com/mhx2-documentation/, which is also linked to by the MHX2 importer.

MHX2 is in not compatible with MHX, because they are based on completely different design philosophies. An MHX file was essentially a python script, with non-standard syntax, that built a rigged character in Blender. In contrast, an MHX2 file contains full information about the exported MakeHuman meshes, which enables the MHX2 importer to build the character, using knowledge about the MakeHuman mesh. Thus in MHX the rigging was done in MakeHuman, whereas it is done in Blender in MHX2.

This has a number of advantages. The code is simpler to understand, because it is a standard python script rather than a program that writes a script. Also, the MHX2 format by itself is not Blender specific. It is possible to write MHX2 importers for other 3D applications as well, because the MHX2 file contains no Blender-specific information.

Here are some to the features available with the Blender MHX2 importer:

  • Particle hair
  • Genitalia seamlessly integrated with body mesh
  • Facial shapes, driven by rig properties or by intuitively shaped bones
  • Mask modifiers, for hiding skin under clothes in a non-destructive way
  • Visibility drivers, for hiding clothes compatible with file linking.
  • Lipsync
  • A choice of armatures, including:
    • The advanced MHX rig
    • Rigify
    • The rig exported from MakeHuman
    • A variety of rigs for specific target application.

The MHX2 pipeline is now more or less feature complete. The quality of the assets is not perfect, and additional assets should be added, but I don’t expect that the code will change very much in the future.

Detta inlägg publicerades i Okategoriserade. Bokmärk permalänken.

14 kommentarer till MHX2

  1. Robert Townsend skriver:

    Getting a hang when exporting the default human with the basic rig. With no rig, it works fine.

    System: Ubuntu 12.04, 64-bit.


    showing task Export
    Write MHX2 file /home/joecamel/makehuman/v1/exports/DefaultWithBasicRig.mhx2
    Exception during event onFileSelected
    Traceback (most recent call last):
    File ”./core/events3d.py”, line 212, in callEvent
    method(event)
    File ”./apps/gui/guiexport.py”, line 103, in onFileSelected
    exporter.export(gui3d.app.selectedHuman, filename)
    File ”plugins/9_export_mhx2/__init__.py”, line 62, in export
    mh2mhx2.exportMhx2(filename(”mhx2”), cfg)
    File ”plugins/9_export_mhx2/mh2mhx2.py”, line 78, in exportMhx2
    addGeometry(mhGeos, mesh, skel, rawWeights, mats, mname, cfg)
    File ”plugins/9_export_mhx2/mh2mhx2.py”, line 231, in addGeometry
    weights = mesh.getWeights(rawWeights)
    File ”./core/module3d.py”, line 746, in getWeights
    for mv in mvs:
    TypeError: ‘numpy.int32’ object is not iterable

    Gilla

  2. Robert Townsend skriver:

    Never mind. Was using 1.0.1, not 1.0.2. Appears to work fine with 1.0.2.

    Gilla

  3. Oliver skriver:

    What version of MakeHuman is this supposed to be used with? Nightlies? Or should it work with the latest stable release (1.0.2) as well? I have been playing around with BitBucket-snapshots in combination with MH nightlies and got very mixed results (some of them really great, though! 😉 ). What’s the ”official” recommendation here?
    Keep up the good work!

    Gilla

    • thomasmakehuman skriver:

      MHX2 stable works with MH 1.0.2.
      MHX2 unstable works with MH 1.0.2 and MH unstable. Today. Future changes in MH may still break the code, of course, but I think that almost all dependence on MH modules has been removed now.

      Gilla

  4. Windows7 MH r1461 from makehuman.log

    [2014-10-11 13:18:20,595] mhmain.py->loadPlugin():470 — MESSAGE — Importing plugin 9_export_md5
    [2014-10-11 13:18:20,631] mhmain.py->loadPlugin():485 — MESSAGE — Imported plugin 9_export_md5
    [2014-10-11 13:18:20,632] mhmain.py->loadPlugin():486 — MESSAGE — Loading plugin 9_export_md5
    [2014-10-11 13:18:20,634] mhmain.py->loadPlugin():488 — MESSAGE — Loaded plugin 9_export_md5
    [2014-10-11 13:18:20,637] mhmain.py->loadPlugin():470 — MESSAGE — Importing plugin 9_export_mhx2
    [2014-10-11 13:18:20,653] mhmain.py->loadPlugin():496 — WARNING — Could not load 9_export_mhx2
    Traceback (most recent call last):
    File ”./core\mhmain.py”, line 476, in loadPlugin
    module = imp.load_module(name, fp, pathname, description)
    File ”plugins/9_export_mhx2\__init__.py”, line 21, in
    from exportutils.config import Config
    ImportError: No module named exportutils.config
    [2014-10-11 13:18:20,665] mhmain.py->loadPlugin():470 — MESSAGE — Importing plugin 9_export_obj
    [2014-10-11 13:18:20,671] mhmain.py->loadPlugin():485 — MESSAGE — Imported plugin 9_export_obj
    [2014-10-11 13:18:20,674] mhmain.py->loadPlugin():486 — MESSAGE — Loading plugin 9_export_obj

    Gilla

  5. DredNicolson skriver:

    A note for particle hair animation: The regular collision physics in Blender don’t work with particle strands, true, but there’s a workaround by using a force field.
    A quick example: https://dl.dropboxusercontent.com/u/11611441/scrn001.jpg
    A standard Force field, shaped to the mesh Surface, with high strength and short falloff distance can create ‘virtual’ collision that works with particle hair. This kind of force field projects from the mesh’s vertices, so the deflector mesh needs enough vertices for it to work properly. You can boost the vertex count with a simple Subdivision modifer, like I did to give the cube enough verts to start deflecting the strands.

    Gilla

    • thomasmakehuman skriver:

      Hi Dred. A force field has now been implemented. Or actually two, one for the head and one for the torso. I tried to use a single deflector shaped as a bust, but the force field seems to ignore the armature modifier, so I used two meshes parented to the head and chest bones instead. But this is a workaround, of course, Is there a better solution that works with animation?

      Gilla

  6. Jeff Palmer skriver:

    Hi, Am porting Make Human meshes & some of the shape keys to a webGL based, 3D framework, BabylonJS. I did some analysis on the keys and found that MOUTH_OPEN has a very large of vertices which are different from Basis. The change for many must be very small. This would affect performance in a realtime environment. Thought I would share a little report:

    shape key ”BROW_MID_DOWN_LEFT”: n verts different from basis: 406
    shape key ”BROW_MID_DOWN_RIGHT”: n verts different from basis: 405
    shape key ”BROW_MID_UP_LEFT”: n verts different from basis: 406
    shape key ”BROW_MID_UP_RIGHT”: n verts different from basis: 405
    shape key ”BROW_OUTER_DOWN_LEFT”: n verts different from basis: 638
    shape key ”BROW_OUTER_DOWN_RIGHT”: n verts different from basis: 637
    shape key ”BROW_OUTER_UP_LEFT”: n verts different from basis: 638
    shape key ”BROW_OUTER_UP_RIGHT”: n verts different from basis: 637
    shape key ”BROW_SQUEEZE”: n verts different from basis: 624
    shape key ”CHEEK_BALLOON_LEFT”: n verts different from basis: 685
    shape key ”CHEEK_BALLOON_RIGHT”: n verts different from basis: 683
    shape key ”CHEEK_NARROW_LEFT”: n verts different from basis: 685
    shape key ”CHEEK_NARROW_RIGHT”: n verts different from basis: 683
    shape key ”CHEEK_SQUINT_LEFT”: n verts different from basis: 566
    shape key ”CHEEK_SQUINT_RIGHT”: n verts different from basis: 565
    shape key ”CHEEK_UP_LEFT”: n verts different from basis: 365
    shape key ”CHEEK_UP_RIGHT”: n verts different from basis: 364
    shape key ”LIPS_LOWER_IN”: n verts different from basis: 420
    shape key ”LIPS_LOWER_OUT”: n verts different from basis: 175
    shape key ”LIPS_MID_LOWER_DOWN_LEFT”: n verts different from basis: 106
    shape key ”LIPS_MID_LOWER_DOWN_RIGHT”: n verts different from basis: 106
    shape key ”LIPS_MID_LOWER_UP_LEFT”: n verts different from basis: 101
    shape key ”LIPS_MID_LOWER_UP_RIGHT”: n verts different from basis: 101
    shape key ”LIPS_MID_UPPER_DOWN_LEFT”: n verts different from basis: 145
    shape key ”LIPS_MID_UPPER_DOWN_RIGHT”: n verts different from basis: 145
    shape key ”LIPS_MID_UPPER_UP_LEFT”: n verts different from basis: 204
    shape key ”LIPS_MID_UPPER_UP_RIGHT”: n verts different from basis: 204
    shape key ”LIPS_PART”: n verts different from basis: 429
    shape key ”LIPS_UPPER_IN”: n verts different from basis: 233
    shape key ”LIPS_UPPER_OUT”: n verts different from basis: 302
    shape key ”MOUTH_CORNER_DOWN_LEFT”: n verts different from basis: 411
    shape key ”MOUTH_CORNER_DOWN_RIGHT”: n verts different from basis: 409
    shape key ”MOUTH_CORNER_IN_LEFT”: n verts different from basis: 251
    shape key ”MOUTH_CORNER_IN_RIGHT”: n verts different from basis: 249
    shape key ”MOUTH_CORNER_UP_LEFT”: n verts different from basis: 430
    shape key ”MOUTH_CORNER_UP_RIGHT”: n verts different from basis: 428
    shape key ”MOUTH_DOWN_LEFT”: n verts different from basis: 446
    shape key ”MOUTH_DOWN_RIGHT”: n verts different from basis: 444
    shape key ”MOUTH_NARROW_LEFT”: n verts different from basis: 506
    shape key ”MOUTH_NARROW_RIGHT”: n verts different from basis: 504
    shape key ”MOUTH_OPEN”: n verts different from basis: 4143
    shape key ”MOUTH_UP_LEFT”: n verts different from basis: 446
    shape key ”MOUTH_UP_RIGHT”: n verts different from basis: 444
    shape key ”MOUTH_WIDE_LEFT”: n verts different from basis: 313
    shape key ”MOUTH_WIDE_RIGHT”: n verts different from basis: 311
    shape key ”NOSE_WRINKLE”: n verts different from basis: 690
    shape key ”TONGUE_BACK_UP”: n verts different from basis: 292
    shape key ”TONGUE_OUT”: n verts different from basis: 297
    shape key ”TONGUE_UP”: n verts different from basis: 170
    shape key ”TONGUE_WIDE”: n verts different from basis: 184

    Gilla

    • thomasmakehuman skriver:

      Hi Jeff,

      Well, I’m not the best artist in the world and have thought of improving the shapekeys, although I haven’t really thought the number of affected verts; in Blender it doesn’t matter, I think, since shapekeys are stored for the entire mesh. If you want to improve the shapekeys, you could edit the target files in import_runtime_mhx2/data/hm8/faceshapes/raw and send them to me. The shapekeys are modelled symmetrically and then split into left/right and up/down by a script.

      Gilla

      • Jeff Palmer skriver:

        Thanks for the pointers. Did play a little with that, but want to get fully operational before start optimizing. Can post a link of a ”voice-sync” web page with a MH (just started morphing today), when it gets better. A proof of concept version is at: https://googledrive.com/host/0B6-s6ZjHyEwUSDVBUGpHOXdtbHc (ignore censoring, now removed) . The idea is to do arpabet look ups, and the speaker tries to speak at the rate of the animation, not lip syncing where someone spends forever trying to match the animation to voice. Save the recording & arpabet+ for playback in game. BTW, the first I do is put the left-right back together in Javascript. Could a checkbox be added, so it does not get split in the first place, or tell me where it is split?

        Gilla

  7. Nitish Reddy skriver:

    When I import the mhx2 file in blender I am not able to see the vertex groups which are visible in mhx format. Are vertex groups supported in mhx2 ? Also is the size file in mhx2 lower than mhx ?

    Gilla

    • thomasmakehuman skriver:

      It depends on what you exported and on the import settings. With the default settings, the character only has a rig (and vertex groups) if a rig has been assigned in MH. If you Override Export Settings in the importer, and Add Rig not beginning with the word Exported, then the importer builds a rig and adds vertex groups.

      The file size is definitely smaller if you Binary file export option, because then the file is zipped and it shrinks to about 1/3. With ascii export I don’t think the size difference between mhx and mhx2 files is so significant.

      Gilla

  8. JOE skriver:

    hello guys, just a beginner of blender and makehuman here.
    my make human(version 1.1.0) doesnt have the option to export by MHX or MHX2 files
    but i don’t know what to do after downloading the stable version of the MHX2 exporter and importer v 0.26.
    where do i put the ”9_export_mhx2” folder and the ”import_runtime_mhx2”?
    thanks a lot

    Gilla

Lämna en kommentar