Skip to content

Commit 2b4de65

Browse files
committed
Mesh : Fix variable reuse
1 parent e079e58 commit 2b4de65

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

mujoco_usd_converter/_impl/mesh.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,7 @@ def convert_obj(prim: Usd.Prim, input_path: pathlib.Path) -> UsdGeom.Mesh:
116116
points = Vt.Vec3fArray.FromNumpy(vertices_array[unique_vertex_indices])
117117

118118
normals = None
119-
source_normals = attrib.normals
120-
if len(source_normals) > 0:
119+
if len(attrib.normals) > 0:
121120
normal_indices_in_shape = np.array(obj_mesh.normal_indices(), dtype=np.int32)
122121
unique_normal_indices = np.unique(normal_indices_in_shape)
123122

@@ -133,8 +132,7 @@ def convert_obj(prim: Usd.Prim, input_path: pathlib.Path) -> UsdGeom.Mesh:
133132
normals.index() # re-index the normals to remove duplicates
134133

135134
uvs = None
136-
source_uvs = attrib.texcoords
137-
if len(source_uvs) > 0:
135+
if len(attrib.texcoords) > 0:
138136
texcoord_indices_in_shape = np.array(obj_mesh.texcoord_indices(), dtype=np.int32)
139137
unique_texcoord_indices = np.unique(texcoord_indices_in_shape)
140138

0 commit comments

Comments
 (0)