Hey guys,
I’ve been trying to export models created in Blender 2.56 using blender2ogre converter found here. Has anyone tried it yet? Exporter seems to be frequently updated (last submission made January 6th).
I created a most basic shape in blender (default cube object with a grass texture on it), removed default lamp and camera and exported the scene. I got *.scene, *.mesh.xml and *.material files. I placed all of them as well as the grass texture .jpg file into my jMP project (jMonkeyPlatform Alpha-3, last updated Feb 17th). When I try to view .scene file (right click → view model), jMP says “Error opening *.scene” which seems to be caused by java Null pointer exception:
[java]java.lang.NullPointerException
at com.jme3.scene.plugins.ogre.SceneLoader.startElement(SceneLoader.java:190)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:626)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3103)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:922)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at com.jme3.scene.plugins.ogre.SceneLoader.load(SceneLoader.java:340)
at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:239)
at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:375)
at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:385)
at com.jme3.gde.core.assets.SpatialAssetDataObject.loadAsset(SpatialAssetDataObject.java:81)
at com.jme3.gde.core.assets.actions.OpenModel$1.run(OpenModel.java:72)
[catch] at java.lang.Thread.run(Thread.java:619)
[/java]
I tried tweaking mesh, scene and material files by removing details and trying to make it look more like default town.zip example (which I can load and view without any problems), but the best I could achieve was to display the cube with no texture (I am able to view just the cube mesh no problem, it’s the scene that fail to load).
Has anyone tried doing something similar? Or maybe you just have ideas how to fix this?
Any help would be greatly appreciated!
Can you post the contents of the .scene file here?
Here’s the contents of the .scene file:
[java]<?xml version=“1.0” ?>
<scene export_time=“1297987853.59” exported_by=“alex” previous_export_time=“0”>
<nodes>
<node name=“grassCube” uuid=“0b0beeab1aca29568d69702a903d2a89”>
<position x="-0.000000" y=“0.000000” z=“0.000000”/>
<quaternion w=“1.000000” x="-0.000000" y=“0.000000” z=“0.000000”/>
<scale x=“1.000000” y=“1.000000” z=“1.000000”/>
<game>
<sensors/>
<actuators/>
</game>
<entity actor=“False” anisotropic_friction=“False” damping_rot=“0.158999994397” damping_trans=“0.025399999693” friction_x=“1.0” friction_y=“1.0” friction_z=“1.0” ghost=“False” inertia_tensor=“0.40000000596” lock_rot_x=“False” lock_rot_y=“False” lock_rot_z=“False” lock_trans_x=“False” lock_trans_y=“False” lock_trans_z=“False” mass=“1.0” mass_radius=“1.0” meshFile=“Cube.mesh” name=“Cube” physics_type=“STATIC” velocity_max=“0.0” velocity_min=“0.0”/>
</node>
</nodes>
<externals>
<item type=“material”>
<file name=“Scene.material”/>
</item>
</externals>
<environment>
<colorDiffuse b=“0.0508760884404” g=“0.0508760884404” r=“0.0508760884404”/>
<colorBackground b=“0.0508760884404” g=“0.0508760884404” r=“0.0508760884404”/>
<colorAmbient b=“0.0” g=“0.0” r=“0.0”/>
</environment>
</scene>
[/java]
TIA
just curious, what version do you use? I just cant run addon_ogreDotScene-0.3.0.zip with 2.56…
I was using 2.56a, whatever latest version available from blender website. I had problems with initially on Windows 7 64 bit, but then I switched to Ubuntu and it seemed to work there (both 32 and 64 bit). What kind of OS are you running and what kind of trouble are you having with it? Python errors when trying to export?
Try installing a current python version.
I found no ogre exporter for blender 2.55 when i started my project 2 months ago so I started using blender 2.49 instead and I can export models just fine on windows and ubuntu. I had no prior experience with blender and now I am used to 2.49. Perhaps I should upgrade to 2.56 if the exporter is working.
As soon as the import path blender 2.5 → jME3 is working properly we will move to that import path. So for all who dont want to do the research we will.
Just importing meshes works perfectly fine (or so it seems). It’s the scenes and materials what’s causing trouble.
Blender2Ogre exporter seems to be functioning properly. So I was wondering if maybe there are limitations in jMP that have to do with different version of OgreXML format? Is there details documentation on the import model from OgreXML?
There is detailed information on how to import models from blender, yes look at the bottom of the HelloAssets tutorial for a link to a PDF detailing everything you need to know. The Ogre exporter itself also has a help button that tells you which material settings can be exported (remember Blender is for static rendering while jME3 is a game engine displaying everything in real time).
I guess I was asking more along the lines of exact format of .scene XML file.
For example, entity element of .scene XML file (child of node element) that I got from blender2ogre 2.56 contains a whole bunch of attributes:
[java] <entity actor=“False” anisotropic_friction=“False” damping_rot=“0.10000000149” damping_trans=“0.0399999991059” friction_x=“1.0” friction_y=“1.0” friction_z=“1.0” ghost=“False” inertia_tensor=“0.40000000596” lock_rot_x=“False” lock_rot_y=“False” lock_rot_z=“False” lock_trans_x=“False” lock_trans_y=“False” lock_trans_z=“False” mass=“1.0” mass_radius=“1.0” meshFile=“Plane.mesh” name=“Plane” physics_type=“STATIC” velocity_max=“0.0” velocity_min=“0.0”/>
[/java]
while the town example only has name and meshFile attributes:
[java]<entity name=“level” meshFile=“level.mesh”/>[/java]
So I was wondering if there’s a conversion schema for jMP from OgreXML with a list of supported elements and attributes. The reason I’m asking is because if I simplify .scene file to only contain elements and attributes that town.scene file has then I am able to view the model in jMP. Texture mapping is still a problem though.