Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bedaberner opened this issue Mar 18, 2024 · 4 comments
Open

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

bedaberner opened this issue Mar 18, 2024 · 4 comments

Comments

@bedaberner
Copy link

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
Copy link
Member

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
Copy link

domef commented Mar 22, 2024

It stops working from v2022.2.post3.

@guizy67
Copy link

guizy67 commented Jun 27, 2024

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

@stellarpower
Copy link

I am able to load meshes fine in the GUI. When I load from python, I keep seeing it replaced with "dummy.png", and without yet having taken a detailed look at the pybind11 bindings, can't for the life of me work out why some load fine and others do not.

Python 3.12.8 | packaged by conda-forge | (main, Dec  5 2024, 14:24:40) [GCC 13.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
🐍 🖥 ↴
import pymeshlab, sys
🐍 🖥 ↴
canvas = pymeshlab.MeshSet()
🐍 🖥 ↴
canvas.load_new_mesh('text.obj')
🐍 🖥 ↴
canvas.current_mesh().textures()
{'dummy.png': <pymeshlab.pmeshlab.Image object at 0x7f90903fb7f0>}
🐍 🖥 ↴

Have tried 2023.12.post2 and 2023.12, which matches the flatpak I have installed. This affects GLB/GLTF too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants