【问题标题】:Meshlab crashes when loading obj files with more than one png textures加载具有多个 png 纹理的 obj 文件时,Meshlab 崩溃
【发布时间】:2020-12-03 07:27:58
【问题描述】:

我有一个 OBJ 文件以及相应的 MTL 和几个 PNG 纹理。我用meshlab打开它。 This mesh file downloaded from free3d 没有在 MTL 中指定纹理 PNG 文件。所以我像这样自己添加了它:

map_Kd [texture_file_name.png]

由于有多个纹理,我在两个不同的地方添加了两行map_Kd。但是,我发现如果我只使用两个(无论哪个)map_Kd 命令中的一个,meshlab 就可以打开文件。但是如果我同时使用两个,meshlab 会在启动时崩溃。

我尝试在终端中运行它,它显示如下:

  • 正确打开(只有一个map_Kd):
user@computer:~/data/Bikes2/obj_with_text/3/OBJ$ meshlab Sepeda\ Facific\ Invert.obj 
Qt: Session management error: Could not open network socket
Current Plugins Dir is: /snap/meshlab/36/usr/lib/meshlab/plugins 
Shader directory found '/snap/meshlab/36/usr/share/meshlab/shaders', and it contains 19 gdp files
Mesh is Polygonal!
libpng warning: iCCP: known incorrect sRGB profile
LOG: 0 Opened mesh Sepeda Facific Invert.obj in 519 msec
LOG: 0 All files opened in 521 msec
libpng warning: iCCP: known incorrect sRGB profile
  • 启动时崩溃(两个map_Kd 命令):
user@computer:~/data/Bikes2/obj_with_text/3/OBJ$ meshlab Sepeda\ Facific\ Invert.obj 
Qt: Session management error: Could not open network socket
Current Plugins Dir is: /snap/meshlab/36/usr/lib/meshlab/plugins 
Shader directory found '/snap/meshlab/36/usr/share/meshlab/shaders', and it contains 19 gdp files
Mesh is Polygonal!
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
Segmentation fault (core dumped)

有人知道为什么吗?是 meshlab 的错误还是我做错了什么?

如果重要的话,我正在使用 Ubuntu20.04 和从 Ubuntu 软件中心安装的 Meshlab_64bit_fp v2020.12。


更新 1: Windows 10 上的 Meshlab_64bit_fp v2020.03 行为相同。


更新 2:

为了使其可重现,我在下面发布了我的 MTL 文件。我添加的两个map_Kd 命令分别位于第184 行(newmtl col_rangka_wadah_perr 下)和最后一行。

# Blender MTL File: 'Sepeda Facific Invert.blend'
# Material Count: 29

newmtl Material
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

newmtl Material.002
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

newmtl Material.003
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

newmtl Material.004
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

newmtl Material.005
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

newmtl Material.006
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

newmtl Material.007
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

newmtl None
Ns 0.000000
Ka 0.000000 0.000000 0.000000
Kd 0.800000 0.800000 0.800000
Ks 0.800000 0.800000 0.800000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

newmtl ban_luar.001
Ns 94.117647
Ka 1.000000 1.000000 1.000000
Kd 0.064007 0.064007 0.064007
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

newmtl col_ban
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

newmtl col_casing_hp
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

newmtl col_jari2
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

newmtl col_lantai
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

newmtl col_master_btl
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

newmtl col_pegangan_stank
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

newmtl col_pelek
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

newmtl col_rangka_per_sepeda
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2


newmtl col_rangka_wadah_perr
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
#map_Kd uv_rangka.png

newmtl col_uv_btl
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

newmtl dominan.001
Ns 94.117647
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

newmtl gear.001
Ns 94.117647
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

newmtl guma.001
Ns 94.117647
Ka 1.000000 1.000000 1.000000
Kd 0.301176 0.301176 0.301176
Ks 0.447059 0.447059 0.447059
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

newmtl skp_front_defaul.001
Ns 94.117647
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.447059 0.447059 0.447059
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

newmtl steel_whiter.001
Ns 94.117647
Ka 1.000000 1.000000 1.000000
Kd 0.589804 0.589804 0.589804
Ks 0.447059 0.447059 0.447059
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

newmtl uv_ban_kanan
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

newmtl uv_ban_kiri
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

newmtl uv_hp
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

newmtl uv_pelek_kanan
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

newmtl uv_pelek_kiri
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
map_Kd uv_pelek_kiri.png

【问题讨论】:

  • 嗨,这似乎更适合meshlab的开发人员,而不是用户。请在 meshlab github 页面中将其报告为错误。无论如何,我会尝试重现您的问题。我过去曾在 meshlab 中使用过具有多个纹理的文件。
  • @Rockcat 谢谢。由于我是 3d 图形的初学者,我不确定这是否是一个错误。所以我想在询问开发人员之前先确认一下。
  • @Rockcat 我发布了我的 MTL 文件版本,如果它有助于重现问题。
  • @Rockcat 再问一个问题,我刚刚发现,当我只使用一个png文件时,即使程序打开正确,但纹理映射似乎是错误的。我猜我的 MTL 文件有问题?

标签: 3d textures meshlab mtl-file


【解决方案1】:

可以确认这似乎是 meshlab OBJ 导入器中的错误。

我已经使用批处理 meshlabserver 程序管理了一个解决方法。

  1. 我编辑了 mtl 文件以使用 map_Kd filename.png 行添加多个纹理,与您所做的相同。
  2. 使用命令行转换文件:

meshlabserver -i Sepeda\ Facific\ Invert.obj -o fixed.obj -m wt

并获得了一个 meshlab 可以正确加载的文件:

【讨论】:

  • 谢谢!这对我有用。但是这行代码到底发生了什么?另外,我想在导入后将纹理导出到一个文件中,但 meshlab 导出选项似乎不包含此功能。我在这里问了一个单独的问题:stackoverflow.com/questions/65125378/…。希望你能看一看(当然,如果你有时间的话)。再次感谢!
猜你喜欢
  • 2020-07-05
  • 2013-08-24
  • 2015-08-30
  • 1970-01-01
  • 2017-10-03
  • 1970-01-01
  • 2017-10-04
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多