static Geometry findAnimatedGeometry(Spatial subtree) {
        Geometry result = null;
        if (subtree instanceof Geometry) {
            Geometry geometry = (Geometry) subtree;
            Mesh mesh = geometry.getMesh();
            VertexBuffer indices = mesh.getBuffer(VertexBuffer.Type.BoneIndex);
            boolean hasIndices = indices != null;
            VertexBuffer weights = mesh.getBuffer(VertexBuffer.Type.BoneWeight);
            boolean hasWeights = weights != null;
            if (hasIndices && hasWeights) {
                result = geometry;
            }

        } else if (subtree instanceof Node) {
            Node node = (Node) subtree;
            List<Spatial> children = node.getChildren();
            for (Spatial child : children) {
                result = findAnimatedGeometry(child);
                if (result != null) {
                    break;
                }
            }
        }

        return result;
    }
Find an animated geometry in the specified subtree of the scene graph.
Note: recursive!

@param subtree where to search (not null, unaffected)
@return a pre-existing instance, or null if none
jme3-jbullet/src/main/java/com/jme3/bullet/animation/RagUtils.java