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 ?