cnr-isti-vclab / PyMeshLab

The open source mesh processing python library
GNU General Public License v3.0
775 stars 62 forks source link

OBJ files don't load textures in pymeshlab >2022.2 #362

Open bedaberner opened 6 months ago

bedaberner commented 6 months ago

When running the following code I get the expected result in pymeshlab 2022.2 and before. However in later versions, the textures don't seem to be imported (no textures are copied to the output folder and the .mlp file contains only the mesh, no textures.)

import pymeshlab

ms = pymeshlab.MeshSet()
ms.load_new_mesh("example.obj")
ms.save_current_mesh("output/result.obj", save_vertex_color=True,save_vertex_normal=True,save_face_color=True,save_wedge_normal=True,save_polygonal=True,save_textures=True,texture_quality=-1)
ms.save_project("test.mlp")
alemuntoni commented 6 months ago

I cannot replicate the issue. When saving a mesh, also the texture is saved in my system and in my input mesh. The mlp file not containing the textures is expected, since textures are associated with the mesh. Could you please share your input file and your system setup?

domef commented 6 months ago

It stops working from v2022.2.post3.

guizy67 commented 3 months ago

I have a similar issue, also stops working after v2022.2.post2 (last working version).

Using Set Texture filter, this is the error:

Traceback (most recent call last):
  File "/home/guizy/Meshroom/v2023-3/filtermodel.py", line 33, in <module>
    ms.set_texture_per_mesh(textname = texturefile)
  File "/home/guizy/.local/lib/python3.10/site-packages/pymeshlab/__init__.py", line 41, in foo
    res_dict = self.apply_filter(name, **kwargs)
pymeshlab.pmeshlab.PyMeshLabException: Failed to apply filter: set_texture_per_mesh
Details: Failed to load the image /home/guizy/Meshroom/v2023-3/Work/Curatio/texture_1001.jpg

On ubuntu LTS 22.04 and LTS 24.04