Xbox LIVE Indie Games
Sort Discussions: Previous Discussion Next Discussion
Page 1 of 1 (11 posts)

Weird XML error

Last post 5/4/2010 11:37 PM by Demipimp. 10 replies.
  • 5/1/2010 2:22 PM

    Weird XML error

    cant find R type and it points at my texture it also says in the warning some vertexs don't have textures
  • 5/1/2010 2:25 PM In reply to

    Re: Weird XML error

    Should I reinstall ?
  • 5/2/2010 1:37 AM In reply to

    Re: Weird XML error

    Demipimp:
    cant find R type and it points at my texture it also says in the warning some vertexs don't have textures

    I think you'll need to be a bit more descriptive to get any help. Try to explain what you are trying to do and post the exact error you are seeing and maybe some relevant code. I don't think you should need to reinstall, but since you don't give much information, how can we tell?
  • 5/2/2010 7:11 AM In reply to

    Re: Weird XML error

    Error   2   XML element "R" not found.   C:\Showcase\animation\animation\Content\sourceimages\Fox_Skin.jpg   1   323   animation




    I was trying to test my fox animation but to no anvil

    code#
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using Microsoft.Xna.Framework;
    using Microsoft.Xna.Framework.Audio;
    using Microsoft.Xna.Framework.Content;
    using Microsoft.Xna.Framework.GamerServices;
    using Microsoft.Xna.Framework.Graphics;
    using Microsoft.Xna.Framework.Input;
    using Microsoft.Xna.Framework.Media;
    using Microsoft.Xna.Framework.Net;
    using Microsoft.Xna.Framework.Storage;
    using SkinnedModel;
    namespace animation
    {
        /// <summary>
        /// This is the main type for your game
        /// </summary>
        public class Game1 : Microsoft.Xna.Framework.Game
        {
            GraphicsDeviceManager graphics;
            SpriteBatch spriteBatch;
            Model mrfox;
            SkinningData skd;
            AnimationPlayer animPlayer;
            public Game1()
            {

                graphics = new GraphicsDeviceManager(this);
                Content.RootDirectory = "Content";



            }

            /// <summary>
            /// Allows the game to perform any initialization it needs to before starting to run.
            /// This is where it can query for any required services and load any non-graphic
            /// related content.  Calling base.Initialize will enumerate through any components
            /// and initialize them as well.
            /// </summary>
            protected override void Initialize()
            {
                // TODO: Add your initialization logic here

                base.Initialize();
            }

            /// <summary>
            /// LoadContent will be called once per game and is the place to load
            /// all of your content.
            /// </summary>
            protected override void LoadContent()
            {
                // Create a new SpriteBatch, which can be used to draw textures.
                spriteBatch = new SpriteBatch(GraphicsDevice);
                
                

                // TODO: use this.Content to load your game content here

                mrfox = this.Content.Load<Model>("fbx/mrfox");
                skd = mrfox.Tag as SkinningData;
                animPlayer = new AnimationPlayer(skd);
                AnimationClip clip = skd.AnimationClips["Take 001"];
                animPlayer.StartClip(clip);
            }

            /// <summary>
            /// UnloadContent will be called once per game and is the place to unload
            /// all content.
            /// </summary>
            protected override void UnloadContent()
            {
                // TODO: Unload any non ContentManager content here
            }

            /// <summary>
            /// Allows the game to run logic such as updating the world,
            /// checking for collisions, gathering input, and playing audio.
            /// </summary>
            /// <param name="gameTime">Provides a snapshot of timing values.</param>
            protected override void Update(GameTime gameTime)
            {
                // Allows the game to exit
                if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
                    this.Exit();

                // TODO: Add your update logic here
                animPlayer.Update(gameTime.ElapsedGameTime, true, Matrix.Identity);
                base.Update(gameTime);
            }

            /// <summary>
            /// This is called when the game should draw itself.
            /// </summary>
            /// <param name="gameTime">Provides a snapshot of timing values.</param>
            protected override void Draw(GameTime gameTime)
            {

                GraphicsDevice.Clear(Color.CornflowerBlue);
                Matrix view, projection;
                Matrix[] bones;
                bones = animPlayer.GetSkinTransforms();

                view = Matrix.CreateLookAt(new Vector3(0, 0, 500),
                                Vector3.Zero, Vector3.Up)
                       * Matrix.CreateTranslation(new Vector3(0, -100, 0));
                projection = Matrix.CreatePerspectiveFieldOfView(
                    MathHelper.PiOver4,00, 1, 10000);


                // TODO: Add your drawing code here
                foreach (ModelMesh mesh in mrfox.Meshes)
                {
                    foreach (Effect effect in mesh.Effects)
                    {
                        effect.Parameters["Bones"].SetValue(bones);
                        effect.Parameters["View"].SetValue(view);
                        effect.Parameters["Projection"].SetValue(projection);
                    }
                    mesh.Draw();
                }

                
                
                base.Draw(gameTime);
            }
        }
    }









    #endcode
  • 5/2/2010 8:18 AM In reply to

    Re: Weird XML error

    Answer
    Reply Quote
    load the texture up in your favorite editor and save it as a png.

    then change the texture in the 3d file, either in your editor or if you are using a text based format (.X,.FBX) just edit the 3d object in a text editor

    The only time I have seen this before it was a versioning problem in the jpg encoder.

  • 5/2/2010 8:34 AM In reply to

    Re: Weird XML error

    What items do you have included in your Content project?  And what processors do you have set on them (check by right clicking on them and selecting Properties)?


    Also, this isn't going to be a solution to the problem you're seeing right now, but this line will give you problems:

                projection = Matrix.CreatePerspectiveFieldOfView(
                    MathHelper.PiOver4,00, 1, 10000);

    You can't have an aspect ratio of 0.  You'll want to change it to this:

                projection = Matrix.CreatePerspectiveFieldOfView(
                    MathHelper.PiOver4, GraphicsDevice.Viewport.AspectRatio, 1, 10000);


  • 5/3/2010 10:28 PM In reply to

    Re: Weird XML error

    The png thing fixed it thx

    @ Bob Taco total over looked that thx
  • 5/4/2010 12:42 AM In reply to

    Re: Weird XML error

    Dude, you marked your own post as the Answer. Why not give credit to Stainless, the guy who actually told you how to fix it?
  • 5/4/2010 12:53 AM In reply to

    Re: Weird XML error

    Done. Not that he would have gotten credit for marking his own post. :\
  • 5/4/2010 11:35 PM In reply to

    Re: Weird XML error

    Roonda:
    Dude, you marked your own post as the Answer. Why not give credit to Stainless, the guy who actually told you how to fix it?
    Sorry I just thought tha your suppose to mark any answer period thx for the info I'm new here and just learning Big ups to stainless I wasn't trying any funny busy I'll change it now :)
  • 5/4/2010 11:37 PM In reply to

    Re: Weird XML error

    did someone change it for me if so thx
Page 1 of 1 (11 posts) Previous Discussion Next Discussion