Engines/FlatRedBallXNA/FlatRedBall.Content/ModelAnimation/X File/XModelImporter.cs
/// <summary>
/// Imports the root and animation data associated with it
/// </summary>
Imports the root and animation data associated with it
Imports the root and animation data associated with it
private void ImportRoot()
        {
            if (!tokens.AtEnd)
            {
                do
                {
                    string next = tokens.NextToken();
                    if (next == "Frame")
                        if (root == null)
                        {
                            root = ImportNode();
                            root.Identity = new ContentIdentity();
                            root.Identity.SourceFilename = fileName;
                            root.Identity.SourceTool = this.GetType().ToString();
                        }
                        else
                        {
                            root.Children.Add(ImportNode());
                        }
                    else if (next == "AnimTicksPerSecond")
                    {
                        animTicksPerSecond = tokens.SkipName().NextInt();
                        tokens.SkipToken();
                    }
                    else if (next == "AnimationSet")
                        ImportAnimationSet();
                    else if (next == "Material")
                        ImportMaterial();
                    else if (next == "template")
                        tokens.SkipName().SkipNode();
                    else if (next == "AnimationLibOptions")
                    {
                        tokens.SkipName();
                        int numOptions = tokens.NextInt();
                        for (int i = 0; i < numOptions; i++)
                        {
                            string animationOption = tokens.NextString();
                            animationOptions.Add(animationOption);
                        }
                        tokens.SkipToken().SkipToken();
                    }
                }
                while (!tokens.AtEnd);
            }
        }
private void ImportRoot ( ) { if ( ! tokens . AtEnd ) { do { string next = tokens . NextToken ( ) ; if ( next == " " ) if ( root == null ) { root = ImportNode ( ) ; root . Identity = new ContentIdentity ( ) ; root . Identity . SourceFilename = fileName ; root . Identity . SourceTool = this . GetType ( ) . ToString ( ) ; } else { root . Children . Add ( ImportNode ( ) ) ; } else if ( next == " " ) { animTicksPerSecond = tokens . SkipName ( ) . NextInt ( ) ; tokens . SkipToken ( ) ; } else if ( next == " " ) ImportAnimationSet ( ) ; else if ( next == " " ) ImportMaterial ( ) ; else if ( next == " " ) tokens . SkipName ( ) . SkipNode ( ) ; else if ( next == " " ) { tokens . SkipName ( ) ; int numOptions = tokens . NextInt ( ) ; for ( int i = 0 ; i < numOptions ; i ++ ) { string animationOption = tokens . NextString ( ) ; animationOptions . Add ( animationOption ) ; } tokens . SkipToken ( ) . SkipToken ( ) ; } } while ( ! tokens . AtEnd ) ; } }
Imports the root and animation data associated with it
Imports the root and animation data associated with it
// Read all tokens in the file // If nodes are found in the same scope as the root, add them // as children because the Model class only supports one root // frame //template AnimTicksPerSecond // { //     DWORD AnimTicksPerSecond; // }  // See ImportAnimationSet for template info