jMonkeyEngine / jMonkeyEngine/jmonkeyengine
Ogre loader cannot load multiple materials
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 4.3k
- Forks
- 1.2k
- Avg merge
- 4d 7h
- Merged PRs (30d)
- 14
Description
The ogre mesh loader only loads the default material, which is the one with the same file name as the mesh itself. Even if the ogre exporter exports multiple materials correctly, jme3 will fail to load them.
Whilst debugging, I found out where I think the bug is :
DesktopAssetManager.java
public Spatial loadModel(String name){
return loadModel(new ModelKey(name));
}
Instead, this should work :

However, doing this creates a circular dependency in the gradle configuration, as it tries in the core project to use classes from the plugins project.
Anyway, the problem is that the core loader does not take into account custom ModelKeys from the plugins.
Here's a model exported from Blender using the ogre exporter. If you look into the mesh.xml file, you can see the materials are properly set.
crystaler.zip
Here are the log warnings :

Even though we convert the ogre mesh into an .j3o file, we need the materials to be properly loaded...
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in DesktopAssetManager.java at loadModel(String), then inspect how custom ModelKeys from the plugins project are handled and why the core/plugins Gradle dependency becomes circular. Reproduce with the linked crystaler.zip and its mesh.xml, and verify that converting the Ogre mesh to .j3o loads all exported materials rather than only the default one.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system, game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100