I compiled the SDK (today 02/11/2017) with the master branch and I try to convert a GLTF file to J3o in the SDK but an error appears:
java.lang.ClassCastException: com.jme3.asset.AssetKey can not be cast to com.jme3.asset.ModelKey
at com.jme3.gde.blender.GLTFDataObject.getAssetKey (GLTFDataObject.java:94)
at com.jme3.gde.core.assets.SpatialAssetDataObject.loadAsset (SpatialAssetDataObject.java:94)
at com.jme3.gde.core.assets.actions.ConvertModel $ 1.run (ConvertModel.java:65)
at java.lang.Thread.run (Thread.java:748)
I used the box.gltf file contained in the resources
My question is it currently possible to convert GLTF files with the master branch of the SDK ?
I copied the box.gltf and box.bin files into my asset directory of my project.
When I create my own models with Blender and I export the model with the Khronos script (with the material provided by Khronos), the same problem happens. On the other hand, using the spaceship editor, it works.
I hope I have compiled the SDK correctly. I followed the procedure on the Github site (I compiled the engine and then compiled the SDK). The SDK starts well with the command gradlew run.
That should be the right way, yeah. I have no clue why it didn’t work that way.
I however released a commit which might fix your issue, so it would be nice if you could try it
I just recompile and it works with many models but sometimes I still have this kind of error on some models:
java.lang.IllegalArgumentException: Key Models / bridge / bridge.bin specified no cache.
at com.jme3.asset.DesktopAssetManager.deleteFromCache (DesktopAssetManager.java:230)
at com.jme3.gde.core.assets.AssetDataObject.closeAsset (AssetDataObject.java:259)
at com.jme3.gde.core.assets.actions.ConvertModel $ 1.run (ConvertModel.java:68)
at java.lang.Thread.run (Thread.java:748)
Does this also happen in JMonkeyBuilder?
To me it looks like a clear engine bug, though, maybe triggered by gltf and the fact that noone usually closes their assets.
Reasoning behind that: AssetKeys getCacheType explictly specifies “return null if you want to disable caching”, however the DesktopAssetManager should not throw an Exception then, but rather return (like specified no cache, that’s fine).
Ok I’m doing this, but I just noticed that when the Buffer is integrated with the gltf file. The problem does not occur and the construction of the j3o file works.
When a * .bin file is created, then the exception appears.