Import .blend directly to SDK

Hi monkeys,



I’m trying to import a uv-mapped, and textured cube into the SDK. During the import process in the preview I can see it, just fine. But when I’m trying to convert the model to a .j3o I get the following error:



java.lang.NullPointerException

at com.jme3.scene.plugins.blender.textures.TextureHelper.getTexture(TextureHelper.java:140)

at com.jme3.scene.plugins.blender.materials.MaterialContext.(MaterialContext.java:132)

at com.jme3.scene.plugins.blender.materials.MaterialHelper.toMaterialContext(MaterialHelper.java:170)

at com.jme3.scene.plugins.blender.materials.MaterialHelper.getMaterials(MaterialHelper.java:340)

at com.jme3.scene.plugins.blender.meshes.MeshHelper.toMesh(MeshHelper.java:273)

at com.jme3.scene.plugins.blender.objects.ObjectHelper.toObject(ObjectHelper.java:158)

at com.jme3.scene.plugins.blender.AbstractBlenderLoader.toObject(AbstractBlenderLoader.java:132)

at com.jme3.scene.plugins.blender.BlenderLoader.toObject(BlenderLoader.java:70)

at com.jme3.scene.plugins.blender.BlenderModelLoader.load(BlenderModelLoader.java:63)

at com.jme3.scene.plugins.blender.BlenderModelLoader.load(BlenderModelLoader.java:49)

at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:282)

at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:410)

[catch] at com.jme3.gde.core.assets.SpatialAssetDataObject.loadAsset(SpatialAssetDataObject.java:90)

at com.jme3.gde.core.assets.actions.ConvertModel$1.run(ConvertModel.java:63)

at java.lang.Thread.run(Thread.java:662)



I have read somewhere, that the BlenderLoader or the BlenderModelLoader, was removed from the path, but I was wondering if this was the reason for this error ?



and if it is, where can I find the option so I can add it to the path again :slight_smile:

That doesn’t have to do anything with the path… How do you apply your texture? You cannot pack it into the blend file and it has to be in the same relative location in the assets folder. So best save your model in the assets folder directly and save the texture in the assets folder as well (when you edit and apply it in blender). This makes sure the image can be found in the engine and in blender. See the asset pipeline documentation in the wiki.

1 Like

Thanks worked like a charm to change the texture, to be in a relative path :slight_smile: