Problem with Animation Demo

Topics: User Forum
Dec 3, 2006 at 4:44 PM
Hi,

I get this error message when trying to debug the solution:

Error 1 Building content threw Exception: Failed to parse Microsoft.Xna.Framework.Matrix at token number 68
value: 1.000000
Surrounding tokens:
;Matrix4x4matrixOffset;}AnimTicksPerSecond{25;}FrameRootFrame{FrameTransformMatrix{*1.000000,0.000000,0.000000,0.000000,0.000000,0.000000,-1.000000,0.000000,
at Animation.Content.XFileTokenizer.Throw(Type type)
at Animation.Content.XFileTokenizer.NextMatrix()
at Animation.Content.AnimatedModelImporter.ImportFrameTransformMatrix()
at Animation.Content.AnimatedModelImporter.ImportNode()
at Animation.Content.AnimatedModelImporter.ImportRoot()
at Animation.Content.AnimatedModelImporter.Import(String filename, ContentImporterContext context)
at Microsoft.Xna.Framework.Content.Pipeline.ContentImporter`1.Microsoft.Xna.Framework.Content.Pipeline.IContentImporter.Import(String filename, ContentImporterContext context)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.ImportAssetDirectly(BuildItem item, String importerName)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.ImportAsset(BuildItem item)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.BuildAssetWorker(BuildItem item)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.BuildAsset(BuildItem item)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.BuildAndLoadAsset(BuildItem item, BuildItem requestingItem)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.ImportAssetViaCache(BuildItem item, String importerName)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.ImportAsset(BuildItem item)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.BuildAssetWorker(BuildItem item)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.BuildAsset(BuildItem item)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.RunTheBuild()
at Microsoft.Xna.Framework.Content.Pipeline.Tasks.BuildContent.RemoteProxy.RunTheBuild(BuildCoordinatorSettings settings, ITaskItem[] sourceAssets, TaskLoggingHelper msbuildLog, String[]& outputContent, String[]& rebuiltContent, String[]& intermediates) D:\-=Game=-\XNA\AnimationDemo\AnimationDemo\AnimationDemo\alien.x AnimationDemo
Coordinator
Dec 4, 2006 at 4:44 AM
Is this with the model provided in the solution? If so, that is very odd...
Dec 4, 2006 at 11:34 AM
yes, it is...
Coordinator
Dec 4, 2006 at 5:28 PM
Make sure
Matrix4x4 matrixOffset
and
Frame RootFrame

are separated. If this doesn't help, have you tried redownloading the project?
Dec 5, 2006 at 8:05 AM
I have the same problem. It seems to be some kind of problem with reading my .X-files... It doesn't matter which one it is it's always the same problem and it's files that work with in other XNA projects. I think that the problem has to do with the reading of the .X file and the encodings or something. I'm on a swedish version of windows although the project and it's files hasn't got any strange characters in it's paths. Anyway. This is the error message that I get:

Error 1 Building content threw Exception: Failed to parse Microsoft.Xna.Framework.Matrix at token number 63
value: 1.000000
Surrounding tokens:
;arrayFLOATweightsnWeights;Matrix4x4matrixOffset;}FrameScene_Root{FrameTransformMatrix{*1.000000,0.000000,0.000000,0.000000,0.000000,1.000000,0.000000,0.000000,
at Animation.Content.XFileTokenizer.Throw(Type type)
at Animation.Content.XFileTokenizer.NextMatrix()
at Animation.Content.AnimatedModelImporter.ImportFrameTransformMatrix()
at Animation.Content.AnimatedModelImporter.ImportNode()
at Animation.Content.AnimatedModelImporter.ImportRoot()
at Animation.Content.AnimatedModelImporter.Import(String filename, ContentImporterContext context)
at Microsoft.Xna.Framework.Content.Pipeline.ContentImporter`1.Microsoft.Xna.Framework.Content.Pipeline.IContentImporter.Import(String filename, ContentImporterContext context)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.ImportAssetDirectly(BuildItem item, String importerName)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.ImportAsset(BuildItem item)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.BuildAssetWorker(BuildItem item)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.BuildAsset(BuildItem item)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.BuildAndLoadAsset(BuildItem item, BuildItem requestingItem)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.ImportAssetViaCache(BuildItem item, String importerName)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.ImportAsset(BuildItem item)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.BuildAssetWorker(BuildItem item)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.BuildAsset(BuildItem item)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.RunTheBuild()
at Microsoft.Xna.Framework.Content.Pipeline.Tasks.BuildContent.RemoteProxy.RunTheBuild(BuildCoordinatorSettings settings, ITaskItem[] sourceAssets, TaskLoggingHelper msbuildLog, String[]& outputContent, String[]& rebuiltContent, String[]& intermediates) C:\Tobias\xna\AnimationDemo\AnimationDemo\tiny.x AnimationDemo
Coordinator
Dec 7, 2006 at 12:45 AM
I've determined the cause, thanks for the feedback. The fact you are from Sweden was the key.

float.Parse(1.000000) will throw an exception on swedish computers because float.Parse, by default, uses a culture-specific format provider.

I'll fix this in the next release so that it will work for all cultures.
Coordinator
Dec 7, 2006 at 4:39 AM
It's been fixed in the source code, but to use it, you'll have to donwload and recompile into a dll (until next release)
Dec 7, 2006 at 11:46 AM
I can't get it to work either, using just the downloaded project with the supplied alien.x file. My build error is as follows:

Error 1 Building content threw ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: weight
at Microsoft.Xna.Framework.Content.Pipeline.Graphics.BoneWeight..ctor(String boneName, Single weight)
at Animation.Content.AnimatedModelImporter.AnimatedMeshImporter.ImportSkinWeights()
at Animation.Content.AnimatedModelImporter.AnimatedMeshImporter.ImportMesh()
at Animation.Content.AnimatedModelImporter.ImportNode()
at Animation.Content.AnimatedModelImporter.ImportNode()
at Animation.Content.AnimatedModelImporter.ImportRoot()
at Animation.Content.AnimatedModelImporter.Import(String filename, ContentImporterContext context)
at Microsoft.Xna.Framework.Content.Pipeline.ContentImporter`1.Microsoft.Xna.Framework.Content.Pipeline.IContentImporter.Import(String filename, ContentImporterContext context)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.ImportAssetDirectly(BuildItem item, String importerName)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.ImportAsset(BuildItem item)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.BuildAssetWorker(BuildItem item)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.BuildAsset(BuildItem item)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.BuildAndLoadAsset(BuildItem item, BuildItem requestingItem)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.ImportAssetViaCache(BuildItem item, String importerName)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.ImportAsset(BuildItem item)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.BuildAssetWorker(BuildItem item)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.BuildAsset(BuildItem item)
at Microsoft.Xna.Framework.Content.Pipeline.BuildCoordinator.RunTheBuild()
at Microsoft.Xna.Framework.Content.Pipeline.Tasks.BuildContent.RemoteProxy.RunTheBuild(BuildCoordinatorSettings settings, ITaskItem[] sourceAssets, TaskLoggingHelper msbuildLog, String[]& outputContent, String[]& rebuiltContent, String[]& intermediates) C:\Documents and Settings\Jan-Jaap\Bureaublad\AnimationDemo\AnimationDemo\AnimationDemo\alien.x AnimationDemo


I've downloaded the source for the animation lib, recompiled it and linked the new dll into the demo project. Also, line 92 in Game1.cs of the demo still references 'AnimationQuality' (which has been removed, right?).

Regards,

Jappie
Coordinator
Dec 7, 2006 at 1:07 PM
I'll take a look, and assumed you added the new dll to both the project references and content pipeline assemblies. Sorry about this (it's hard to foresee these errors since everything works fine in my comp :-/)
Coordinator
Dec 7, 2006 at 1:11 PM
And yes, quality was removed, but I haven't updated the demo (and wont because it works for most people with the provided dll) until the next release. The demo won't work well as is- you need to change a couple things because the code has changes so mich since version 2 (i.e., chnage BasicEffect to BasicPaletteEffect and explcitly use precompouted interpolations)
Dec 7, 2006 at 1:18 PM
Thanks for the support, I'll wait 'til next release.
Coordinator
Dec 7, 2006 at 2:54 PM
What that last error means is that a bone weight with value greater than 1.0000 is trying to be created. This is illegal in XNA since all floats must be between 0 and 1.

The alien file contains no floats outside this range in the SkinWeights sections.

The only thing I can think of is that float.Parse is still not working correctly for other countries. Can I ask what country you are from?
Dec 7, 2006 at 5:00 PM
Ofcourse you may :) I'm from Holland, and am indeed running a Dutch version of Windows XP.
Dec 7, 2006 at 5:01 PM
Oh, and don't excuse yourself; software development is all about fixing problems that arise through the use of it.
Coordinator
Dec 7, 2006 at 5:49 PM
I changed the code so that all importation uses the US culture.

Decimal numbers have commas instead of periods in Holland I think, so using the invariant culture, it may have just ignored everything to the right of the period for float parsing.

Would you mind seeing if this works?
Dec 9, 2006 at 7:34 PM
I downloaded the source with the fix, but since I'm a newbie in programing I have no idea how to compile the source and use it with the animationdemo.

I would be grateful for your input, tips or advice you could give me.

Coordinator
Dec 10, 2006 at 6:16 PM
It's non-trival for a beginner, so its ok if you don't understand the following:

- Create a new Windows Game Librarby project with all the source files
- Add references to Microsoft.XNA.Content.Pipeline and System.XML
- Compile
- Add the compiled DLL (will appear in debug folder of project) as a reference and content pipeline dll to the sample

If this doesn't work, you can still test out if the following code works:
CultureInfo culture = new CultureInfo("en-US");
System.Threading.Thread.CurrentThread.CurrentCulture = culture;
System.Threading.Thread.CurrentThread.CurrentUICulture = culture;
float fl = float.Parse("124.2233000");
Console.WriteLine(fl==124.2233000f);

And see if it says True
Dec 11, 2006 at 7:51 AM
Unfortunately, even with your latest build (13706) it still doesn't work. I've created a seperate console app to test the floating point conversion, and it yields 'True'.
Coordinator
Dec 11, 2006 at 8:37 PM
Odd. I'll see what I can do. I still think it has to do with the fact you from Holland, since if I set the culture of the thread to Netherlands, I get the same exact error as you do. But, when I set it to US (or don't change it at all), it works fine.
Coordinator
Dec 11, 2006 at 8:48 PM
I am 100% positive the error has to do with the culture. Setting the culture to netherlands, float.parse(1.2) yields 12.

Your tests show that setting the current thread culture to US culture successfully avoids this problem on foreign computers, and that is what I do in the code right before I import a model. This is why the problem is very baffling to me at the moment.
Coordinator
Dec 12, 2006 at 12:26 AM
I just want to make sure something isn't going wrong in the compile step, since there is every reason to indicate the current source code should work.

I made a special build in the releases section that should work on non british european computers.

It contains an example project (you can read the details in the release summary). Hope it works...
Dec 12, 2006 at 9:41 AM
Well, things are getting weirder by the minute. Compiling the SimpleDemo right out of the archive yields:

Error 1 Error loading pipeline assembly "C:\Documents and Settings\Jan-Jaap\Bureaublad\SimpleDemo\SimpleDemo\SimpleDemo\Animation.dll". SimpleDemo


If I subsequently remove the dll from the Content Pipeline Assemblies (in the project properties) and try just with the .dll added as a reference to the project, I get:

Error 1 Cannot find importer "AnimatedModelImporter". C:\Documents and Settings\Jan-Jaap\Bureaublad\SimpleDemo\SimpleDemo\SimpleDemo\bear_walking.x SimpleDemo


Next, I tried a different computer (but with a Dutch version of Windows). I re-installed a fresh 1.0 version of XNA Game Studio, and compiling the SimpleDemo succeeded. Compiling the AnimationDemo (freshly downloaded) on the same machine resulted in the first error in this post.
I then re-installed XNA on my first machine. Now compiling the SimpleDemo succeeds, but compiling the AnimationDemo gives the 'Error loading pipeline assembly' error.
At least one of the samples compiles and runs now, and compiling is the same on both machines. Back to you :)
Dec 12, 2006 at 10:31 AM
Right, some more progress. If I recompile the latest release with a self-built version of the Animation component (using the latest source) I see several blueish sticks jumping around. Is that what I want? :)
Coordinator
Dec 12, 2006 at 5:46 PM
Yes, that is what you want.
Coordinator
Dec 12, 2006 at 5:51 PM
Now, for complicated models with non matrix key frames, there is a bug that doesn't make them animate properly. I'm working on this, so just a heads up.

The feature set for the current release is a bit restrictive, but in the next release i want to give an example of how to make a model walk around and view it with a cam (a lot more useful than sticks jumping around).
Coordinator
Dec 13, 2006 at 4:02 AM
I seem to have fixed the bug; the animationcontroller works on complicated models exported by Maya that do not use Matrix keyframes.
Dec 14, 2006 at 10:41 AM
I tested the new demo with the walking bear and it works fine.

Greet work
Jan 4, 2007 at 6:21 AM
When I tried to Build the solution
it said:

Error Loading Pipeline Assembly "C:\..<some path>\.dll"

I am using
Microsoft XNA Game Studio Express (Beta 2) Version 1.0
Developer
Jan 4, 2007 at 4:50 PM
You should configure the path to Animation.Content.dll in project Properties
Jan 8, 2007 at 4:31 AM
I tried everything, still it was not working, but then...

I downloaded the latest version of XNA ;) lolz, its working.
may be some problem from the vendor side as i said i was using Beta2!