I recently was able to get ogres xml converter to work, but I am running into a problem now where when I try to load a .xml item it is stating that it can not locate the .material for it. I move the .material file over with it, tried moving to different folders within the asset hierarchy, tried linking directly in the coding to the .material file, but still gives same exception. Any ideas on what may be causing this?
your material name has to match the .mesh.xml. I.e Cube.mesh.xml and Cube.material
Jun 14, 2012 7:58:25 PM com.jme3.scene.plugins.ogre.MaterialLoader readPassStatement
WARNING: Unsupported pass directive: alpha_to_coverage
Jun 14, 2012 7:58:25 PM com.jme3.scene.plugins.ogre.MaterialLoader readPassStatement
WARNING: Unsupported pass directive: colour_write
Jun 14, 2012 7:58:25 PM com.jme3.scene.plugins.ogre.MaterialLoader readPassStatement
WARNING: Unsupported pass directive: depth_check
Jun 14, 2012 7:58:25 PM com.jme3.scene.plugins.ogre.MaterialLoader readPassStatement
WARNING: Unsupported pass directive: depth_func
Jun 14, 2012 7:58:25 PM com.jme3.scene.plugins.ogre.MaterialLoader readPassStatement
WARNING: Unsupported pass directive: depth_write
Jun 14, 2012 7:58:25 PM com.jme3.scene.plugins.ogre.MaterialLoader readPassStatement
WARNING: Unsupported pass directive: illumination_stage
Jun 14, 2012 7:58:25 PM com.jme3.scene.plugins.ogre.MaterialLoader readPassStatement
WARNING: Unsupported pass directive: light_clip_planes
Jun 14, 2012 7:58:25 PM com.jme3.scene.plugins.ogre.MaterialLoader readPassStatement
WARNING: Unsupported pass directive: light_scissor
Jun 14, 2012 7:58:25 PM com.jme3.scene.plugins.ogre.MaterialLoader readPassStatement
WARNING: Unsupported pass directive: normalise_normals
Jun 14, 2012 7:58:25 PM com.jme3.scene.plugins.ogre.MaterialLoader readPassStatement
WARNING: Unsupported pass directive: polygon_mode
Jun 14, 2012 7:58:25 PM com.jme3.scene.plugins.ogre.MaterialLoader readPassStatement
WARNING: Unsupported pass directive: scene_blend_op
Jun 14, 2012 7:58:25 PM com.jme3.scene.plugins.ogre.MaterialLoader readPassStatement
WARNING: Unsupported pass directive: shading
Jun 14, 2012 7:58:25 PM com.jme3.scene.plugins.ogre.MaterialLoader readPassStatement
WARNING: Unsupported pass directive: transparent_sorting
Jun 14, 2012 7:58:25 PM com.jme3.material.MaterialDef
INFO: Loaded material definition: Phong Lighting
Jun 14, 2012 7:58:26 PM com.jme3.app.Application handleError
SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
java.lang.NullPointerException
at com.jme3.scene.plugins.ogre.MeshLoader.applyMaterial(MeshLoader.java:215)
at com.jme3.scene.plugins.ogre.MeshLoader.startSubMesh(MeshLoader.java:284)
at com.jme3.scene.plugins.ogre.MeshLoader.startElement(MeshLoader.java:652)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:506)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:376)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2715)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:116)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:488)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1210)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:568)
at com.jme3.scene.plugins.ogre.MeshLoader.load(MeshLoader.java:872)
at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:282)
at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:410)
at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:420)
at jme3test.helloworld.hellojme3.simpleInitApp(hellojme3.java:37)
at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:228)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:129)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:205)
at java.lang.Thread.run(Thread.java:722)
is the exception I am getting now. I am using a base red material on the monkey head and nothing more.
Can you try loading your model on the jME3 nightly build? Some bugs related to material loading were fixed recently
I am sorry, but I am not sure what the jME3 nightly build is?
I do not see this option listed under run, tools, etc… I checked the help tool in jme3 and nothing came up.
This is a very small program, the info from the Hello Asset tutorial with the models taken out and replaced with the loading of just this model and a light so it takes only a few seconds for this to build, compile, and run.
Update:
I was looking for nightly build in the help section in jme3, I tried just nightly and I see that is where one gets the updates that will be coming out that night. I am currently updateing now and will update again once I am done checking.
Update 1.2:
I just wanted to say you devs are awesome for getting that fixed so quick. After 3 days of messing with .xml, .obj, and .blend files I finally am able to get the .xml files to work properly. I can finally start further on in the tutorials instead of being stuck on number 2.
I have exactly the same problem, after downloading jMonkeyEngine 3.0 beta, Blender 2.6.3 and blender2Ogre-0.5.7-preview1 at the end of June.
I will try the new nightly as well.
Are there other restrictions like “your material name has to match the .mesh.xml” I should know about? Is it enough to give appropriate names to all the objects and their textures/materials within blender? At the moment, the Ogre exporter allows me to choose “.scene and .mesh” among other options. Is that the right one?
Thanks,
Charles
Note if you use submeshes and more than 1 material:
After hours of trying stuff and eventually looking in the JME java files dealing with generating this error, it seems the easiest way to fix having JME locate all the necessary materials is creating one file “NameOfMeshFile.material” and append all materials into that file.
It still complains about missing pass and texture_unit directives. Actually it complains about all of them. Am I missing something?
If you load the .scene file with latest jME3, it will always work. A fix went in today just for that.
yes, now works, and before that update, i just lost whole day trying to load model from blender 2.6. Old ogre exporter works but is terrible since im not used to blender 2.49. Its good to see support for blender 2.6 is coming. Importing models is the most important thing for one game engine. OK enough talking, back to modeling and coding
edit: i have trouble displaying textures on model. Model now loads great, but textures are unrecognizable. I copy textures in same folder where is .blend file and i points paths in that .blend file to those textures and jmonkey does not sees them. On import they are not loaded. Am i doing something wrong. Or is that another bug?
Are you using the OgreXML loader? Does the .material file reference the textures you have in the folder?
Ogre material loading still doesn’t work. I just tried half an hour with manual editing the .material file manually. I always get these errors:
“Unsupported pass directive”
Seems like you cannot import Orge materials at all - only import meshes and then create a .j3m file manually or with the SDK’s material editor.
The materials only relevant info is the name of the texture, you can just apply that using a j3m file. XML materials work fine for me but obviously you cannot use extended material parameters as explained in the import tutorials. Just keep your 3D editor from applying the wrong settings to your model.