@Override
    public void endElement(String uri, String name, String qName) {
        if (ignoreUntilEnd != null) {
            if (ignoreUntilEnd.equals(qName)) {
                ignoreUntilEnd = null;
            }
            return;
        }


        // If submesh hack is enabled, ignore any submesh/submeshes
        // end tags.
        if (qName.equals("submesh") && !submeshNamesHack) {
            usesBigIndices = false;
            geom = null;
            mesh = null;
        } else if (qName.equals("submeshes") && !submeshNamesHack) {
            // IMPORTANT: restore shared mesh, for use with shared bone weights
            geom = null;
            mesh = sharedMesh;
            usesSharedVerts = false;
        } else if (qName.equals("faces")) {
            if (ib != null) {
                ib.flip();
            } else {
                sb.flip();
            }

            vb = null;
            ib = null;
            sb = null;
        } else if (qName.equals("vertexbuffer")) {
            fb = null;
            vb = null;
        } else if (qName.equals("geometry")
                || qName.equals("sharedgeometry")) {
            // finish writing to buffers
            for (VertexBuffer buf : mesh.getBufferList().getArray()) {
                Buffer data = buf.getData();
                if (data.position() != 0) {
                    data.flip();
                }
            }
            mesh.updateBound();
            mesh.setStatic();

            if (qName.equals("sharedgeometry")) {
                geom = null;
                mesh = null;
            }
        } else if (qName.equals("lodfacelist")) {
            sb.flip();
            vb = null;
            sb = null;
        } else if (qName.equals("levelofdetail")) {
            endLevelOfDetail();
        } else if (qName.equals("boneassignments")) {
            endBoneAssigns();
        } else if (qName.equals("submeshnames")) {
            // Restore default handling for "submesh" tag.
            submeshNamesHack = false;
        }
    }
Normalizes weights if needed and finds largest amount of weights used for
all vertices in the buffer.
jme3-plugins/src/ogre/java/com/jme3/scene/plugins/ogre/MeshLoader.java