mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-07-31 10:52:50 +08:00
fix obj material indexing bug #1368
Summary: Make the negative index actually not an error fixes https://github.com/facebookresearch/pytorch3d/issues/1368 Reviewed By: das-intensity Differential Revision: D62177991 fbshipit-source-id: e5ed433bde1f54251c4d4b6db073c029cbe87343
This commit is contained in:
parent
3f428d9981
commit
9acdd67b83
@ -649,8 +649,7 @@ def _load_obj(
|
||||
# Create an array of strings of material names for each face.
|
||||
# If faces_materials_idx == -1 then that face doesn't have a material.
|
||||
idx = faces_materials_idx.cpu().numpy()
|
||||
face_material_names = np.array(material_names)[idx] # (F,)
|
||||
face_material_names[idx == -1] = ""
|
||||
face_material_names = np.array([""] + material_names)[idx + 1] # (F,)
|
||||
|
||||
# Construct the atlas.
|
||||
texture_atlas = make_mesh_texture_atlas(
|
||||
|
Loading…
x
Reference in New Issue
Block a user