How to get all spatials with a certain control, then merge them?

I’ve already done a SceneGraphVisitor, and I have all the spatials I want in an array list. I want to merge all of their geometries into one mesh, but when I do this each geometry loses it’s scale and translation. The different parts I want to put together have varying scale and location so I’ve got no idea what to do. I’ve tried quite a few different things, including different ways of batching the geometry. Most ways return an exception (which I caught to be sure was caused by the batching) and the only one that doesn’t is GeometryBatchFactory.optimize(); but this is the one that fails to keep scale and translation. Any help here?

Edit: I’ve tried doing the following in the scene graph visitor:
[java]
ArrayList navGeomArray;
private SceneGraphVisitor sgv = new SceneGraphVisitor() {
@Override
public void visit(Spatial spatial) {
if (spatial.getControl(BuildingFractureControl.class) != null && !spatial.getControl(BuildingFractureControl.class).getIsFractured()) {
Geometry geom = findGeom(spatial, “”).clone();
geom.setLocalScale(spatial.getLocalScale());
geom.setLocalTranslation(spatial.getWorldTranslation());
navGeomArray.add(geom);
}
}
};
[/java]

But it outputs (0.0, 0.0, 0.0) as all of their locations and (1.0, 1.0, 1.0) as all of their local scales.

Another edit:
Most of my spatials are embedded in nodes. I found out that if I pass any time it finds a node and not a regular spatial, it never returns anything. So it seems like the scene graph visitor only visits nodes and not their spatials. I’ll have to iterate over the node’s children manually.

Edit 2: After trying that I get literally no different result whatsoever. This is quite irritating. Why does the scene graph visitor completely ignore the translation and scale of models? Or at least, why does it seem like this? Is there anything I can do so I can get the correct scale and translation?

You might want to look at BatchNode as it already takes transforms into consideration, etc. when batching.

@pspeed that was the first one I tried, and it gave me exceptions left and right. I got it working though. I did “GeometryBatchFactory.mergeGeometries(navGeomArray, meshOut);” and it worked perfectly.