简体   繁体   English

jMonkeyEngine:导入.x模型

[英]jMonkeyEngine: importing .x models

I found this importer for .x files in the jMonkeyEngine SDK plugins: http://jmonkeyengine.org/groups/contribution-depot-jme3/forum/topic/directx-to-j3o-converter/?topic_page=1&num=15 , and I downloaded/installed it successfully via the Tools -> Plugins menu. 我在jMonkeyEngine SDK插件中找到了.x文件的导入程序: http ://jmonkeyengine.org/groups/contribution-depot-jme3/forum/topic/directx-to-j3o-converter/?topic_page = 1&num = 15,以及我通过Tools - > Plugins菜单成功下载/安装了它。

But I'm not sure how to use it. 但我不确定如何使用它。 I tried adding a model to my assets folder, then right-clicking it in the SDK and choosing "Convert to j3o Binary", but this accomplished nothing: no dialogs popped up, and nothing seemed to change at all. 我尝试将一个模型添加到我的资源文件夹,然后在SDK中右键单击并选择“转换为j3o二进制文件”,但这没有任何结果:没有弹出对话框,似乎没有任何改变。 My code still generates a runtime warning stating that it doesn't know how to load a .x file. 我的代码仍然生成运行时警告,指出它不知道如何加载.x文件。

截图

PS I posted this question as a reply on the linked thread as well. PS我也发布了这个问题作为链接线程的回复。 So far, no responses, so that's why I'm posting here, but just a heads-up in case someone replies there in the near future. 到目前为止,没有回复,所以这就是为什么我在这里发帖,但只是一个单挑,以防有人在不久的将来回复。

Update: A user replied to the thread, suggesting I check to see if any errors are being thrown (a little red error icon in the bottom-right corner of the screen). 更新:用户回复该主题,建议我检查是否有任何错误被抛出(屏幕右下角有一个红色的小错误图标)。 Sure enough, there was, and the error message was the converter complaining about not being able to find the dwarf.jpg texture. 果然,有,并且错误消息是转换器抱怨无法找到dwarf.jpg纹理。 So I moved the texture into the Models folder next to the dwarf1.x model. 所以我将纹理移动到dwarf1.x模型旁边的Models文件夹中。

However, the conversion process is still behaving the same way, except that the error icon doesn't come up. 但是,转换过程仍然以相同的方式运行,除了错误图标没有出现。 In other words, nothing appears to be happening now, and no error messages are being thrown. 换句话说,现在似乎没有发生任何事情,并且没有抛出任何错误消息。 I don't see any .j3mo file having been created anywhere, and my code is still causing a runtime exception that complains about not having a loader for .x files. 我没有看到任何地方创建过.j3mo文件,我的代码仍然导致运行时异常,抱怨没有.x文件的加载器。 (Note: I saw the filename typo in my screenshot, "dwarf.x" instead of "dwarf1.x", and have since corrected it, so that is not related to the problem at all) (注意:我在屏幕截图中看到了文件名拼写错误,“dwarf.x”而不是“dwarf1.x”,并且已经纠正了它,所以这与问题无关)

Ok, found out the problem. 好的,发现了问题。 The converter was still not finding the texture, even though it had stopped reporting the error about it. 转换器仍未找到纹理,即使它已停止报告有关它的错误。 I had to rename the texture to match the model's filename exactly (except for the extension, of course), so "dwarf.jpg" became "dwarf1.jpg". 我必须重命名纹理以完全匹配模型的文件名(当然除了扩展名),所以“dwarf.jpg”变成了“dwarf1.jpg”。 Note also that it has to be in the same exact folder: in my case, I put it in the project folder/assets/Models/ 另请注意,它必须位于同一个文件夹中:在我的情况下,我把它放在项目文件夹/ assets / Models /中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM