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 ?


1 Answer 1


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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .