Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Asset being built two times with different settings, what can I do?

Tags:

xna

In my XNA 3.1 project, I have a cubemap (*.dds) file that seems to be required by almost all of my models in my project. When I go to build my project with the cubemap set to compile into the pipeline, I receive an error going something like this:

Asset was built 2 times with different settings: using TextureImporter and TextureProcessor, referenced by Models\AlphaDeadTree.X (RacingGameModelProcessor), Models\AlphaPalm.X (RacingGameModelProcessor), Models\AlphaPalm2.X (RacingGameModelProcessor), Models\AlphaPalm3.X (RacingGameModelProcessor)...

And so on and so forth. Several google results mention that simply removing the file from the Content node, while retaining the physical file in its directory will solve the problem, however, it seems as though it's no longer loaded into the Content pipeline once it's removed from the project's Content node, despite the models requiring that file.

At this point, what can I do? Is my only option to ignore that gigantic warning message?

like image 477
gcode Avatar asked Jul 26 '11 23:07

gcode


1 Answers

I see on your Content.contentproject that you still direct reference model textures (textures\SkyCubeMap.dds, Shaders\Textures\NormalizeCubeMap.dds, ...): this is not correct. From your content project you only have to reference models (.X) but not textures (.tga, *.dds, etc.) used by the models. Don't worry for those textures: they will automatically be located, imported and processed.

For example, if you have a model called Tank.X and that model uses a texture called Tank.dds you only have to include Tank.X in your content project. Including Tank.dds will produce the error.

On the other hand, you will have to include on your content project textures that you are going to load by hand: Content.Load("MyByHandLoadedTexture");

If you need to load the same texture from a model and by hand you will have to duplicate it and make the models use one copy and include the other copy in the content project in order to be loaded by hand.

like image 131
David Díaz Avatar answered Sep 28 '22 06:09

David Díaz