资产使用不同的设置构建两次,我该怎么办?

发布于 2024-11-26 09:28:16 字数 500 浏览 0 评论 0原文

在我的 XNA 3.1 项目中,我有一个立方体贴图 (*.dds) 文件,项目中几乎所有模型似乎都需要该文件。当我使用设置为编译到管道中的立方体贴图来构建项目时,我收到如下错误:

资产使用不同的设置构建了两次:使用TextureImporter 和TextureProcessor,由Models\AlphaDeadTree.X引用 (RacingGameModelProcessor),模型\AlphaPalm.X (RacingGameModelProcessor),模型\AlphaPalm2.X (RacingGameModelProcessor),模型\AlphaPalm3.X (赛车游戏模型处理器)...

等等。几个谷歌结果提到,只需从内容节点中删除文件,同时将物理文件保留在其目录中即可解决问题,但是,一旦从项目的内容节点中删除它,它似乎就不再加载到内容管道中,尽管模型需要该文件。

此时,我能做什么呢?我唯一的选择是忽略那个巨大的警告消息吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

青芜 2024-12-03 09:28:16

我在您的 Content.contentproject 上看到您仍然直接参考模型纹理(textures\SkyCubeMap.dds、Shaders\Textures\NormalizeCubeMap.dds,...):这是不正确的。在您的内容项目中,您只需引用模型 (.X),而不需要引用模型使用的纹理(.tga、*.dds 等)。不用担心这些纹理:它们会自动定位、导入和处理。

例如,如果您有一个名为 Tank.X 的模型,并且该模型使用名为 Tank.dds 的纹理,则您只需将 Tank.X 包含在您的内容项目中。包含 Tank.dds 将产生错误。

另一方面,您必须在内容项目中包含您要手动加载的纹理:Content.Load("MyByHandLoadedTexture");

如果您需要要从模型手动加载相同的纹理,您必须复制它并使模型使用一个副本并将另一个副本包含在内容项目中以便手动加载。

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.

雨后彩虹 2024-12-03 09:28:16

您也可以右键单击纹理,然后在属性对话框中查找“构建操作”选项并将其设置为“无”。这在 XNA 4.0 中对我有用。

Also you can right click the texture and in the properties dialog look for the 'Build Action' option and set to 'None'. This works for me in XNA 4.0.

遮了一弯 2024-12-03 09:28:16

立方体贴图构建两次,因为它被一个或多个模型引用(第一次),并且因为它被您的内容项目显式引用(第二次)。

尝试将其从您的内容项目中删除,但请注意,不要单击它并按“删除”:这会将其从磁盘中删除。右键单击它,然后从上下文菜单中选择“从项目中排除”(或类似的内容...我使用 Visual Studio 的本地化版本,并且不知道确切的英文选项标签)。

The cubemap is built twice because it's referenced by one or more models (firs time) and because it's referenced explicitly by your content project (second time).

Try to remove it from your content project but CAUTION, don't click it and press "delete": this would remove it from the disk. Right-click it and, from the contextual menu, select "exclude from project" (or something similar... I use a localized version of Visual Studio and don't know the exact option label in english).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文