Skip to content

Commit

Permalink
Update CreateMeshPrimWithDefaultXformCommand to 2023.1.0 version (whi…
Browse files Browse the repository at this point in the history
…ch is hopefully backwards compatible)
  • Loading branch information
cgokmen committed Oct 5, 2023
1 parent 1d40a33 commit 7283d7f
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions omnigibson/utils/deprecated_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __init__(self, prim_type: str, **kwargs):
prim_type (str): It supports Plane/Sphere/Cone/Cylinder/Disk/Torus/Cube.
kwargs:
object_origin (Gf.Vec3f): Position of mesh center.
object_origin (Gf.Vec3f): Position of mesh center in stage units.
u_patches (int): The number of patches to tessellate U direction.
Expand All @@ -31,7 +31,7 @@ def __init__(self, prim_type: str, **kwargs):
w_patches (int): The number of patches to tessellate W direction.
It only works for Cone/Cylinder/Cube.
half_scale (float): Half size of mesh. Default None.
half_scale (float): Half size of mesh in centimeters. Default is None, which means it's controlled by settings.
u_verts_scale (int): Tessellation Level of U. It's a multiplier of u_patches.
Expand All @@ -42,23 +42,22 @@ def __init__(self, prim_type: str, **kwargs):
For Cone/Cylinder, it's to tessellate the caps.
For Cube, it's to tessellate along z-axis.
above_ground (bool): It will offset the center of mesh above the ground plane if it's True,
False otherwise. It's False by default. This param only works when param object_origin is not given.
Otherwise, it will be ignored.
stage (Usd.Stage): If specified, stage to create prim on
"""

self._prim_type = prim_type[0:1].upper() + prim_type[1:].lower()
self._usd_context = omni.usd.get_context()
self._selection = self._usd_context.get_selection()
self._stage = kwargs.get("stage", self._usd_context.get_stage())
self._settings = carb.settings.get_settings()
self._prim_path = None
self._default_path = None
self._prepend_default_prim = True
if "prim_path" in kwargs and kwargs["prim_path"]:
self._default_path = Sdf.Path(kwargs["prim_path"])
self._select_new_prim = True
if "select_new_prim" in kwargs:
self._select_new_prim = bool(kwargs["select_new_prim"])
if "prepend_default_prim" in kwargs:
self._prepend_default_prim = bool(kwargs["prepend_default_prim"])
self._default_path = kwargs.get("prim_path", None)
self._select_new_prim = kwargs.get("select_new_prim", True)
self._prepend_default_prim = kwargs.get("prepend_default_prim", True)
self._above_round = kwargs.get("above_ground", False)

self._attributes = {**kwargs}
# Supported mesh types should have an associated evaluator class
Expand Down

0 comments on commit 7283d7f

Please sign in to comment.