Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to check the consistency of a DirectX model (.x) ?

Whilst compiling .x files with XNA GameStudio 3.1 compilation is aborted with the following error message:

Error 2 Could not read the X file. The file is corrupt or invalid. Error code: D3DXFERR_PARSEERROR. C:\WFP\Browser\Content\m.x KiviBrowser

Some models compile correctly without any error/warning and some abort as described. The files of each model have several thousand lines.

I am creating the files in Googles SketchUp 8 where they all look fine and don't show any sign of corruption.

Suppose I have such a model my XNA compiler won't compile because their is an inconsistency somewhere in the file - how could I identify this in order to correct it ?

share|improve this question

It's possible the exporter you're using to write the .X files out of SketchUp has a bug. There are a few things you can try:

  • You could try a different exporter. It looks like there are a few.
  • You can try to export the model and then load it up in another modeling tool via some other importer and see if that importer presents any errors (hopefully with a better diagnostic message). Blender may be an option here.
  • If you're exporting to the text-based format, you can compare the output file against the specification by hand, especially if your model is small and simple.
  • Using the specification, you could in fact write your own validator and try to diagnose the problem yourself that. This would likely be more work, but more useful if your models are complex.
share|improve this answer

Your Answer


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.