NullPointerException loading ColladaSkinNode

Hi everybody,



JME version 1.0pre works nice. The XML-stuff is canceled. Time to switch to collada-stuff. And… Error…



I try to load a collada-model exported from blender and the latest exporter given by illusoft.



The code is the same as in TestColladaLoading:



ResourceLocatorTool.addResourceLocator(
                    ResourceLocatorTool.TYPE_TEXTURE,
                    new SimpleResourceLocator(TestObjectLoading.class
                            .getClassLoader().getResource(
                                    "models/")));

InputStream mobboss = getClass().getClassLoader()
                    .getResourceAsStream("models/bonecube.dae");

ColladaImporter.load(mobboss, "newModel");

SkinNode sn = ColladaImporter.getSkinNode(ColladaImporter.getSkinNodeNames().get(0));
Bone skel = ColladaImporter.getSkeleton(ColladaImporter.getSkeletonNames().get(0));

rootNode.attachChild(sn);
rootNode.attachChild(skel);



and it throws a NullPointerException in line SkinNode sn = ColladaImporter.getSkinNo....
Log:
27.08.2007 14:40:41 com.jmex.model.collada.ColladaImporter load
INFO: Version: 1.4.0
27.08.2007 14:40:41 com.jme.scene.Node <init>
INFO: Node created.
27.08.2007 14:40:41 com.jme.scene.Node <init>
INFO: Node created.
27.08.2007 14:40:41 com.jmex.model.collada.ColladaImporter processNode
WARNUNG: Bone CubeBone is not attached to any vertices.
27.08.2007 14:40:41 com.jme.scene.Node attachChild
INFO: Child (CubeBone) attached to this node (Scene)
27.08.2007 14:40:41 com.jme.scene.Node <init>
INFO: Node created.
27.08.2007 14:40:41 com.jme.scene.Node attachChild
INFO: Child (Cube) attached to this node (Scene)
27.08.2007 14:40:41 com.jme.scene.SharedMesh reconstruct
INFO: SharedMesh will ignore reconstruct.
27.08.2007 14:40:41 com.jme.scene.Node attachChild
INFO: Child (Cube-Geometry) attached to this node (Cube)
27.08.2007 14:40:41 com.jme.scene.Node detachChildAt
INFO: Child removed.
27.08.2007 14:40:41 com.jme.scene.Node attachChild
INFO: Child (CubeBone) attached to this node (Scene)
27.08.2007 14:40:41 com.jme.scene.Node detachChildAt
INFO: Child removed.
27.08.2007 14:40:41 com.jme.scene.Node attachChild
INFO: Child (CubeBone) attached to this node (Scene)
27.08.2007 14:40:41 com.jme.scene.Node attachChild
INFO: Child (Scene) attached to this node (newModel)
27.08.2007 14:40:41 com.jme.util.geom.GeometryTool minimizeVerts
INFO: batch: Cube-Geometry: Batch 0 old: 36 new: 24
java.lang.NullPointerException
at de.mistudios.test.TestObjectLoading.createObjects(TestObjectLoading.java:117)
at de.mistudios.test.TestObjectLoading.simpleInitGame(TestObjectLoading.java:73)
at com.jme.app.BaseSimpleGame.initGame(Unknown Source)
at com.jme.app.SimplePassGame.initGame(Unknown Source)
at com.jme.app.BaseGame.start(Unknown Source)
at de.mistudios.test.TestObjectLoading.main(TestObjectLoading.java:35)
27.08.2007 14:40:43 com.jme.app.BaseSimpleGame cleanup


The object is a simple textured cube with a bone and no animations.

File + texture:
http://mi-studios.de/index.php?option=com_docman&task=cat_view&gid=20&Itemid=34

u = ColladaImporter.getModel();

rootNode.attachChild(u);



it works... why???  :roll:

I'm confused with skin and bone in collada.  :?

The model has a bone and skin.

Blender’s collada exporter does still not have full support for skeletal animation.

Read http://www.jmonkeyengine.com/jmeforum/index.php?topic=5226.0 for some information on the matter.

You’ll need fungi’s patched ColladaImporter, which then has to be adjusted to work with the new logging system, and a minor change in the collada framework itself.

Here is a patched ColladaImporter which works with the latest cvs jME.

Esp. note that you have to convert the mesh’s armature transform from a  “virtual” to a “real” one before exporting, and that the bones cannot have “.” and possibly other characters in their names.

Also, I got the best (but still no reliable) results so far by assigning at least one keyframe containing locational information for all bones.

What was patched?  If there's a bug there's no reason not to fix it officially.

Fungi said:

there are still lots of debugging outputs all over it, when i'm finished i'll give you the changes


AFAIK, fungi didn't get around to clean up the code enough to make it into the engine before the "big commit" came.

THX!!!



For static Objects it works fine!



I try this Fix later this week.


I get another problem with my models :wink:



Blender works with Z-Axis as UP and the exported dae-file contains this correctly:


<up_axis>Z_UP</up_axis>



IT's any reason to convert it into JME's worldspace with Y as UP-axis?

The model should still be in Z Up after import, you can either edit your Camera to use Z up as well, or rotate the model to be in Y Up.

fbx exporter



http://projects.blender.org/plugins/scmsvn/viewcvs.php/trunk/blender/release/scripts/export_fbx.py?revision=HEAD&root=bf-blender&pathrev=HEAD



wiki entry including link to fbx converter tool



http://wiki.blender.org/index.php/Scripts/Manual/Export/autodesk_fbx#Interoperability



a good to know:



Quick update, I almost have everything working.


  1. The Blender file needs to have a material assigned in order not to crash the FBX converter.


  2. Scale has to be set to 1 in order to avoid incorrect mesh deforming.





    rest of thread where i got this:



    http://blenderartists.org/forum/showthread.php?goto=newpost&t=92082



    forum features dont seem to be working for me today, to tired to find out why, so sorry from the lack of formating



    …back to the spreadsheets :frowning:

that should be fbx collada can't edit forum issues again

THX, i test it soon



P.S.



It's nice to have to get the collada-model up-axis from the ColladaImporter for simple convertions into the current scene.

BlackBluegL said:

THX, i test it soon

P.S.

It's nice to have to get the collada-model up-axis from the ColladaImporter for simple convertions into the current scene.


just keep an eye on the development thread, the process isn't quite "refined" yet problems might still come up