Import Collada File with jme3dae.jar

Hi all,

i’m trying to import a collada file with jme3dae.jar but i’ve obtained this exception:



java.lang.NoSuchFieldError: Identity

at jme3dae.collada14.transformers.TransformationElementTransformer.transform(TransformationElementTransformer.java:45)

at jme3dae.collada14.transformers.SceneTransformer.parseNode(SceneTransformer.java:161)

at jme3dae.collada14.transformers.SceneTransformer.parseVisualScene(SceneTransformer.java:131)

at jme3dae.collada14.transformers.SceneTransformer.parseInstanceVisualScene(SceneTransformer.java:84)

at jme3dae.collada14.transformers.SceneTransformer.transform(SceneTransformer.java:61)

at jme3dae.collada14.ColladaDocumentV14.transform(ColladaDocumentV14.java:70)

at jme3dae.collada14.ColladaDocumentV14.transform(ColladaDocumentV14.java:30)

at jme3dae.ColladaLoader.load(ColladaLoader.java:41)

at jme3dae.ColladaLoader.load(ColladaLoader.java:18)

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

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

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

at codiceGoogle.Main.simpleInitApp(Main.java:45)

at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:231)

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(Unknown Source)



this is my code:



public void simpleInitApp() {

ColladaDocumentFactory.setFXEnhance(FXEnhancerInfo.create(

FXEnhancerInfo.NormalMapGenerator.OFF,

FXEnhancerInfo.TwoSidedMaterial.OFF,

FXEnhancerInfo.IgnoreMeasuringUnit.ON));



assetManager.registerLocator("", FileLocator.class.getName());

assetManager.registerLoader(jme3dae.ColladaLoader.class.getName(), “dae”);

Spatial gameLevel = assetManager.loadModel(“kitchen.dae”);

Material mat_default = new Material(

assetManager,“Common/MatDefs/Misc/ShowNormals.j3md”);

gameLevel.setMaterial(mat_default);

rootNode.attachChild(gameLevel);

}



is there a problem with jme3 or there is some errore in my code?

thank you very much for any help

steven88

It sounds like a bug in the COLLADA contribution. Your best bet is likely to grab the source code and follow the stack trace… The project’s original author left the project some time ago.



http://hub.jmonkeyengine.org/groups/user-code-projects/forum/topic/jme3-collada-loader/

Thank you for your help, i have already seen that link, but it doesn’t solve my problem. so i’ve tryed to use the old versione of jme, and i’ve used the code at this link:

http://code.google.com/p/jmonkeyengine/source/browse/trunk/src/jmetest/renderer/loader/TestColladaLoading.java?r=4711

but code works only with this model: “jmetest/data/model/collada/man.dae”

When i try it with an other collada file it doesn’t work; it can load file collada but it throws an exception at line 89. (java.lang.nullPointerException)

is it possible that there is a bug also in this case or i make a mistake?

thank you very much.

So you’re saying you went back to jME2 for Collada support? That’s kind of a big step backward!



The reason you’re seeing that NPE is probably that you don’t have a rig in your model. If you look at the source, you’ll see that it tries to get multiple parts of the COLLADA file. The dae parser for jME2 does work… We use it in production currently, though only for static assets.