Ursina-使用MTL文件着色自定义模型
我正在使用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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只要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