XNA Creators Club Online
Page 1 of 1 (9 items)
Sort Posts: Previous Next

Cannot "find" model file issue...

Last post 11/9/2007 9:38 PM by Shawn Hargreaves. 8 replies.
  • 11/8/2007 2:28 PM

    Cannot "find" model file issue...

    Hi,

     

    After getting everything set up and running I attempted to run my way through the "Going Beyond" tutorials. On the first exercise, I grabbed the model and texture and placed them in the appropriate locations. It compile's with no errors. When run, it attempts to grab my model from the given extension and says "this file does not exists". When infact it does. On my solution explorer the .fbx file displays as a blank generic "text" file, unlike the video where it displays as a system file of sorts. I am running Vista, but have applied the reccomended SP1 and Vista SP1 for the game studio. I know for a fact the model file is in the declared location, but it says it isn't.

     

     

    I did all load operations with the solution explorer in the IDE. I am thinking it has something to do with the fact that my file is showing as an "open with" file instead of the file type like in the tutorial video. Hopefully someone has an answer to this because I would like to move on to learning more about this platform without a trivial issue like this holding me back...

     

    Model myModel;

    float aspectRatio;

    protected override void LoadGraphicsContent(bool loadAllContent)

    {

    if (loadAllContent)

    {

    myModel = content.Load<Model>("\\Content\\Models\\p1_wedge");

     

    aspectRatio = graphics.GraphicsDevice.Viewport.Width /

    graphics.GraphicsDevice.Viewport.Height;

    }

    // TODO: Load any ResourceManagementMode.Manual content

    }

     

    Any help would be appreciated.

     

    Thanks,

    Mike

  • 11/8/2007 2:34 PM In reply to

    Re: Cannot "find" model file issue...

    Try this:

    1. In the Solution Explorer, click on your model file.
    2. In the Properties window, set "XNA Framework Content" to True.

    That should do it...  If "XNA Framework Content" is already set to True, I don't know what you problem is. Sorry.

    -Swordshock

  • 11/8/2007 2:39 PM In reply to

    Re: Cannot "find" model file issue...

    It is set to true.

    Thanks for the try though.

  • 11/8/2007 5:05 PM In reply to

    Re: Cannot "find" model file issue...

    Try the solution I mentioned in your post in the tutorials and samples section and see if that works.
    =========================
    Blog

    Projects
  • 11/8/2007 6:29 PM In reply to

    Re: Cannot "find" model file issue...

    Forgot that I had posted there, I will check it out and try it. Thanks.
  • 11/9/2007 1:01 PM In reply to

    Re: Cannot "find" model file issue...

    HA! Im not the only one!!!

    Short answer :

    /

    yes, /

    \\= bad
    / = good

    try it and let me know
  • 11/9/2007 4:54 PM In reply to

    Re: Cannot "find" model file issue...

    Try setting the Copy to Output Directory to "Copy If newer".  I find that fixes a lot of problems with the file not found issue.  It seems that sometimes visual studio won't copy the file to the output directory where it looks for the file.  If that doesn't work, I'm not what else would be the issue.
  • 11/9/2007 7:01 PM In reply to

    Re: Cannot "find" model file issue...

    The problem is a simple typo. Get rid of the leading "\\" from your file path.

    To be clear, replace your load line with this:

       myModel = content.Load<Model>("Content\\Models\\p1_wedge");

    The path specified is supposed to be relative, but by leading with "\\", you are making it relative to the root instead of relative to the current directory.

     

    Stephen Styrchak | XNA Game Studio Developer
  • 11/9/2007 9:38 PM In reply to

    Re: Cannot "find" model file issue...

    Signot:
    Try setting the Copy to Output Directory to "Copy If newer".


    You should never change this setting for files that are built using the Content Pipeline. Copy to output directory is a totally different thing to the Content Pipeline, and will have no effect whatsoever on the Content Pipeline build process.
    XNA Framework Developer - blog - homepage
Page 1 of 1 (9 items) Previous Next