From MakeHuman To Blender Using Export And The MHX

If you have problems understanding something or getting started, ask here

Moderator: joepal

From MakeHuman To Blender Using Export And The MHX

Postby VitalBodies » Sat Jan 16, 2010 6:08 am

From MakeHuman To Blender Using The MHX
I am interested in knowing more about going from MakeHuman (export) to Blender (Import) using the MHX.
There are a number of posts on the forums but some seem a bit out of date.
At the time of this writing Blender 2.49a and MakeHuman 1.0.4alpha are the current versions.
I would like to invite any and all resources that anyone knows about, added to this thread in the form of knowledge, images or links or etc.

Image

The docs go a long ways towards making this fairly easy - but at least for me a few questions remain.
Blender Export and MHX Documentation:
http://sites.google.com/site/makehumandocs/blender-export-and-mhx

TEXTURE DIRECTOR button:
The docs say:
Select the directory where the import script should look for textures. By default, textures are assumed to be located in the data/textures folder in the MakeHuman directory from which the file was exported.


Should we be pasting in the directory where the textures are located?
So for the makehuman-nightly that would be:
Code: Select all
/usr/share/makehuman/data/textures

And for the makehuman-alpha that would be:
Code: Select all
/usr/local/makehuman/data/textures


Once we import, (using the MHX) are we ready to do a test render?
For me (in Ubuntu 9.10) there is no camera or lights so I have to add them if I choose REPLACE SCENE in the MHX. For someone new and just getting started it might be easier to open blender and choose File > New, delete the default cube (delete) and leave the REPLACE SCENE un-pressed in the MHX. This will at least give you the default camera and a light.

What should we see if we do a test render? .
For example, if I do a render I get nothing but a blue screen after deleting the cube and importing the MakeHuman model?

What does a beginner need to do to complete the process and be at least ready to make a test render?
Image
Ubuntu 10.04 (Lucid) 64-bit
http://www.vitalbodies.net/site/art-des ... anorg.html
MakeHuman 1.0Alpha4 - Blender - Inkscape - Gimp - AQSIS 1.6
VitalBodies
 
Posts: 91
Joined: Tue Jan 05, 2010 8:00 pm

Re: From MakeHuman To Blender Using Export And The MHX

Postby ThomasL » Sat Jan 16, 2010 10:17 am

Thank you for your feedback, which is very valuable for me. This should eventually result in a FAQ. In the mean time, here are some comments.

Texture directories
The mhx file link to textures in the ./data/textures directory, where . is the directory where MH was started. The path is overridden if the importer finds the texture in the directory specified by pressing the Texture Directory button. I have just changed the default location to ~/makehuman/exports, where the exported files go. Previously the importer looked at ., which is the Blender directory.

Replace scene as default
The importer deletes all objects in the scene, including the world. This is probably not a good idea, better to just delete meshes and armatures. However, if replace scene is disabled, it is up to the user to delete all objects if he imports several characters, including the display objects hidden away on layer 20. Blender also has a tendency to become unstable if you import several characters; I have sometimes got errors of the type "This can not happen".

The character does not render on Linux
This is a Blender bug. Apparently Blender can not read tif files (at least not the MH textures) under Linux, but there are no problems on Windows. Unfortunately the bug seems to be present in Blender 2.50 as well. If you look at the material editor, you see that the skin shader material is invisible, and that the textures are black (except for the procedural bump).

Workaround:
1. Convert the textures to png.
2a. Load the textures in Blender after the character has been loaded.
2b. Modify the three filenames in makehuman/data/3dobjs/mhxbase.mhx from .tif to .png.

To verify that you have this bug, start Blender from a terminal and look for this:

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
ThomasL
 
Posts: 1139
Joined: Tue Sep 15, 2009 2:46 am

Re: From MakeHuman To Blender Using Export And The MHX

Postby VitalBodies » Sat Jan 16, 2010 7:44 pm

I am glad this feed back helps - my intent is to be helpful and have fun : )
I could not tell if I was just too new, or there was some kind of bug I was up against.
I figured that since the cube renders in Blender the MakeHuman model should also.

On youtube.com doing a key word search of "MakeHuman" brought up some video tutorials about MakeHuman that were fun and informative to see although most of the videos used earlier versions of MakeHuman.
Additionally, I got the impression that back then, one mostly used the Caldera export/import method and most (if not all) of what I found for importing into Blender related to that.

I will attempt the steps you wrote and get back to you.
Thanks!

You wrote:
Texture directories
The mhx file link to textures in the ./data/textures directory, where . is the directory where MH was started. The path is overridden if the importer finds the texture in the directory specified by pressing the Texture Directory button. I have just changed the default location to ~/makehuman/exports, where the exported files go. Previously the importer looked at ., which is the Blender directory


So is this to say that the textures will also be stored in the ~/makehuman/exports?
And..
What are to two possibilities of what I might/should see if I press the TEXTURE DIRECTOR button?
For example I just see
Code: Select all
TexDir? .

And should that button say TEXTURE DIRECTOR or TEXTURE DIRECTORY?


Image

PS Will the Linux version have PNG files and a new/edited mhxbase.mhx file from this point on?
Ubuntu strives to use only open source programs (free as in freedom) AND also open source file formats - I wonder if that is why the tiff files do not work?
You might consider making sure that the fonts used through out the MakeHuman project are also open source fonts along with any and all file formats if and where possible - that will be supportive in the long run on any platform.

UPDATE:
Written in the docs:

Some MakeHuman installers make an attempt to copy the file to the correct place in the Blender scripts folder. If so, no preparation is necessary.

Would you know where that is we would need to copy the file to?
Image
Ubuntu 10.04 (Lucid) 64-bit
http://www.vitalbodies.net/site/art-des ... anorg.html
MakeHuman 1.0Alpha4 - Blender - Inkscape - Gimp - AQSIS 1.6
VitalBodies
 
Posts: 91
Joined: Tue Jan 05, 2010 8:00 pm

Re: From MakeHuman To Blender Using Export And The MHX

Postby mflerackers » Sun Jan 17, 2010 1:14 am

Tiff is completely open and documented, and we use the libtiff library available on ubuntu, which has a MIT like license. I have no idea why blender would have problems with it. The "DDS: not valid; header follows" is not even about tiff, dds is a graphics card texture compression format by Micrsosoft http://en.wikipedia.org/wiki/DirectDraw_Surface. Maybe blender sees it as a dds and uses the wrong loader, or it converts it to dss and fails, no idea. But there's nothing wrong with the tif file.
MakeHuman project Developer
mflerackers
 
Posts: 636
Joined: Thu Feb 05, 2009 11:53 am
Location: Kyoto

Re: From MakeHuman To Blender Using Export And The MHX

Postby VitalBodies » Sun Jan 17, 2010 1:49 am

mflerackers wrote:Tiff is completely open and documented, and we use the libtiff library available on ubuntu, which has a MIT like license. I have no idea why blender would have problems with it. The "DDS: not valid; header follows" is not even about tiff, dds is a graphics card texture compression format by Micrsosoft http://en.wikipedia.org/wiki/DirectDraw_Surface. Maybe blender sees it as a dds and uses the wrong loader, or it converts it to dss and fails, no idea. But there's nothing wrong with the tif file.


I am no expert on tif vs png and support the team on what ever they choose. I notice I can not open certain types of tif files in Firefox, for example, like the ones at the US Patent web site. I am not arguing for one format or another just making a suggestion. :)

Currently written in the Wikipedia: http://en.wikipedia.org/wiki/Portable_Network_Graphics#Comparison_with_TIFF
Comparison with TIFF

Tagged Image File Format (TIFF) is a complicated format that incorporates an extremely wide range of options. While this makes TIFF useful as a generic format for interchange between professional image editing applications, it makes adding support for it to applications a much bigger task and so it has little support in applications not concerned with image manipulation (such as web browsers). It also means that many applications can read only a subset of TIFF types, creating more potential user confusion.

The most common general-purpose, lossless compression algorithm used with TIFF is Lempel-Ziv-Welch (LZW). This compression technique, also used in GIF, was covered by patents until 2003. There is a TIFF variant that uses the same compression algorithm as PNG uses, but it is not supported by many proprietary programs. TIFF also offers special-purpose lossless compression algorithms like CCITT Group IV, which can compress bilevel images (e.g., faxes or black-and-white text) better than PNG's compression algorithm.
Image
Ubuntu 10.04 (Lucid) 64-bit
http://www.vitalbodies.net/site/art-des ... anorg.html
MakeHuman 1.0Alpha4 - Blender - Inkscape - Gimp - AQSIS 1.6
VitalBodies
 
Posts: 91
Joined: Tue Jan 05, 2010 8:00 pm

Re: From MakeHuman To Blender Using Export And The MHX

Postby VitalBodies » Sun Jan 17, 2010 9:40 am

As I attempt the workaround I have run into a number of unknowns.
For example, as I SAVE A COPY of a texture file using GIMP (from TIF to PNG) I am asked questions I do not know how to answer like "save gamma" compression ratio etc?
Also, on the nightly-builds I run into the issue of of having everything wiped out every time the program is updated (likely to be at least nightly) so I have to start over on creating links and converting or editing files and the like.
The nightly version of Blender does not like tif as you mentioned and does show the DDS error.

I ended up switching back to the alpha version as attempting the import I got 31 errors and was not sure if that is because I used a nightly build exported model.

Be aware I am working in the dark with a lot of things changing and not knowing what is supposed to happen when I do any particular thing.

A few other unknowns I mention as feedback are with the texture files.
There are no textures in the makehuman/exports folder they are in a sub-folder of that folder.
So confusion arises and to what to put in the dialogue box (if anything) after clicking the TEXTURE DIRECTOR button.

Additionally, if you are not familiar with blender you might wonder how opening a text file (within Blender) could make any difference to anything?
Just open the text file? Or does one have to press any certain buttons like the one that says "enables python script plugins"?
Does one open the file in the TEXT panel or the SCRIPTS panel might also be a question some might ask or wonder.

Image
Image
Ubuntu 10.04 (Lucid) 64-bit
http://www.vitalbodies.net/site/art-des ... anorg.html
MakeHuman 1.0Alpha4 - Blender - Inkscape - Gimp - AQSIS 1.6
VitalBodies
 
Posts: 91
Joined: Tue Jan 05, 2010 8:00 pm

Re: From MakeHuman To Blender Using Export And The MHX

Postby ThomasL » Sun Jan 17, 2010 7:56 pm

I have changed the search order for images. The import script will now search for the following files:

1. ~/makehuman/exports/file.png
2. ~/makehuman/exports/file.tif
3. /usr/share/makehuman/textures/file.png
4. /usr/share/makehuman/textures/file.tif

If you convert the textures to png and put them into the ~/makehuman/exports folder, they will be found and loaded instead of the tif files in the distribution. These files will not be overwritten.

To convert a texture to png under Ubuntu:

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.
ThomasL
 
Posts: 1139
Joined: Tue Sep 15, 2009 2:46 am

Re: From MakeHuman To Blender Using Export And The MHX

Postby VitalBodies » Sun Jan 17, 2010 11:34 pm

Using the makehuman-nightly the MHX TEXTURE DIRECTORY button now fills in the dialogue box correctly.
Having renamed the 3 texture files using Gnome image viewer to png files and saving them to the ~/user/makehuman/exports/ and renaming the 6 instances of tif to png in the mhxbase.mhx after opening it with gedit as root I should be set to go.

What I ran into as a new user:
Render is still just blue.
You had said in the docs: "2a. Load the textures in Blender after the character has been loaded."
I was not sure how to load the textures/images into Blender.
I wondered if the changes I made to the mhxbase.mhx will get wiped out during the next nightly update.
I hoped that the export and models links would be made for me so I do not have to make every time a nightly update happens...

Not complaining, just whinning a little. :)
Last edited by VitalBodies on Wed Jan 20, 2010 6:22 pm, edited 1 time in total.
Image
Ubuntu 10.04 (Lucid) 64-bit
http://www.vitalbodies.net/site/art-des ... anorg.html
MakeHuman 1.0Alpha4 - Blender - Inkscape - Gimp - AQSIS 1.6
VitalBodies
 
Posts: 91
Joined: Tue Jan 05, 2010 8:00 pm

Re: From MakeHuman To Blender Using Export And The MHX

Postby ThomasL » Tue Jan 19, 2010 5:10 am

Put the png files in the ~/makehuman/exports folder. Starting with tonight's build, the import script looks there first and should find your textures. These files will not be overwritten, and no need to edit mhxbase.mhx anymore.

Btw, did you put them in ~/user/makehuman/exports/ ? The import script looks at ~/makehuman/exports/. That works on my machine.
ThomasL
 
Posts: 1139
Joined: Tue Sep 15, 2009 2:46 am

Re: From MakeHuman To Blender Using Export And The MHX

Postby VitalBodies » Wed Jan 20, 2010 8:35 pm

Tried this again last night and I think you got it.
Although the default lighting in Blender created some confusion as the model was almost totally black with just a bit of colour against a blue back ground, the model did seem to have the images applied.
From what I could tell being new the black was from poor lighting and perhaps the wrong camera angle relative to the light?
I used the default scene with the cube and simply imported using the MHX and then hit F12.
The MHX used the correct location for the images.
My images are in the /home/user/makehuman/exports folder.

It is nice to not have to change the file (mhxbase.mhx) each time - really nice.
Would be fun to know where to put the text file we have to open so that is automated.

Really fun to see this moving forward and it looks as though you have been busy adding additional pages to the doc.

Now that there is yet another nightly build I will try again and this time move the lights or camera.
Image
Ubuntu 10.04 (Lucid) 64-bit
http://www.vitalbodies.net/site/art-des ... anorg.html
MakeHuman 1.0Alpha4 - Blender - Inkscape - Gimp - AQSIS 1.6
VitalBodies
 
Posts: 91
Joined: Tue Jan 05, 2010 8:00 pm


Return to Newbies

Who is online

Users browsing this forum: No registered users and 1 guest