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

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

Open
PoissonChasseur opened this issue Feb 10, 2022 · 0 comments
Open

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

PoissonChasseur opened this issue Feb 10, 2022 · 0 comments

Comments

@PoissonChasseur
Copy link

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?

@PoissonChasseur PoissonChasseur changed the title Unable to load obj files with pyredner.load_obj() Unable to load some obj files with pyredner.load_obj() Feb 10, 2022
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

1 participant