Ursina-使用MTL文件着色自定义模型

发布于 2025-02-05 04:45:50 字数 540 浏览 2 评论 0原文

我正在使用Python 3.8,Windows 10,Ursina。

我有一个自定义的3D模型,它使用此工具。导出时,它包括一个MTL文件(我猜它用于存储形状颜色)。

当我去Ursina加载它时,它给了我以下错误:

:gobj(error): Texture::read() - couldn't read: <path>/friendly.mtl
:gobj(error): Texture "<path>/friendly.mtl" exists but cannot be read.
:gobj(error): Texture extension "mtl" is unknown.  Supported texture types:

where&lt; path&gt;是我的(正确)文件夹路径。

如何将MTL文件加载到Ursina中并将其应用于我的自定义模型?

I'm using python 3.8, Windows 10, Ursina.

I have a custom 3D model, created with this tool. When exporting, it includes an MTL file (which I'm guessing it uses to store the shape colors).

When I go to load it in Ursina, it gives me the following error:

:gobj(error): Texture::read() - couldn't read: <path>/friendly.mtl
:gobj(error): Texture "<path>/friendly.mtl" exists but cannot be read.
:gobj(error): Texture extension "mtl" is unknown.  Supported texture types:

Where <path> is my (correct) folder path.

How can I load the MTL file into Ursina and apply it to my custom model?

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

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

发布评论

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

评论(1

彻夜缠绵 2025-02-12 04:45:50

只要OBJ和MTL匹配的名称,Ursina将自动加载MTL。然后,它将根据MTL中定义的材料颜色给出顶点颜色。让您确定使用和更新的Ursina版本。您可以从github获取最新的:pip install https://github.com/pokepetter/ursina/ursina/archive/master.zip----------------------------------------------------------

ursina will load the mtl automatically as long as the name of the obj and mtl matches. It will then give it vertex colors based on the material colors defined in the mtl. Make you sure you use and updated version of ursina. You can get the most recent one from GitHub: pip install https://github.com/pokepetter/ursina/archive/master.zip --upgrade

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