Howto set texture for one model with multiple meshes

Hi and sorry about the next newbie question. But this is still unclear to me.



Exporting models from blender doesnt get them textured automatically, even when I applied materials and textures.

Now I tried with the tutorials to set textures. But those tutorials just set textures to geom objects, not to imported models.

And finally I tried creating materials files and adding them to my model. This seemed to be nice. But after I load the model

that I edited before, still there is no texture. I have to call the setTexture method, even after I chose the materials file in

the SceneComposer in the mesh properties. Now I wonder what is the correct way. Especially because one model always

has more than just one mesh. But I can only call the setMaterial and setTexture method once on the model. I can´t give a

model a list of materials which would be needed for all the meshes available.



Also unclear to me is wether every mesh in my model needs an ambient light or if its enough to place one in the trunk of the model…



Hope someone can clear this a bit for me :wink: THANKS in advance.

Yes you can apply a j3m material to each geometry separately. Just select the geometry and then create or select a j3m file for it. Normally textures should get imported though. If you use OgreXML, only UV mapped textures will get imported, the blender importer converts internal blender texture formats to UV textures while importing. Generally for live rendering only UV mapping is used for texturing. Theres links to docs on the right that show you how you create a game-ready model in blender and export it correctly.

Are you looking for the .getSubmesh(int) command? Then you can do model.getSubmesh(i).setTexture(whatever).