Fixing USD pipeline after copybara changes

This commit is contained in:
Abhishek Joshi
2024-08-13 11:09:02 -07:00
parent 19aa68c2b2
commit 58dc62c4ec
3 changed files with 14 additions and 7 deletions
+8 -2
View File
@@ -392,8 +392,14 @@ class USDPrimitiveMesh(USDObject):
if self.geom.size[1] > 0:
t_scale *= self.geom.size[1]
mesh_texcoord[:, 0] *= s_scale / (self.geom.size[0] * 2)
mesh_texcoord[:, 1] *= t_scale / (self.geom.size[1] * 2)
s_size, t_size = self.geom.size[:2]
if self.geom.type == mujoco.mjtGeom.mjGEOM_PLANE:
s_size = s_size if s_size > 0 else 1
t_size = t_size if t_size > 0 else 1
if self.model.mat_texuniform[self.geom.matid]:
mesh_texcoord[:, 0] *= s_scale / (s_size * 2)
mesh_texcoord[:, 1] *= t_scale / (t_size * 2)
return mesh_texcoord, mesh_facetexcoord.flatten()
+5 -5
View File
@@ -26,7 +26,7 @@ def get_triangle_uvs(
texture_type: Optional[mujoco.mjtTexture]
):
"""Returns UV coordinates for a given mesh."""
if not texture_type:
if texture_type is None:
return None
triangle_uvs = []
@@ -110,7 +110,7 @@ class TriangleMesh:
height: float,
depth: float,
texture_type: Optional[mujoco.mjtTexture]
) -> TriangleMesh:
) -> "TriangleMesh":
"""Creates a box."""
vertices = np.array([[0.0, 0.0, 0.0],
[width, 0.0, 0.0],
@@ -144,7 +144,7 @@ class TriangleMesh:
radius: float,
texture_type: Optional[mujoco.mjtTexture],
resolution: int
) -> TriangleMesh:
) -> "TriangleMesh":
"""Creates a sphere."""
vertices = []
triangles = []
@@ -178,7 +178,7 @@ class TriangleMesh:
radius: float,
texture_type: Optional[mujoco.mjtTexture],
resolution: int,
) -> TriangleMesh:
) -> "TriangleMesh":
"""Creates a hemisphere."""
vertices = []
triangles = []
@@ -218,7 +218,7 @@ class TriangleMesh:
height: float,
texture_type: Optional[mujoco.mjtTexture],
resolution: int
) -> TriangleMesh:
) -> "TriangleMesh":
"""Creates a cylinder."""
vertices = []
triangles = []
+1
View File
@@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
"""Utility functions for USD exporter."""
import numpy as np