private Batch findBatchByMaterial(Material m) {
        for (Batch batch : batches.getArray()) {
            if (batch.geometry.getMaterial().contentEquals(m)) {
                return batch;
            }
        }
        return null;
    }
recursively visit the subgraph and unbatch geometries

@param s
jme3-core/src/main/java/com/jme3/scene/BatchNode.java