Exception in Pipeline tool when importing .x file

I’m going through some XNA video tutorials to get started with MG. In an early section that introduces 3D graphics they use a .x model that the MG Pipeline tool chokes on with the following exception:

(sorry, I’d have simply cut & pasted the text if the tool gave me that option)

I’ll share the model file if necessary but I don’t really have a convenient means to do that. At least not one that is suitable for public sharing. If you have a Packt Publishing account you can download it from them (under “Code Files”):

The specific file in question is called “Vampire.x”.

This is the latest build of MonoGame, 3.5 (just downloaded tonight). I’m using VS 2015, fully updated I believe, on a Windows 10 x64 system.

I’ve cloned the Github repo in the hopes of maybe figuring out how to debug this myself but it may take a few days. If I find anything before getting an answer here I’ll be sure to report back.

I get the same result from this asset on the same MG release on Win 7 64b.
(FYI, asset is in V014_08_Code.rar sub archives of code bundle)

Trying with the dev snapshot give me the same result but with more informations (maybe):
> D:/tmp/Vampire.x: error: Importer ‘XImporter’ had unexpected failure!
> System.OverflowException: TimeSpan dépassé, car la durée est trop longue.
> à System.TimeSpan.Interval(Double value, Int32 scale)
> à Microsoft.Xna.Framework.Content.Pipeline.OpenAssetImporter.ImportAnimation(Animation aiAnimation) dans M:\c#\MonoGame\MonoGame\MonoGame-develop\MonoGame\MonoGame.Framework.Content.Pipeline\OpenAssetImporter.cs:ligne 783
> à Microsoft.Xna.Framework.Content.Pipeline.OpenAssetImporter.ImportSkeleton() dans M:\c#\MonoGame\MonoGame\MonoGame-develop\MonoGame\MonoGame.Framework.Content.Pipeline\OpenAssetImporter.cs:ligne 658
> à Microsoft.Xna.Framework.Content.Pipeline.OpenAssetImporter.Import(String filename, ContentImporterContext context) dans M:\c#\MonoGame\MonoGame\MonoGame-develop\MonoGame\MonoGame.Framework.Content.Pipeline\OpenAssetImporter.cs:ligne 292
> à Microsoft.Xna.Framework.Content.Pipeline.XImporter.Import(String filename, ContentImporterContext context) dans M:\c#\MonoGame\MonoGame\MonoGame-develop\MonoGame\MonoGame.Framework.Content.Pipeline\XImporter.cs:ligne 35
> à Microsoft.Xna.Framework.Content.Pipeline.ContentImporter`1.Microsoft.Xna.Framework.Content.Pipeline.IContentImporter.Import(String filename, ContentImporterContext context) dans M:\c#\MonoGame\MonoGame\MonoGame-develop\MonoGame\MonoGame.Framework.Content.Pipeline\ContentImporter.cs:ligne 45
> à MonoGame.Framework.Content.Pipeline.Builder.PipelineManager.ProcessContent(PipelineBuildEvent pipelineEvent) dans M:\c#\MonoGame\MonoGame\MonoGame-develop\MonoGame\MonoGame.Framework.Content.Pipeline\Builder\PipelineManager.cs:ligne 652

Note the text is about duration exceeded but the message appears without any noticeable delay, build -> error, not build -> … wait … -> error.

It appears to be a divide by zero error in the creation of the new AnimationContent at the beginning of OpenAssetImporter.ImportAnimation. aiAnimation.TicksPerSecond is 0.

Now I’m trying to figure out why that happened. Maybe a file format issue or something? I’ll keep digging.

So I’m learning that the .x file format is considered quite obsolete and it appears the file I’m trying to use is an older version of the format (3.3 if I’m reading the header right) which didn’t support the AnimTicksPersSecond template section. I’m guessing the .x converter in MonoGame was written with a later version of the format in mind.

So rather than pouring effort into figuring out whether and how the Pipeline can import outdated formats I simply converted it to Collada using greentoken.de. Problem solved.