Hi

I tried to generate lod on a model imported with xbuf. but it did not generate.(tried both in SDK and code). **it generate OK if i import it directly from .blend —> .j3o**

So i decided to generate LOD in blender using “Decimate” modifier.

I generated two LODs then imported them along with my main model to JME.

And set them using `mainGeometry.getMesh().setLodLevels(vertexBuffer);`

but the result is strange :

here is main model with lod_0 (model’s original index buffer)

wit lod_1

with lod_2

here is how it looks like in blender

here is code :

```
public static Node loadModel(ModelKey key, AssetManager assetmgr) {
Node model = (Node) assetmgr.loadModel(key);
if(model.getChild("LOD") != null){
System.out.println("found LOD");
//This is the node i have all lods for my model loaded from blender
Node modelLODsNode=(Node) model.getChild("LOD");
modelLODsNode.removeFromParent();
SceneGraphVisitor visitor = new SceneGraphVisitor() {
@Override
public void visit(Spatial spatial) {
if (spatial instanceof Geometry) {
Geometry geometry=(Geometry) spatial;
//Create an array of buffer to save LODs
VertexBuffer vbuf[]=new VertexBuffer[3]; //mode has 2 lods with it's main mesh
//vbuf[0] keeps model's main index buffer
vbuf[0]=geometry.getMesh().getBuffer(VertexBuffer.Type.Index);
for(int i=1;i<3;i++){
//Getting lod levels from modelLODsNode
Spatial lod= modelLODsNode.getChild(geometry.getParent().getName()+"lod"+i);
if(lod!=null){
Geometry lodMesh=(Geometry) ((Node)lod).getChild(0);
//Getting lod index buffer
vbuf[i]=(lodMesh.getMesh().getBuffer(VertexBuffer.Type.Index));
System.out.println("set lod level"+i+"to: "+spatial.getName());
}
}
//setting lods to main geometry
geometry.getMesh().setLodLevels(vbuf);
geometry.setLodLevel(1);
geometry.updateModelBound();
geometry.getMesh().updateCounts();
}
}
};
model.depthFirstTraversal(visitor);
}
return model;
}
```

Model download link :

https://drive.google.com/open?id=0B35eWZpi0dBoNlVwZjA3S21rOVE

Can you please help