BachiLi / redner

Differentiable rendering without approximation.

Home Page:https://people.csail.mit.edu/tzumao/diffrt/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to load some obj files with pyredner.load_obj()

PoissonChasseur opened this issue · comments

Hello,

I am trying to use object files from BuildingNet dataset and I have the problem that none of the 1938 object files from this dataset can be loaded and all seem to have the same problem. I put an example here:

PATH = r"..\OBJ_MODELS";
file_name = os.path.join(PATH, "COMMERCIALcastle_mesh0365.obj");
objects = pyredner.load_obj(file_name, return_objects=True);

Traceback (most recent call last):

  File "D:\3D_mesh_data\BuildingNet_dataset\RedNer_tuto_data\batch_rendering.py", line 96, in <module>
    objects = pyredner.load_obj(file_name, return_objects=True, use_common_indices = True, flip_tex_coords = False);

  File "C:\Users\vincentrm\Miniconda3\envs\redner2\lib\site-packages\pyredner\load_obj.py", line 276, in load_obj
    vid0, uv_id0, n_id0 = get_vertex_id(splitted[1])

  File "C:\Users\vincentrm\Miniconda3\envs\redner2\lib\site-packages\pyredner\load_obj.py", line 244, in get_vertex_id
    normals.append(normals_pool[ni])

IndexError: list index out of range

The problem seems related to the fact that the "normals_pool" list was empty and therefore with nothing inside = index 0 and the following invalid.

I am however able to load them without problems in Blender and so the obj files seem theoretically valid. Do you know of any way I could use to work around this problem?