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

Exporting materials #16

Closed
changfali opened this issue Aug 16, 2022 · 1 comment
Closed

Exporting materials #16

changfali opened this issue Aug 16, 2022 · 1 comment

Comments

@changfali
Copy link

I get same issue as Issues10:
An error "index 0 is out of bounds for axis 1 with size 0" occurred while exporting the material.
vertices, face_vertices, texturecoords, face_texturecoords = loadmesh_and_checkuv(mesh_fpath, out_dir)
This code gets the shape of the variables texturecoords and face_texturecoords are both (0,0). Why?

I load mesh_fpath using your code:
import igl
vertices, texturecoords, _, face_vertices, face_texturecoords, _ = igl.read_obj('./exp_iron_stage2/xmen/mesh_and_materials_50000/mesh.obj', dtype="float32")
print(vertices.shape, texturecoords.shape, face_vertices.shape, face_texturecoords.shape)

here is the result:
(1432877, 3) (0, 0) (2865856, 3) (0, 0)
Do you know why?

Traceback (most recent call last):
File "render_surface.py", line 549, in
export_mesh_and_materials(export_out_dir, sdf_network, color_network_dict)
File "render_surface.py", line 347, in export_mesh_and_materials
export_materials(os.path.join(export_out_dir, "mesh.obj"), material_predictor, export_out_dir)
File "/home/ecoplants/hdd/changfa/PBR/iron/models/export_materials.py", line 168, in export_materials
vertices, face_vertices, texturecoords, face_texturecoords = loadmesh_and_checkuv(mesh_fpath, out_dir)
File "/home/ecoplants/hdd/changfa/PBR/iron/models/export_materials.py", line 153, in loadmesh_and_checkuv
pcd, pcd_uv = sample_surface(vertices, face_vertices, texturecoords, face_texturecoords, n_samples=10**6)
File "/home/ecoplants/hdd/changfa/PBR/iron/models/export_materials.py", line 51, in sample_surface
A = texturecoords[face_texturecoords[sample_face_idx, 0], :]
IndexError: index 0 is out of bounds for axis 1 with size 0

@flow-specter
Copy link

I met the same problem... Have you solved it?

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

2 participants