Thursday, February 10, 2011

New hair grouping tutorial and a note on Blender's .obj importer

Unfortunately we just found a bad behaviour in Blender's .obj importer for nurb (curves). Either that or I have not figured out Blender's .obj importer/exporter correctly. Here is the difference:



So what's going on? Well makehuman saves and loads hairs Wavefront .obj file as cubic curves. But Blender's importer adds one order to the original curve's order in the .obj file. So if I defined my .obj file as a cubic curve it loads and displays it as a quadric curve and if I have a quadratic curve it displays it as a cubic curve. And apparently the exporter saves the hair correctly (it saves a cubic curve displayed in blender as cubic). But then when you import the saved hair (from Blender) you get a curve of a higher order than the original one saved in Blender.

Ok... that was crazy. So, as a fast workaround, I had to write a script for exporting the hair as a lower degree (because I already knew how to write an exporter, but for importing I still need to learn a bit more). I also changed the makehuman .obj curve exporter to save it as quadratic curve so that contributors can still work in Blender while we find a real fix for this (I need to contact the developers of Blender's .obj exporter/importer).

The other news is ... there is a new tutorial on how hairs are grouped to have a decent render of hairs in makehuman. By the way, I want to extend my thanks to workinprogress for contributing the hair in my tutorial (I also commited it in the svn). Since a lot of people are asking me how the hair rendering and hair interpolating works, I wrote a short explanation of it in the tutorial as well. The tutorial is available here.

PS: we use Blender 2.49b to import. As far as I know Blender's 2.5x has no importer for Wavefront .obj files yet... even if they did I would guess that importing .obj curves is not yet implemented.

PPS: If I want to briefly summarize: At the moment for things to work.. in Blender we export .obj curves using our own script and import using Blender's importer.

2 comments:

  1. You wrote:
    "As far as I know Blender's 2.5x has no importer for Wavefront .obj files yet... even if they did I would guess that importing .obj curves is not yet implemented."
    Of course the DO have an .obj importer, it's here for quite a long time already. As with all importers, you simply have to enable it in user preferences/Add-Ons.
    Haven't checked importing .obj curves. give it a try ;-)

    ReplyDelete
  2. I'd rather wait until blender 2.5x is stable. It's still in alpha/beta stage and mh is also in beta stage. IMO working with another beta software will lengthen our development, if with 2.49b everything works then I keep on working with it until 2.5x is mature enough to get out of the beta. Otherwise I will just have to keep up with its everchanging python API.

    ReplyDelete

© MHteam 2001-2010