/// <summary>
        ///		Loads the mesh data.
        /// </summary>
        /// <summary>
        ///    Generic load, called by SkeletonManager.
        /// </summary>
        public override void Load()
        {
            if (isLoaded) {
                Unload();
                isLoaded = false;
            }

            skeletonLoadMeter.Enter();

            LogManager.Instance.Write("Skeleton: Loading '{0}'...", name);

            // load the skeleton file
            Stream data = SkeletonManager.Instance.FindResourceData(name);

            string extension = Path.GetExtension(name);

            if (extension == ".skeleton") {
                // instantiate a new skeleton reader
                OgreSkeletonSerializer reader = new OgreSkeletonSerializer();
                reader.ImportSkeleton(data, this);
            } else if (extension == ".xml") {
                // instantiate a new skeleton reader
                OgreXmlSkeletonReader reader = new OgreXmlSkeletonReader(data);
                reader.Import(this);
            } else {
                data.Close();
                throw new Exception("Unsupported skeleton file format '" + extension + "'");
            }
            data.Close();

            isLoaded = true;

            skeletonLoadMeter.Exit();
        }
 private static Skeleton ReadSkeleton( Matrix4 transform, string srcDir, string skelFile )
 {
     Stream skelData = new FileStream( srcDir + skelFile, FileMode.Open );
     Skeleton skeleton = new Skeleton( skelFile );
     if( skelFile.EndsWith( ".skeleton" ) )
     {
         OgreSkeletonSerializer skelReader = new OgreSkeletonSerializer();
         skelReader.ImportSkeleton( skelData, skeleton );
     }
     else if( skelFile.EndsWith( ".skeleton.xml" ) )
     {
         OgreXmlSkeletonReader skelReader = new OgreXmlSkeletonReader( skelData );
         skelReader.Import( skeleton );
     }
     else
     {
         skelData.Close();
         string extension = Path.GetExtension( skelFile );
         throw new AxiomException( "Unsupported skeleton format '{0}'", extension );
     }
     skelData.Close();
     return skeleton;
 }