Page 1 of 1

Meshbuffer name same as blender material name?

Posted: Sat Jan 31, 2009 4:09 pm
by 3DModelerMan
I have a blender material that I want to get as a meshbuffer in Irrlicht. The blender material is called "grass" and there are a couple other materials in blender. When I export to .obj will those show up as Irrlicht meshbuffers with correct mapping?
Thanks :D .

Posted: Sat Jan 31, 2009 4:49 pm
by bitplane
No, meshbuffers don't have names, and any groups with the same texture will probably be merged into the same mesh buffer for performance reasons.

Posted: Sat Jan 31, 2009 4:57 pm
by hybrid
It's far easier to test it out, maybe you don't even get the object properly exported. So asking would be pointless. Do your very best and show us the results. If they don't do what would be expected we can suggest better ways.

Posted: Sat Jan 31, 2009 5:03 pm
by Dorth
Also, this topic should be in beginner's help, not off-topic.

Beginers help?

Posted: Sat Jan 31, 2009 10:46 pm
by 3DModelerMan
I thought that since it had to do with blender I should put it here, sorry.
I've never seen how to get a pointer to an IMeshBuffer so I thought that I would ask you that here, I have the mesh buffers set up in blender but I want to manually load the textures so that I can make sure the file path is right.

Posted: Tue Feb 03, 2009 3:05 am
by oldskoolPunk
gandaldf's b3d exporter retains material grouping when imported in irrlicht ! :D

But you access it by material(n) , not by names lol.

Posted: Thu Feb 05, 2009 5:23 pm
by zillion42
That is a very interesting question indeed. Or rather it would be nice if not meshbuffers but at least SMaterials would have a name... I tried exactly that, to find there is no information left whatsoever after exporting except the index, in my case with another B3D exporter... The reason that would be very useful, is that it would enable us to set different irrlicht materials based on the material name in an automated way.

The only two other solutions that come to my mind would be writing an xml exporter for my 3d application or to determine the material type based on the diffuse texture name.
The xml solution is probably the best, since it could carry material type, relative translations of objects and all sorts of other useful information, is also the most difficult to implement.
The second solution, determining material type based on diffuse texture name, automatically sorts my texture names in a nice fashion, but it's in fact very 1980's...

Code: Select all

   scene::IAnimatedMesh* testcubeM = smgr->getMesh("../data/testcube.b3d");
	u32 MbCount = testcubeM->getMeshBufferCount();
	for(u32 i=0; i<MbCount; i++){
		scene::IMeshBuffer* currBuff = testcubeM->getMeshBuffer(i);
		video::SMaterial currMat = currBuff->getMaterial();
	   "string name = currMat->getName()"
      "if(name.startsWith("BLABLABLA") change material to BLABLABLA"
	}
any suggestions ? Any other importer capable of doing that ?

Posted: Thu Feb 05, 2009 5:31 pm
by Spawn
Don't use the obj exporter. Go ahead and open it up in notepad, it saves the number or vertices and their locations. Use 3ds