Location of animation.xml

Topics: User Forum
Apr 23, 2007 at 3:55 AM
Hi, in Windows I have to put the animation.xml on the root of the Project even though the .X file is located in a folder named Content\Models
In the 360, I had to move both files to the root of the project, or otherwise I will get the KeyNotFoundException when referencing the Animations collection.
It will be nice to have animation.xml file located on the same folder of the .X file, so please schedule this little fix.
Also note that the Content Pipeline does not detect changes to the animation.xml file, I have to manually modify the .X file so the .xml file gets parsed again.
Best regards.
Coordinator
Apr 24, 2007 at 4:12 AM
Edited Apr 25, 2007 at 2:35 AM
Hey, I couldn't reproduce your error related to xml file location. Here is the source code for how the processor looks for the xml file:
            // This is the full file path, passed in in from the content importer
            string filePath = Path.GetFullPath(root.Identity.SourceFilename);
 
            // Get the directory of the file, append the directory separator, append the
            // name of the model file without the extension, and finally append animation.xml
            string fileName = Path.GetDirectoryName(filePath);
            if (fileName!="")
                fileName += "\\";
            fileName += System.IO.Path.GetFileNameWithoutExtension(filePath)
                + "animation.xml";
            bool animXMLExists = File.Exists(fileName);

Any other info you can give?


Also, about how the pipeline doesn't detect changes in the xml file, I realize this issue. Currently, there is no solution I can implement. Unfortunately, there is no direct way to allow a user to set options in an importer or processor, so the best I could come up with is an xml config file. The necessary side effect of this is that the user has to do something like rebuilding the project, modifying the file, or deleting the xnb file.
Apr 25, 2007 at 2:13 AM
Dastle thanks for your time. Once I realized that I needed to modify the .X file in order to have the animation.xml file reprocessed, and after reading the code that you posted, I relocated the assets back to their original position inside the Content\Modeles folder, made a little change in .X file, saved it, and this time it worked fine both on Windows and XBOX 360. Thanks again for your dedication.
Andrés Cavallin