private Node compileModel() {
        Node model = new Node(meshName + "-ogremesh");

        for (int i = 0; i < geoms.size(); i++) {
            Geometry g = geoms.get(i);
            Mesh m = g.getMesh();

            // New code for buffer extract
            if (sharedMesh != null && usesSharedMesh.get(i)) {
                m.extractVertexData(sharedMesh);
            }

            model.attachChild(geoms.get(i));
        }

        // Do not attach shared geometry to the node!

        if (animData != null) {
            // This model uses animation

            for (int i = 0; i < geoms.size(); i++) {
                Geometry g = geoms.get(i);
                Mesh m = geoms.get(i).getMesh();
                m.generateBindPose();
            }

            // Put the animations in the AnimControl
            HashMap<String, AnimClip> anims = new HashMap<>();
            ArrayList<AnimClip> animList = animData.anims;
            for (int i = 0; i < animList.size(); i++) {
                AnimClip anim = animList.get(i);
                anims.put(anim.getName(), anim);
            }

            AnimComposer composer = new AnimComposer();
            for (AnimClip clip : anims.values()) {
                composer.addAnimClip(clip);
            }
            model.addControl(composer);

            // Put the skeleton in the skeleton control
            SkinningControl skinningControl = new SkinningControl(animData.armature);

            // This will acquire the targets from the node
            model.addControl(skinningControl);
        }

        return model;
    }
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