Dr.9

I have a small xna application working. I can load an .X file, render multiple of them -great. Now adding another .X file (created identically, added the same way -[existing file, content] It throws up errors on the build. Is there some kind of caching taking place, or a pre-build action I should be doing Searching for the .x model name it shows up in both the ContentPipeline.xml file WITH TWO ENTRIES. Removing the extraneous entries from the /OBJ/ContentPipeline.xml doens't do anything, as it's regerenerted on each build.

Where is it getting it from How do I fix this (error throw below)

Error 1 Building content threw ArgumentException: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at Microsoft.Xna.Framework.Content.Pipeline.NamedValueDictionary`1.AddItem(String key, T value)
at Microsoft.Xna.Framework.Content.Pipeline.NamedValueDictionary`1.Add(String key, T value)
at Microsoft.Xna.Framework.Content.Pipeline.AnimationConverter.NodeWasCreated(SByte* frameName, NodeContent node, Boolean partOfSkeleton)
at Microsoft.Xna.Framework.Content.Pipeline.XImporter.ProcessNodeImpl(ValueType parentAbsoluteTransform, _D3DXFRAME* frame, Boolean partOfMainSkeleton, Boolean partOfAnySkeleton)
at Microsoft.Xna.Framework.Content.Pipeline.XImporter.ProcessNodeImpl(ValueType parentAbsoluteTransform, _D3DXFRAME* frame, Boolean partOfMainSkeleton, Boolean partOfAnySkeleton)
at Microsoft.Xna.Framework.Content.Pipeline.XImporter.ProcessNodeImpl(ValueType parentAbsoluteTransform, _D3DXFRAME* frame, Boolean partOfMainSkeleton, Boolean partOfAnySkeleton)
at Microsoft.Xna.Framework.Content.Pipeline.XImporter.ProcessNode(_D3DXFRAME* rootFrame)
at Microsoft.Xna.Framework.Content.Pipeline.XImporter.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)




Re: XNA Game Studio Express Problem with content .x files on build.

Nazeeh - MSFT

This is a known issue. The problem is really within your .X file. You probably have two, or more, animation keyframes having the same name in the .x file. You can open the file in notepad or something, find the duplicates, and change their names to be unique. You probably can find out what the duplicate is since you found it in the ContentPipeline.xml file. Editing that file won't do anything for you though, you need to fix the source .x files.

Hope that helps :)






Re: XNA Game Studio Express Problem with content .x files on build.

Dr.9

I don't have any animations in the .x file. It was a binary .x created with Caligari Truespace - i recreated it as an ascii .x file but dont' see anything immediatly obvious as to why it fails to load.

Is there any .x validation tool to run this on (I'd post the .x text contents but it's quite long).






Re: XNA Game Studio Express Problem with content .x files on build.

Shawn Hargreaves - MSFT

Do you have two frames in the X file with the same name If so rename one of them to something unique.

As Nazeeh said this is a known bug: the problem is in the framework rather than your X file.







Re: XNA Game Studio Express Problem with content .x files on build.

Dr.9

using gnu tools to grep for 'Frame' this is what I get.  I have a duplicate in PatchPolyh - although they're 'sub nodal (if that's not a word I'm patenting it) of unique Frames - changed that and We're good to go.  Thanks.  I'll either make a utility to scrub .x files or try another format I guess.

 

$ cat rocket174815022007.x | grep Frame
Frame Selection {
        FrameTransformMatrix {
        Frame fuselage {
                FrameTransformMatrix {
        Frame Afterburner {
                FrameTransformMatrix {
        Frame fin3 {
                FrameTransformMatrix {
                Frame PatchPolyh {
                        FrameTransformMatrix {
                Frame NoName_1 {
                        FrameTransformMatrix {
                Frame NoName_3 {
                        FrameTransformMatrix {
        Frame fin2 {
                FrameTransformMatrix {
                Frame PatchPolyh {
                        FrameTransformMatrix {
                Frame NoName_B {
                        FrameTransformMatrix {
                Frame NoName_C {
                        FrameTransformMatrix {
        Frame fin1 {
                FrameTransformMatrix {
                Frame PatchPolyh {
                        FrameTransformMatrix {
                Frame NoName_F {
                        FrameTransformMatrix {
                Frame NoName_G {
                        FrameTransformMatrix {






Re: XNA Game Studio Express Problem with content .x files on build.

Shawn Hargreaves - MSFT

Cool!

We'll get this bug fixed in the next version.