@Override
    @SuppressWarnings("unchecked")
    public void write(JmeExporter ex) throws IOException {
        OutputCapsule out = ex.getCapsule(this);

        out.write(meshBound, "modelBound", null);
        out.write(vertCount, "vertCount", DEFAULT_VERT_COUNT);
        out.write(elementCount, "elementCount", DEFAULT_ELEMENT_COUNT);
        out.write(instanceCount, "instanceCount", DEFAULT_INSTANCE_COUNT);
        out.write(maxNumWeights, "max_num_weights", DEFAULT_MAX_NUM_WEIGHTS);
        out.write(mode, "mode", Mode.Triangles);
        out.write(collisionTree, "collisionTree", DEFAULT_COLLISION_TREE);
        out.write(elementLengths, "elementLengths", null);
        out.write(modeStart, "modeStart", null);
        out.write(pointSize, "pointSize", DEFAULT_POINT_SIZE);

        //Removing HW skinning buffers to not save them
        VertexBuffer hwBoneIndex = null;
        VertexBuffer hwBoneWeight = null;
        hwBoneIndex = getBuffer(Type.HWBoneIndex);
        if (hwBoneIndex != null) {
            buffers.remove(Type.HWBoneIndex.ordinal());
        }
        hwBoneWeight = getBuffer(Type.HWBoneWeight);
        if (hwBoneWeight != null) {
            buffers.remove(Type.HWBoneWeight.ordinal());
        }

        out.writeIntSavableMap(buffers, "buffers", null);

        //restoring Hw skinning buffers.
        if (hwBoneIndex != null) {
            buffers.put(hwBoneIndex.getBufferType().ordinal(), hwBoneIndex);
        }
        if (hwBoneWeight != null) {
            buffers.put(hwBoneWeight.getBufferType().ordinal(), hwBoneWeight);
        }

        out.write(lodLevels, "lodLevels", null);
        if (morphTargets != null) {
            out.writeSavableArrayList(new ArrayList(morphTargets), "morphTargets", null);
        }
    }
Get the index of the morph that has the given name.

@param morphName The name of the morph to search for
@return The index of the morph, or -1 if not found.
jme3-core/src/main/java/com/jme3/scene/Mesh.java