OGRE Import into JME mixes up Textures

Hello.



Im trying to model a little city with the help of Blender and want to import it into JME afterwards.

Therefore I download Google Warehouse models and import them into Blender.

Then I export the whole scene with ogre exporter. I use the “Hello Collision” Tutorial-Code where I register a filelocator first and then load my model with the assetManager instead of the “town” Model.



This works fine, the only thing Im wondering about is, that JME mixes up a lot of Textures of the Buildings.



The wired thing is, that the amount of mixed up Textures gets more and more the bigger my city becomes.

For instance, when I create a Scene with only one Building, all of its Textures are fine.



During the startup i receice several Warings at the console where it says something like “warning unsupported pass directive: shading” . the warning logs dissappear when the scene was loaded…



Can anyone help me with that?



Regards

You probably register a file locator for each folder, effectively flattening the texture names (each “texture.jpg” is the same for the system). Thats why the SDK manages a proper assets folder with paths and why all tutorials repeatedly mention the importance of the assets folder structure.

Im using eclipse to develop. I have only one folder in “assets/Scenes/” where my city gets exported to, from blender.



Then i Use the HelloCollision Tutorial to start it like follows:



assetManager.registerLocator(“assets/Scenes/MyCity/”, FileLocator.class.getName());

sceneModel = assetManager.loadModel(“MyCity.scene”);

sceneModel.setLocalScale(20f);





But as I said, the Textures get mixed up completely :confused:



thanks for your help

:facepalm: So you do register a locator for each folder and everything I said applies. If you register a locator to e.g. “assets/Scenes/MyCity/” and “assets/Scenes/MyCity2/” and both folders contain a “texture.jpg” then the system cannot tell them apart and it will always load the one that pops up first (e.g. where the locator was registered first). Register “assets” with the AssetManager and then use proper paths, e.g. assetManager.loadModel(“Scenes/MyCity/City.scene”).

I changed it now to



assetManager.registerLocator(“assets/”, FileLocator.class.getName());

sceneModel = assetManager.loadModel(“Scenes/MyCity/MyCity.scene”);



but it changed nothing at all.



As I said, I have only one folder in assets/Scenes/ and I only register one Locator. So there is no other folder where there could be the same texture name.



Maybe this is a problem of Blender itself, because only the Textures of Buildings I imported from Google Warehouse as Collada into Blender seem to get mixed up. I assume, that some Textures have the same name.

@nikrakles said:
I changed it now to

assetManager.registerLocator("assets/", FileLocator.class.getName());
sceneModel = assetManager.loadModel("Scenes/MyCity/MyCity.scene");


Looks like you didn't change it, you are still registering the Locator... which he told you won't work

so you wanna say I should not register a Locator at all? well then I get a AssetnotFound Exception o_O

well i wanna say “use the SDK!!!” and then you wouldn’t have the problem :wink:

Well obviously you should make sure the model actually exports properly in the first place, e.g. by reimporting it. You only have to register a locator if the assets folder is not on your classpath.