Using a Custom Importer or Content Processor
XNA Game Studio provides standard importers and processors for a number of common file formats used to store basic game assets such as models, materials effects, sprites, textures, and so on (for a list of the file formats that these standard importers and processors support, see Standard Importers and Processors). However, if you have game assets saved in a format that the standard importers and processors do not support, you may be able to find a custom third-party importer and/or processor for XNA Game Studio that supports that file format. If you have enough information about the file format, you can even build your own custom importer or processor, as described in How To: Write a Custom Importer and Processor.
|Before you open an existing project or component, determine the trustworthiness of the code outside of the Visual Studio designer. Opening projects or components in the Visual Studio designer automatically executes that code on your local machine in the trusted process of VCSExpress.exe or DevEnv.exe.|
The following procedure shows how to add such a custom importer and processor to an existing game project. These steps assume that you have copied the new importer or processor to a local subfolder of the game project in question.
To Add a Custom Importer or Processor to a Game Project
- Open XNA Game Studio.
- Load the solution associated with your game.
- From Solution Explorer, right-click the nested content project node and select Add Reference.
- Navigate to the directory containing the assembly with the custom importer or processor and add it to the solution.
- Save the solution.
The new importer or processor now appears as one of the available choices for importing or processing a newly added game asset.