mirror of
				https://github.com/facebookresearch/pytorch3d.git
				synced 2025-11-04 18:02:14 +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.
 | 
					        # Create an array of strings of material names for each face.
 | 
				
			||||||
        # If faces_materials_idx == -1 then that face doesn't have a material.
 | 
					        # If faces_materials_idx == -1 then that face doesn't have a material.
 | 
				
			||||||
        idx = faces_materials_idx.cpu().numpy()
 | 
					        idx = faces_materials_idx.cpu().numpy()
 | 
				
			||||||
        face_material_names = np.array(material_names)[idx]  # (F,)
 | 
					        face_material_names = np.array([""] + material_names)[idx + 1]  # (F,)
 | 
				
			||||||
        face_material_names[idx == -1] = ""
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # Construct the atlas.
 | 
					        # Construct the atlas.
 | 
				
			||||||
        texture_atlas = make_mesh_texture_atlas(
 | 
					        texture_atlas = make_mesh_texture_atlas(
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user