try {
Geometry g;
// need to load vial loadModel, JME does not see obj, etc as
// Assets..
t.reset();
Spatial n = (Spatial) assetMan.loadModel(from.getAbsolutePath());
time = t.getTimeInSeconds();
System.out.println("File " + from.getAbsolutePath() + " loaded in "
+ time + " seconds");
if (n instanceof Geometry) {
g = (Geometry) n;
n = new Node(g.getName());
((Node)n).attachChild(g);
} else if (n instanceof Node) {
if (((Node) n).getChildren().size() > 1)
throw new Throwable(
"Mesh with more children detected than one on "
+ from.getName());
g = (Geometry) ((Node) n).getChild(0);
} else
throw new Throwable("Spatial loaded was unexpected type "
+ n.getClass());
// jme fucked up the model names, and ignores any object name
// entries so we fix a bit
String fName = from.getName().substring(0,
from.getName().length() - fileEnding.length());// without .nav
g.setName(fName.toLowerCase());