Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am trying to load premade .xnb files with the content pipeline. when I call contentManager.Load<model>("grass");, for which I have a "grass.xnb" file in the corresponding directory, it crashes with: "Error loading "grass_0". File not found."

The grass.xnb file was created using a MSBuild wrapper to build the .fbx files. I initialized the content manager with : contentManager = new ContentManager(mainXnaWindow.Services, projectFileOpen + "../Assets/XNB/")); I am pretty sure the content manager has the right directory, because when I deleted "grass.xnb" from the directory, It just told me "Error loading "grass" File not found"

Does anyone know why it could be adding a "_0" to the name?

Edit: I forgot to include a built version of th texture associated with it. Problem Solved.

share|improve this question
    
You need to say something about this grass_0 file. It's the thing causing the error so we need to know about it (currently we know nothing). We also need to know what it has to do with myModel.xnb, unless that was just a roundabout way of saying you call contentManager.Load<model>("grass");. –  Jonathan Hobbs Jun 8 '11 at 7:44
    
Sorry about that. I've cleared up and added some details. –  sFuller Jun 8 '11 at 7:59
1  
maybe grass_0 is it's texture and it needs it to completly load model? –  Ali.S Jun 8 '11 at 8:35
    
Haha that solves the problem. Thanks! –  sFuller Jun 8 '11 at 8:44
3  
Could you post the answer and accept it? –  Jonathan Connell Jun 8 '11 at 9:04

1 Answer 1

up vote 1 down vote accepted

The .xnb file wouldn't load because it was looking for another .xnb file, the texture to go with the model.

I fixed this by making sure that all of the built .xnb files were in the directory I was loading from.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.