for(int i = 0; i < node.getQuantity(); i++){
Spatial spatial = node.getChild(i);
if(spatial instanceof Geometry){
//Material material = new Material();
AssetManager assetManager = JmeSystem.newAssetManager(Thread.currentThread().getContextClassLoader().getResource("com/jme3/asset/Desktop.cfg"));
Material material = new Material(assetManager, "Common/MatDefs/Misc/SolidColor.j3md");
material.setColor("m_Color",color);
//Material geomMaterial = ((Geometry)spatial).getMaterial();
spatial.setMaterial(material);
System.out.println("Spatial: "+spatial.getName());
}else if(spatial instanceof Node){
setColor((Node)spatial,color);