Jump to content

MakeHuman → Blender → Babylon


Recommended Posts

Hello !

First time with Babylon :) . I'm trying to get an animated character made with MakeHuman. But for now my character does not appear in full. I think that the parts with textures do not appear.

My current workflow:

  1. MakeHuman:
    • rig = game.json
    • export .mhx
  2. Blender:
    • .babylon export (for now no added BHV, but later...). No warnings (except the camera).
  3. JS:
    • I'm using the importMesh function. In the network, we can see that the textures of the clothes and hair are loaded.

I get the following result:


Here is my .blend file.

So two questions:
1) How to fix my mesh?
2) How to have several BHV my character?


Thank you,


Link to comment
Share on other sites

I was planning to revisit make human, but have not had the chance.  FYI, I wouldn't spend a second working on mhx, so I will not help you, per se.


I am interested in mhx2, which is a total rewrite.  https://thomasmakehuman.wordpress.com/mhx2-documentation/import-into-blender/


Also, my interests are in shape keys keys, not bvh.  One thing that might be good to post is the whole .log file

Link to comment
Share on other sites

Hi Jeff,


I'm not a big fan of the .bvh format, however, how does .bvh coorespond to shape keys?  I'm not certain what relatonship one has to the other - with the exception of animating bones for facial expressions and speech.



Link to comment
Share on other sites

Well Annoa, I took a look at your file - and fixed the issues. See here:




Unfortunately your file did not have all the textures packed in it - so I had to use some textures that I had. The ones I used are just for the diffuse colours - as I did not have normal map textures that went with your model,  I deleted them from your model.


I will explain the fixes in a post later this weekend.


cheers, gryff :)

Link to comment
Share on other sites

Well, I am glad to see gryff found the time to look into this.  His bedside manner & Blender user skills go well beyond me.


DB,  not to clog up someone else's topic too much, here is a quick response.


Shape keys have more in common with armatures / rigs, rather than a motion caption file, .bvh.  A Blender shape key is a snapshot of an entire mesh with all the vertices posed exactly where you want them.  They are morph end points / targets.  In Blender there is a special shape key called 'Basis', which is the mesh 'at rest'.  


A Morph.ShapeKeyGroup class in the Morph extension is like a Blender shape key, but can be isolated to only part of mesh, like: Mouth & tongue, eyes, left leg, right leg, left arm, right arm, left hand, & right hand.  This is done for performance reasons and allows for independent deformations.


The TOB exporter decides which Blender shape keys belong to which Morph.ShapeKeyGroups based on its name. 'mouth-open', 'mouth-wide', 'mouth-upper', & 'mouth-smile' would all become part of the Mouth ShapeKeyGroup.  From this base set of 4 keys (+ basis), any of the possible visemes can be derived, since keys within the group are combinable, and also savable.  The token of the ARPABET+ string ends of as a series of Morph.Deformation objects on the group's deformation queue.


A .bvh is equivalent to a series of Morph.Deformation objects.  Each Morph.Deformation defines the recipe to build (reuse) a new morph target, along with how long to take to get there from wherever it currently is.  


You can also specify the amount of change in position & rotation (from the meshes point of view) to also take place during the deformation.  Hence, it might be possible to actually walk.  The best you can do with a single Babylon.Animation is walk in place.  

Link to comment
Share on other sites

Hi again Annoa . An update for you with some how to info :)


First a zip file with the .blend file, the .babylon file,  the HTML file I used including all the javascript code and all the textures I used.


The textures are actually packed into the blend file and are only there as a backup.




The jeans, eye and shoe texture come from MakeHuman(MH). The shirt is a texture I made using the downloadable HTML5 logo. The skin texture I created, and it is free to use by anyone( please give credit if you find it useful or use it). I added the skin texture to the model to add shading to the skin.


Now the fixes for your files and textures:


1. Go to the material for each clothing item/hair/eyes, find the box marked "Transparency" and uncheck it, or leave it checked and set the "Alpha" value to 1. (First Image below).


2. Go to the texture for each material above and look for the section marked "Influence" and uncheck the box marked "Alpha". For some materials this is not necessary, but I find it otherwise produces an odd effect with some textures. (Second Image below).


3. The skin has more than one material (Third Image below) . The ones in the red box can be deleted. They seem to do nothing except increase the babylon file size.


4. If you look closely at the final display in babylon/WebGl  and in Blender, you might see the jeans mesh poking through the T-shirt (Image 4 below). You might want to tweak that mesh in Blender.



A few other thoughts :


1. When you export from MH set the scale to decimeters. The model in your blend file is ~20 babylon units tall


2. You might want to try using the low poly versions of the figures that are available in MH.


3. The default value for the meshes has backFaceCulling set to true. If you look closely at the T-shirt (up sleeves/down neck) you will see the blue background colour - un-Remming lines 112 and 113 will fix this.


4. The .blend file I have posted should be useable directly for testing the MakeWalk .bvh importer from MH.


That's enough for now.


cheers, gryff :)










Link to comment
Share on other sites

I didn't mean to use anyone's space on a topic post, but wanted to understand what the queston(s) were - as I misunderstood what Jeff wrote when he mentioed blend shape keys - and thought he was suggesting that BVH supported blend shapes.  So Jeff, I appriciate the explanations, but they were not necessary, as I should have explained why I was asking the question concerning BVH and blend shapes further. The reason I was inquiring was in building the current (and past) mocap systems and software as I did in my previous life - and building the motion capture departments and systems for Weta in NZ, I worked directly with Giant and Biovision, and wrote some of the functionality of the Biovision system and the BVH file format - which was the Acclaim sytem and then was licensed by Giant exclusively in the entertainment sector.  So I'm more than familiar with the BVH format, and thought I could possibly help answer the question.


However, once blend shapes were brought into this, I was confused, as BVH has no native support for geometry - which of course would offer no support for blend shapes.  Also, in working as VP at Image Metrics which is now Faceware, was involved with the design and coding of the facial animation software using blend shapes - as well as writing the first plugin for Softimage setting up blend shape animation keys to animate faces for Disney characters way back in the 90s.


So I thought I might be able to add to the discussion.  However it doesn't appear that my experience is needed at this time, but if anyone needs any assistance with either mocap or facial animation not directly related to specific babaylon.js syntax, then I can certainly help - as I was fortunate to be in a position to write some of the file formats widely used today.  I'm directly tutoring 2 people on this forum privately, nd am happy to help anyone save themselves the pain and frustration of navigating the world of mocap and facial animation - which is still limited in available resources.


But again, thanks for the info, as it's always good for people to read the specifics of what is being discussed.  As I mentioned, I'm not a fan of the BVH file format, as it's REALLY outdated, and very limited with many pitfalls - such as no scaling reference, no consistant calibration for local and world axis orientation, no explicit bone orientation, variations in bone length for parental hierarchies, no support for up vector orientation - and a whole host of other limitations; as this format is more than 3 decades old and Biovision was built primarily for gait analysis. Practically every other mocap file format is vastly superior to BVH, but it still survives as a widely used file format as it was the first, and universities taught this and not any other formats for decades (and still do!)


So, I may be a little off topic, but I don't believe so, as many of the problems Annoa and others have with their animations are due to the use of the BVH format. Using most other mocap file formats inherently fix these antiquated problems which were solved years ago.  I personally would like to see the HTR format more widely supported, but there are probably too many university professors that still believe BVH is state of the art.  So on this forum, I look for topics on mocap and facial animation, and try to assist when I can - as these animations are not difficult to integrate and manage anymore - providing people step into the 21st century and out of the 1980s.





Link to comment
Share on other sites

Wow so many answers so fast! Thank you to all of you! :D

JCPalmer & dbawel: I didn't know shapekeys and it seems very interesting (because, if I understood well, you can "mix" animations ?). But I want to make pretty simple animations, like walking, and especially I am not a computer graphic. The bvh seems more simple, right? Unless I write a tool that translates .bvh to shapekeys?

About the bvh format, I selected it because they are a lot of free resources (ie http://accad.osu.edu/research/mocap/mocap_data.htm). But if this is the worst mocap, perhaps I have to look for an other format. By the way, what do you think of C3D (the other mocap of the website)?

Gryff: Thank you! I think I checked the wrong "alpha" when I wanted to follow the tutorial blender/babylon. Indeed there are tons of Alpha everywhere... When we don't understand what they mean, it's not simple (the world of 3D is new to me).

So my textures are present, thanks to you. For now my .bvh are twisted, but I think I saw a topic where someone was talking about that kind of issue. I'll maybe try the .mhx2, or if it does not work the rigify blender.

PS: sorry for the response time. 3D and English are two difficult things for me, and I also started programming. So everything takes time.

Link to comment
Share on other sites

I love your french Gryff :D


He is Canadian.  Think London is north of Toronto, getting a little too close to the Arctic circle for me.


DB, until Annoa's problem was fixed, felt we should hold back.  She, I think, looks good to go now.


We definitely mis-interpreted both of our first exchanges.  I did kind of wonder, why do I need to explain this to him?  Anyway, this did get me to look at the MHX2.  It is as I thought / hoped.  Make Human added a lot of facial bones that get imported.  The shape keys are derived from a script, after the relevant bones get posed.  This was supposed to be better than the hardcoded shape keys from before, which I think only worked good when the face was symmetrical.


I am thinking about a companion add-on, which does something similar.  I only want the 4 shapes I mentioned earlier, not the dozen or so phonemes.  If I used those, I could not add smile, or loudness.  Gryff's method of combining keys in ratios is much more flexible.


My add-on would have to let you interactively pose the character.  Have 1 button to create a shape key, and another which also wrote out a python subclass to reproduce the posing that could be merged into add-on source.  Sort of a bootstrap, so you would only have to do a new shape once.  This means you could also do it to any bone set.  The author of MHX2, has these data files rather than source for each.  Do not know how he generated it, or what the format of it is.  Could do data instead of source I guess, but the source might be easier to debug.  Want to keep it simple.


Have not done anything yet, only know that I want it to be separate from the exporter, which should only concentrate on exporting the shape keys, not making them.

Link to comment
Share on other sites

Hi guys ! Just a quick question.  I didn't try the new add-on yet.  But when you export a scene with animation is it taking less time to export with tob then the good old babylon export ?  Because when I am exporting an animation from Blender it takes a good 7 minutes to create the export.. 

Link to comment
Share on other sites

I rarely use the .babylon exporter, just TOB.  There is an elapsed time at the end of the .log file as of 3.0.0.  Check the last .log.  Near the end, see if it is writing a .bablyon or .js script.  Run again using the other & compare both logs.  You then tell us.


All I see in your question TOB & the number 7.  Not enough info.  Post shorten versions of both.  Think they should be close.

Link to comment
Share on other sites



For simple walk, run, and other skeletal animation cycles, you won't want to use blend shapes.  And the BVH file format is currently widely supported, so it's not a poor choice to use.  It's simply unfortunate that it has allot of legacy issues and there are better file formats wth less inherent problems.  The C3D file format from Vicon (Oxford Metrics) might be a little overkill for you right now, but is a good format.  I prefer the .HTR file format from Motion Analysis COrporation (MAS for short.)  But again, you're already somewhat familiar with the BVH format, so I would stay on this path for now - unless you're smply not getting results.


@JCPalmer - it appears you've helped a good bit with this already, but let me know if there's anything I might assist with.  I juse returned from several weeks of travel, so I'm still catching up on lost time.  And again, thanks for the explanations, as I'm certain that this reached some users who are not familiar with the different animation methods and formats.


@Annoa - I'll keep an eye on this post, and assist if there is a need.  But you're in the very best hands with JCPalmer, as he is one of the most knowledgable people on this forum - and extremely kind to assist others who might need help from time to time.  





Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...