Converting External mesh to TriMesh

Hi everybody,

I'm trying to ani-morph my mesh (made with blender and exported to jme xml).

The code compiles smoothly but in runtime I get a ClassCastException when I try to cast Spatial (get from the loaded node) to Trimesh. Does anybody knows how to solve this issue??

:?

[glow=red,2,300]Thanx[/glow]





Here the code I use: (NodeImporter simply loads xml file and convert it to jme binary)


protected void simpleInitGame(){

You can't cast to TriMesh as the result is a Node. Most likely this Node even contains multiple TriMeshes, especially if it's animated.

You have to identify the actual mesh that you want to morph (jME does not support to morph entire Nodes, I think)