Creating an XML animation file for a Blender .X file

Topics: User Forum
Apr 9, 2007 at 8:09 AM
Hi,

I have an animated .x file exported via Blender which works fine in XNA but whenever I try to update the animationxml file to split the anims and then try to assign the animation subset nodes within GSE I keep getting an error telling me that the definition was not found in the dictionary.

The animation only works if I use the "AnimationSet0" node.

In addition to the above I have been trying out the CubeComponent and have (I beleive) successfully attached it to a bone, however it never gets rendered.

Any hekp would be appreciated.

Regards,

Corpse.
Coordinator
Apr 9, 2007 at 8:15 AM
Make sure to set the View and Projection properties on CubeComponent. The ModelAnimator doesn't deal with view/projection for documented reasons.

The xml file needs to be in the same directory as your model and be named <modelname>animation.xml
You also need to do "rebuild all" on the solution when you change/add an xml file.

Does this fix your problems?
Apr 9, 2007 at 5:17 PM
my bad, your suggestions worked a treat, thanks.

Apr 9, 2007 at 10:28 PM
Hi CorpsaLike

I made the model in blender but if i compile the project in xna then i have this error:

Error 1 Building content threw Exception: Failed to parse System.Single at token number 4234
value: 1.0
Surrounding tokens:
;0.0;;TextureFilename{";";}}MaterialMat4{*1.0;1.0;1.0;1.0;;1.0;1.0;1.0;1.0
at Xclna.Xna.Animation.Content.XFileTokenizer.Throw(Type type)
at Xclna.Xna.Animation.Content.XFileTokenizer.NextFloat()
at Xclna.Xna.Animation.Content.XModelImporter.ImportMaterial()
at Xclna.Xna.Animation.Content.XModelImporter.XMeshImporter.ImportMaterialList()
at Xclna.Xna.Animation.Content.XModelImporter.XMeshImporter.ImportMesh()
at Xclna.Xna.Animation.Content.XModelImporter.ImportNode()
at Xclna.Xna.Animation.Content.XModelImporter.ImportNode()
at Xclna.Xna.Animation.Content.XModelImporter.ImportRoot()
at Xclna.Xna.Animation.Content.XModelImporter.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\falcco\My Documents\Visual Studio 2005\Projects\Panacik\Panacik\panak.x Panacik



can you tell me how can i fix that or where is the problem?
thnx
Coordinator
Apr 9, 2007 at 11:06 PM
Edited Apr 9, 2007 at 11:07 PM
TextureFilename{";";}}

It failed to parse because you have a TextureFileName node with two semicolons and (it seems) an empty string.

Edit the file and remove the TextureFileName { } node if it is empty. If it is not empty, then it is probably an absolute path, and my importer currently has a bug with absolute paths in the latest release, so you'll have to change it to relative.

Sorry for the inconvenience.