You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @mikedh,
Thank you for maintaining this amazing repository. Geometric processing research wouldn't be what it is today without trimesh.
I've downloaded a GLB scene from the Objaverse dataset on Sketchfab (link). However, I'm struggling to load the file with trimesh while preserving the textures. When I converted the GLB scene to an OBJ file using this online converter, I was able to load it successfully, but this process isn't scalable for the entire Objaverse dataset.
I also tried loading the GLB file in Blender and exporting it as an OBJ. Although the exported file contained the geometry, it didn’t include the texture information (even though the texture appears when rendering or UV editing in Blender).
I would really appreciate any guidance you could provide on how to load the GLB file as a trimesh mesh object while retaining the textures, so I can fully utilize trimesh functionalities. Thank you so much for your time and help!
Code:
mesh = trimesh.load(file_path, process=False, force='mesh')
if hasattr(mesh.visual, 'material') and mesh.visual.material.image is not None:
print("Mesh has a texture")
print(f"Texture size: {mesh.visual.material.image.size}")
else:
print("Mesh does not have a texture")
returns "Mesh does not have a texture"
Regards,
Pradyumna.
The text was updated successfully, but these errors were encountered:
preddy5
changed the title
Loading Objaverse GLB with files with textures
Loading Objaverse GLB files with textures
Oct 21, 2024
Hi @mikedh,
Thank you for maintaining this amazing repository. Geometric processing research wouldn't be what it is today without trimesh.
I've downloaded a GLB scene from the Objaverse dataset on Sketchfab (link). However, I'm struggling to load the file with trimesh while preserving the textures. When I converted the GLB scene to an OBJ file using this online converter, I was able to load it successfully, but this process isn't scalable for the entire Objaverse dataset.
I also tried loading the GLB file in Blender and exporting it as an OBJ. Although the exported file contained the geometry, it didn’t include the texture information (even though the texture appears when rendering or UV editing in Blender).
I would really appreciate any guidance you could provide on how to load the GLB file as a trimesh mesh object while retaining the textures, so I can fully utilize trimesh functionalities. Thank you so much for your time and help!
Code:
returns "Mesh does not have a texture"
Regards,
Pradyumna.
The text was updated successfully, but these errors were encountered: