mirror of
https://github.com/facebookresearch/pytorch3d.git
synced 2025-08-02 11:52:50 +08:00
Disallow None vertex/face lists in texture submeshing
Summary: In order to simplify the interface, we disallow passing None as vertex/face lists to textures.submeshes. This function would only ever get called from within meshes.submeshes where we can provide both arguments, even if they're not necessary for a specific submesh type. Reviewed By: bottler Differential Revision: D35581161 fbshipit-source-id: aeab99308a319b144e141ca85ca7515f855116da
This commit is contained in:
parent
22f86072ca
commit
b1ff9d9fd4
@ -244,8 +244,8 @@ class TexturesBase:
|
||||
|
||||
def submeshes(
|
||||
self,
|
||||
vertex_ids_list: Optional[List[List[torch.LongTensor]]],
|
||||
faces_ids_list: Optional[List[List[torch.LongTensor]]],
|
||||
vertex_ids_list: List[List[torch.LongTensor]],
|
||||
faces_ids_list: List[List[torch.LongTensor]],
|
||||
) -> "TexturesBase":
|
||||
"""
|
||||
Extract sub-textures used for submeshing.
|
||||
@ -1477,8 +1477,8 @@ class TexturesVertex(TexturesBase):
|
||||
|
||||
def submeshes(
|
||||
self,
|
||||
vertex_ids_list: Optional[List[List[torch.LongTensor]]],
|
||||
faces_ids_list: Optional[List[List[torch.LongTensor]]],
|
||||
vertex_ids_list: List[List[torch.LongTensor]],
|
||||
faces_ids_list: List[List[torch.LongTensor]],
|
||||
) -> "TexturesVertex":
|
||||
"""
|
||||
Extract a sub-texture for use in a submesh.
|
||||
@ -1502,9 +1502,7 @@ class TexturesVertex(TexturesBase):
|
||||
sum(len(vertices) for vertices in vertex_ids_list). Each element contains
|
||||
vertex features corresponding to the subset of vertices in that submesh.
|
||||
"""
|
||||
if vertex_ids_list is None or len(vertex_ids_list) != len(
|
||||
self.verts_features_list()
|
||||
):
|
||||
if len(vertex_ids_list) != len(self.verts_features_list()):
|
||||
raise IndexError(
|
||||
"verts_features_list must be of " "the same length as vertex_ids_list."
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user