I can load everything I want, however the asset manager cannot locate textures associated to a model because it tries to search in jme3’s default asset hierarchy.
JME provides an AssetLocator interface that the AssetManager uses to locate assets. Look at this interface (and the default implementations that jME provides) and register either a suitable built in locator or a custom one.
If it can’t locate that then it’s because the material is referencing that.
If you want to reference the png in a different place then change the material (j3m) to reference it in a different place.
One of the reliable (and sometimes infuriating) part of AssetManager is that it will not ‘search’ for stuff. It will look only where you tell it, basically.
The model is an ogre.mesh with a skeleton and a material converted into a j3o. Even when I specifiy a j3m with the right texture which works on screen, the application still shows the GRAVE output searching for its texture in the Models folder, which does not exist.
There’s no code for loading the ninja’s texture, yet it has one.
I think that the GRAVE output does not verify if I actually load a different texture.
The model I’m trying to load has the following path : model/man/man.j3o
However, jme3 searches for its texture in Models/man/man.j3o as if the first folder was hardcoded. Why can it identify the man folder but not replace Models by model? It is infuriating.
The material I had to create to patch that links a good texture. So my question is : is my only solution to create a j3m for every model?
So, I’m guessing this is what you did:
-used the SDK to import your model and save it as a j3o
-then copied everything to a new folder structure
…that won’t work because the importer already hard-coded the references to those files.
If you want to import your ogre files in this structure then you will have to import them FROM that structure so that the right paths get embedded into the j3o.
What Paul says. Actually the Texture path will be what blender saw and if that path was outside of the assets directory, Textures get placed there (that’s what xbuf does, probably ogre importer won’t do that.
But at least it tries to do something, because it even searches Models/ instead of Textures/.
Another solution would be after loading the model just iterating over each geometry (SceneGraphTraversalAdapter (?)) and adjusting Textures