/* Animation & Modelling 3d, 3dmax with Blender joki-blender: May 2011 */ May 2011

Monday, May 2, 2011

Create Make Human Hair

Create a character in MH as usual, give her some hair, and go to the export menu. Select ".mhx" from the Body menu and ".obj as curves" from the Hair section. The latter is very important. Now some mhx files are created in your makehuman exports folder, together with an obj file with the hair info. Since I created my character by turning the dwarf-giant slider to the extreme left, I call her dwarf, and the hair file is then called hair_dwarf.obj. And don't close MakeHuman quite yet.
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7clYQHNcGyF_dVmgjHGvOEpyNSJ_1HuvMLWPZ8wiSd3GK-01wInDtynQmQzpt5QaxveUq-rApR_KS9oi256HiKYLZB8qzhT1L3_1BDGueiKJEKQF8YYSfoJkz8bQWny7g7QMkL_wrlpMT/s320/hair.png
There is a new import script in the importers/mhx/blender25x folder: import_hair_obj.py. Copy it to your Blender scripts/io folder, or load and execute it in the internal text editor. In the files/import menu there is now a new option: "MakeHuman hair (.obj)".
1. First import one of the mhx files, say dwarf-gobo-25.mhx.
2. Select the imported character in the viewport, to indicate that she will receive hair. This is easy to forget.
3. Import the corresponding hair file.
And now the character has hair.
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxsSCTmjJ7yg5FUjhQwlrC_GYdl0-AgalYNBOeoJaq6Xxz4b6jxJ46XC4eAQkI928nEzOo-DN-ToUkMjeop-H8ngepU4gV8ejOSxQgznkYwVQXZApVsTC_5JSOgvJAwTbSlzjuByVX0wiM/s320/curly.png

One advantage of storing hair in separate obj files is that you can easily switch hairstyle in Blender. Back in MakeHuman (you didn't close it, right), we can now choose a different hairstyle and export it. I prefer to set the Body switch to obj, and to change the name of the character to reflect the hairdo: dwarf-curly, dwarf-ponytail, dwarf-long (better than test). In Blender, delete the current hair in the particle context, and import a new one using the procedure above.

Rendering has a tendency to crash Blender, but sometimes it does not. We evidently have some problems with eyebrows and eyelashes, but that is a different story.

Update: The import script now automatically connects the hair to the mesh. The procedure for making the connection manually is hence unnecessary and has been removed from the post.

The ponytail hairstyle has some problems; the tail itself does not move with the head.

Update:
1. The hair still does not seem to be edited after importation. To fix this, toggle into particle mode, select the mesh, and toggle back into object mode.

2. Hair can now also be applied to meshes that were imported as an obj file. Just make sure that -X90 is checked and that Group is unchecked before you import the mesh.

3. The locations of the strands are given in global coordinates. Therefore the character should not be moved before her hair is connected to the mesh.

4. A hair file can be imported onto any mesh, but there are problems if the skull is not were it should be. The characters below both use the same hairstyle, which was created for the taller one.
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKctlhFzVBOQ0IVrUqXM5ekzEE6GMURmtdDalzlB2dk8eLOCwFOKxNfkSyrbTgYdA73IsaMLtVw0xAwfbRJdKN6hoXuNJcgW35XTrsduS0oRJ8pBZJemNnp3IUvUg_sfU6xmBNDvioFuNC/s320/twins.png

Update: Manuel noticed that the hairs were jagged. The behavior seems to improve if B-spline interpolation is turned off, so I did so.
https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEia_KWY1PX-QcsluNMj5rfq_6rDIxhqPUd1uF0RLhDYNJWfN0uYIjEiBaPBGyBSwyIr0uHCVRRClJIrMaPzK57V-YBd65qVfPG1qlV3tUiSJ1rE-2-SptFMRseJ7R7IfMQdUty9D5N90OiP/s320/bspline.png

 

Read More...