Allright. It has been a lot harder than I had thought. I have tried pretty much everything I can imagine, so now I’m asking help… Here is what I have already tried:
Just use jme3-blender?
Nope. The importer crashes when loading a model from Blender 2.7.7 with following error message: Caused by: java.io.IOException: Unexpected importer exception occured: The pointer points to nothing!
at com.jme3.scene.plugins.blender.BlenderLoader.load(BlenderLoader.java:223)
at com.jme3.scene.plugins.blender.BlenderLoader.load(BlenderLoader.java:88)
at com.jme3.asset.DesktopAssetManager.loadLocatedAsset(DesktopAssetManager.java:259)
… 12 more
Caused by: java.lang.NullPointerException: The pointer points to nothing!
at com.jme3.scene.plugins.blender.file.Pointer.fetchData(Pointer.java:87)
at com.jme3.scene.plugins.blender.animations.AnimationHelper.getTracks250(AnimationHelper.java:237)
at com.jme3.scene.plugins.blender.animations.AnimationHelper.getTracks(AnimationHelper.java:206)
at com.jme3.scene.plugins.blender.animations.AnimationHelper.loadAnimations(AnimationHelper.java:57)
at com.jme3.scene.plugins.blender.BlenderLoader.load(BlenderLoader.java:97)
… 14 more
And to make it worse, Blender 2.6.x doesn’t open that model correctly.
Use xbuf?
Xbuf exporter seems to work, but jME xbuf loader doesn’t: java.lang.NoSuchMethodError: xbuf_ext.CustomParams.registerAllExtensions(Lcom/google/protobuf/ExtensionRegistryLite;)V
at jme3_ext_xbuf.Xbuf.setupExtensionRegistry(Xbuf.java:77)
at jme3_ext_xbuf.Xbuf.(Xbuf.java:68)
at jme3_ext_xbuf.XbufLoader.load(XbufLoader.java:25)
at com.jme3.asset.DesktopAssetManager.loadLocatedAsset(DesktopAssetManager.java:259)
at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:373)
at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:416)
at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:420)
at com.ritualsoftheold.client.ClientPlayer.initialize(ClientPlayer.java:71)
at com.ritualsoftheold.client.state.IngameAppState.initialize(IngameAppState.java:51)
at com.jme3.app.state.AppStateManager.initializePending(AppStateManager.java:251)
at com.jme3.app.state.AppStateManager.update(AppStateManager.java:281)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:236)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:151)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:193)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:232)
at java.lang.Thread.run(Thread.java:745)
Ouch. Apparently it misuses Protobuf API. If I didn’t use Gradle to add it as dependency, I’d think I had wrong version of Protobuf in classpath.
OgreXML?
Blender OgreXML exporter does not create scenes or meshes that jME could import. Materials are missing… Exporter isn’t probably compatible with Blender 2.7.7.
Wavefront obj?
Not an option, since animation support is needed.
You are doing something wrong here!
Ogre should work without any problems, but it could be that, you have to rename the material, that’s why the message “Material missing” is showed up. For example you have the file “mymodel.mesh.xml” then your material file must have the name “mymodel.material”.
Please try it again and tell me if it works or not.
Ogre exporter from Blender is telling me that it couldn’t find any materials, and I have confirmed with 3D artist that everything should be correct in the model.
I’ll check with him again, just in case we missed something.
and finally assetManager.registerLoader(XbufLoader.class, "xbuf");
Also you may want to watch these tutorials for importing animated models to jme
Edit: If you do not want to bother with steps above, you can download JME SDK and convert your .xbuf model directly to .j3o by right clicking on it and “convert to j3o”.
Hmm, another issue here. I baked animations in Blender, then exported to OgreXML, then tried to convert to j3o again… java.lang.IllegalArgumentException: for uniform m_BoneMatrices: value cannot be null
at com.jme3.shader.Uniform.setValue(Uniform.java:210)
at com.jme3.material.Material.updateShaderMaterialParameters(Material.java:806)
at com.jme3.material.Material.preload(Material.java:846)
at com.jme3.renderer.RenderManager.preloadScene(RenderManager.java:665)
at com.jme3.renderer.RenderManager.preloadScene(RenderManager.java:656)
at com.jme3.animation.SkeletonControl.testHardwareSupported(SkeletonControl.java:164)
at com.jme3.animation.SkeletonControl.controlRender(SkeletonControl.java:282)
at com.jme3.scene.control.AbstractControl.render(AbstractControl.java:135)
at com.jme3.scene.Spatial.runControlRender(Spatial.java:757)
at com.jme3.renderer.RenderManager.renderSubScene(RenderManager.java:723)
at com.jme3.renderer.RenderManager.renderSubScene(RenderManager.java:733)
at com.jme3.renderer.RenderManager.renderSubScene(RenderManager.java:733)
at com.jme3.renderer.RenderManager.renderSubScene(RenderManager.java:733)
at com.jme3.renderer.RenderManager.renderSubScene(RenderManager.java:733)
at com.jme3.renderer.RenderManager.renderSubScene(RenderManager.java:733)
at com.jme3.renderer.RenderManager.renderSubScene(RenderManager.java:733)
at com.jme3.renderer.RenderManager.renderScene(RenderManager.java:712)
at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:1086)
at com.jme3.renderer.RenderManager.render(RenderManager.java:1145)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:253)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:151)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:193)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:232)
at java.lang.Thread.run(Thread.java:745)
It looks like something went wrong… Note that this does not happen when I load the model, instead it happens at update tick. Animations might work, but rest of model doesn’t!
Recently I found out that there has been an update on FBX importer. I haven’t yet tested that extensively, but initially it complained about not having triangulated meshes after I had done exactly that in Blender. I still need to check with the 3D artist of this model to see if I did something wrong.
Note that this is a scene; there are clothing+hairstyles available, but they are now hidden (character is naked). There are also multiple animations (walk, run, sit), which should work on jME.
Note that I’m no 3D modelling expert; I have no idea if there is something really stupid there. The modeller who did this was confident that he had followed instructions, but I’m not sure if this page is up to date.
This .blend is not triangulated, but I have ran all tests with a copy that was, too. It did not seem to affect anything.
@david_bernard_31 There are two issues with xbuf. First, some textures do not appear to be working - they do work if I use OgreXML. Second, animations do not appear to exist for jME.
Your blender file looks like a mess. In my opinion the problematics you are facing are related to the non following of some standards for JME compliant models.
One of the problematics for example would be applying rotation, scale and location. Animations exist under node named “Body”, however they don’t play correctly because of the models problematics.
Yes, blender file looks like a mess.
There are more than one Armature modifier for each mesh. (There should be just one otherwise you will get some bunch of errors when loading in JME).
Also Scale of rig is not applied (it is 0.15). You should apply Scale/Location first, before adding any animation. Applying Scale now (after adding animation) will screw up all scale keyframes and you will have hard time fixing them in Graph Editor.