Only getting Grey models from MakeHuman

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Uberbot
Posts: 31
Joined: Thu Dec 13, 2007 4:07 am

Only getting Grey models from MakeHuman

Post by Uberbot »

Well, I'm still working through the examples. However, I thought I understood how Example 7 worked. So, I thought I'd try to bring in a model created by MakeHuman http://www.dedalo-3d.com/

I save the model as .dae and bring it into Blender and export it as .x.

But, the results are that the model displays as grey.

The code I'm using is:

material.setTexture(0, driver->getTexture("./textures/test.bmp"));
faerie = smgr->getMesh("./models/tutorial.x");

if (faerie) {
node = smgr->addAnimatedMeshSceneNode(faerie);
node->getMaterial(0) = material;
node->setScale(core::vector3df(5,5,5));
node->setPosition(core::vector3df(-70,0,-50));
node->setRotation(core::vector3df(0,90,0));
node->setMD2Animation(scene::EMAT_RUN);
}

The test.bmp file is simply a brown (or red, even) block. I'm just interested in making the figure have any color besides grey.

What am I missing?

On the same note, is there any good tutorial on how to make clothes for blender models?

Thanx in advance,
Mike.
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

Hi, Mike.

Thanks for giving us this link. This project look very promising.

Does your model get in blender in color? Perhaps, the surfaces are not exported correctly. Have you checked in blender that the map is properly defined for the character?
mqrk
Posts: 16
Joined: Mon Dec 10, 2007 5:55 am

Post by mqrk »

I just went through this myself. Try adding

Code: Select all

 node->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, true); 
Make sure you apply the material before calling this.
Last edited by mqrk on Mon Dec 24, 2007 7:55 am, edited 1 time in total.
Uberbot
Posts: 31
Joined: Thu Dec 13, 2007 4:07 am

Post by Uberbot »

christianclavet wrote:Hi, Mike.

Thanks for giving us this link. This project look very promising.

Does your model get in blender in color? Perhaps, the surfaces are not exported correctly. Have you checked in blender that the map is properly defined for the character?
Yes, the model comes into blender with color. When the example is running, I see nicely rendered, though grey, figures. When the figure is selected, it turns to an awful orange, with NO depth. It looks like a 2D shadow of the figure. Perhaps this orage color is the color from the model, but I'm missing something else that makes it look "right?"
Uberbot
Posts: 31
Joined: Thu Dec 13, 2007 4:07 am

Post by Uberbot »

mqrk wrote:I just went through this myself. Try adding

Code: Select all

 node->setMaterialFlag(video::EMF_NORMALIZE_NORMALS, true);
Make sure you apply the material before calling this.
I tried this and it didn't seem to help.
mqrk
Posts: 16
Joined: Mon Dec 10, 2007 5:55 am

Post by mqrk »

Try it with a texture that is not a solid color. When it is selected, no lighting is calculated (as part of the tutorial), so you won't see any depth.

EDIT: I just tested this and was able to reproduce exactly the phenomenon you described.
kornwaretm
Competition winner
Posts: 189
Joined: Tue Oct 16, 2007 3:53 am
Location: Indonesia
Contact:

Post by kornwaretm »

hi everybody
i got same problem, it's not irrlicht but blender's .x exporter.
i've search the forum for weeks. and what i found it's something about the blender's exporter (sadly i forgot where it is). they said the output .x file from blender's exporter has a different order than the microsoft directx does. and why the model looks grey when loaded in irrlicht. may be because the default vertex color in blender is white. and somewhat this is the problem from the exporter also. i set the material lighting to false and the model turn colored. what a boring scene without dynamic lighting.

by the way have u use the latest xExporter 2.42 ?
and at the www.blender.org they also working on the makehuman, same function but in blender script.
Uberbot
Posts: 31
Joined: Thu Dec 13, 2007 4:07 am

Post by Uberbot »

mqrk wrote:Try it with a texture that is not a solid color. When it is selected, no lighting is calculated (as part of the tutorial), so you won't see any depth.

EDIT: I just tested this and was able to reproduce exactly the phenomenon you described.
I modified my model so that it has a MARBLED texture. I also used a "stones.jpg" texture in the call to material.setTexture().

Neither change has changed what I'm seeing. I'm sure once I get past this hurtle, things will speed up for me.

I've posted my project at: http://www.diehlnet.com/test.tgz

What am I doing wrong! :?

Thanx again,
Mike.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Try to load them in the meshviewer (example 9). It will show proper vertex colors. I guess you have to disable lighting or add a light scene node to get the same effect in your app. The problem with textures is that you have to choose the proper meshbuffer to apply the texture to. The body seems to have material 7 (in tutorial2 mesh), but you should just try all buffers to see what's happening. The .x materials simply don't have textures applied, otherwise the textures would load automatically. Maybe you can ask blender to export a complete material including the textures. Or you add the file manually, check the dwarf.x example mesh on how to add texture to the material (all .x files used are ascii encoded, so you can edit them with a text editor).
Uberbot
Posts: 31
Joined: Thu Dec 13, 2007 4:07 am

Post by Uberbot »

So, I'm still working on this problem. I was able to load the Dwarf.x file and it displayed correctly. So, I'm convinced that my code is correct.

I was able to export a MakeHuman model into .x format and change the colors that irr displayed by modifying the material library. However, there was no "texture," just color. I understand that this is because irr sees it as one color and doesn't do any shadow calculations. How do I go about "fixing" this? I guess that I could assign slightly different colors to each poly, but I'm getting this would become "tedious" pretty quickly.

Otherwise, what tools (for linux) do people use to create models?
Uberbot wrote:
mqrk wrote:Try it with a texture that is not a solid color. When it is selected, no lighting is calculated (as part of the tutorial), so you won't see any depth.

EDIT: I just tested this and was able to reproduce exactly the phenomenon you described.
I modified my model so that it has a MARBLED texture. I also used a "stones.jpg" texture in the call to material.setTexture().

Neither change has changed what I'm seeing. I'm sure once I get past this hurtle, things will speed up for me.

I've posted my project at: http://www.diehlnet.com/test.tgz

What am I doing wrong! :?

Thanx again,
Mike.
:) :) :)
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

No, that's not the problem, nor is it a good solution (guess what happens if the character turns around). The problem is that your mesh is not textured. Read in the 2d/3d graphics forum about how to do this. It's some work you will have to do before getting an acceptable result with textures. But vertex colors also do proper shading, at least under OpenGL. You simply need a light and enable lighting in the material.
Uberbot
Posts: 31
Joined: Thu Dec 13, 2007 4:07 am

Post by Uberbot »

hybrid wrote:No, that's not the problem, nor is it a good solution (guess what happens if the character turns around). The problem is that your mesh is not textured. Read in the 2d/3d graphics forum about how to do this. It's some work you will have to do before getting an acceptable result with textures. But vertex colors also do proper shading, at least under OpenGL. You simply need a light and enable lighting in the material.
Well, I wasn't being entirely serious about coloring each poly in my model. Write it off to frustration.

It seems that the models that come with a UV mapping ALWAYS work correctly. The models that simply include a material don't.

So, I'm convinced that this is a Blender issue and that the Irrlicht library works well and is actually pretty easy to get going with. Nice work guys.

In the mean time, I'll spend some time reading the Irrlicht forums and taking some blender tutorials.

Since I do have a model that works, I'll be able to make some progress in my project by finishing up the non-blocking network IO routines.

Thanx for the help.

Mike. :P :P
Post Reply