spatialNodesNames.add(noc.name); spatialNodes.add(spatial);  } else if (noc.whatIAm instanceof LightChunk){ spatialLights.add(createChildLight((LightChunk)noc.whatIAm));
    private void buildObject() throws IOException {        spatialNodes=new ArrayList();   // An ArrayList of Nodes        spatialLights=new ArrayList();        spatialNodesNames=new ArrayList();   // Their names        Map nodesByID = new HashMap(); // Map Short -> Node        if ( keyframes != null ) {            for (Iterator it = keyframes.objKeyframes.entrySet().iterator(); it.hasNext();) {                Map.Entry entry = (Map.Entry) it.next();                String name = (String) entry.getKey();                if( !objects.namedObjects.containsKey( name ) ) {                    KeyframeInfoChunk info = (KeyframeInfoChunk) entry.getValue();                    Node node = new Node( info.name );                    nodesByID.put( new Short( info.myID ), node );                    spatialNodesNames.add(name);                    spatialNodes.add(node);                }            }        }        for (Iterator it =objects.namedObjects.entrySet().iterator(); it.hasNext(); ){            Map.Entry entry = (Map.Entry) it.next();            String objectKey=(String) entry.getKey();            NamedObjectChunk noc=(NamedObjectChunk) entry.getValue();            if (noc.whatIAm instanceof TriMeshChunk){                Node myNode =new Node(objectKey);                Spatial spatial;                if (keyframes ==null || keyframes.objKeyframes==null || keyframes.objKeyframes.get(objectKey)==null) {                    putChildMeshes(myNode,(TriMeshChunk) noc.whatIAm,new Vector3f(0,0,0));                    spatial = usedSpatial(myNode);                } else {                    KeyframeInfoChunk kfInfo = (KeyframeInfoChunk) keyframes.objKeyframes.get(objectKey);                    putChildMeshes(myNode,(TriMeshChunk) noc.whatIAm,kfInfo.pivot);                    spatial = usedSpatial(myNode);                    if ( kfInfo.parent != -1 ) {                        Node parentNode = (Node) nodesByID.get( new Short( kfInfo.parent ) );                        if ( parentNode != null ) {                            parentNode.attachChild( spatial );                        } else {                            throw new JmeException("Parent node (id="+kfInfo.parent+") not foudn!" );                        }                    }                }                spatialNodesNames.add(noc.name);                spatialNodes.add(spatial);            } else if (noc.whatIAm instanceof LightChunk){                spatialLights.add(createChildLight((LightChunk)noc.whatIAm));            }        }    }