why some textures did not load correctly in vedo library in python?

410 Views Asked by At

I'm trying to load some .obj files with their texture by vedo lib:

from vedo import *
from transparent import *

mesh = Mesh("3d/gol1/raw_model.obj")#load 3d model
mesh.texture("3d/gol1/texture.png")#load texture on 3d mode

plt = Plotter(offscreen=True)
plt += mesh
plt.show().screenshot("hi.png")#save as png

but in some cases, like the image below, the texture did not load correctly: the correct one: enter image description here

and we see here the result after loading texture:

loaded in vedo

2

There are 2 best solutions below

0
On BEST ANSWER

Add the line below before laod the mesh oject:

vedo.settings.use_depth_peeling = True
2
On

I'm not completely sure why that happens but depth peeling fixes it..:

from vedo import *
settings.use_depth_peeling = True
msh = Mesh("normalized_model.obj").texture("texture.png")
show(msh, axes=1)

enter image description here