Shortcuts

grutopia.core.scene

object

class grutopia.core.scene.object.ObjectCommon(config: Object)[source]

Object common class.

classmethod register(name: str)[source]

Register an object class with the given name(decorator).

Parameters:

name (str) – name of the object

grutopia.core.scene.object.create_object(config: Object)[source]

Create an object. :param config: configuration of the objects :type config: ObjectConfig

usd_op

grutopia.core.scene.scene.util.usd_op.add_usd_ref(source_stage: Stage, dest_stage: Stage, src_prim_path: str, dest_prim_path: str) None[source]

Add an opened usd into another usd as a reference set name in dest_prim_path

Parameters:
  • source_stage (Usd.Stage) – source stage

  • dest_stage (Usd.Stage) – dest stage

  • src_prim_path (str) – source prim path

  • dest_prim_path (str) – dest prim path

grutopia.core.scene.scene.util.usd_op.add_xform_of_prim(prim: Prim, xform_op: str, set_valve: Any) None[source]

Add xform data of a prim with new data

Parameters:
  • prim (Usd.Prim) – objects prim

  • xform_op (str) – which op to be set

  • set_valve (Any) – new data to be set, could be Gf.Vec3d, Gf.Rotation

grutopia.core.scene.scene.util.usd_op.add_xform_of_prim_old(prim: Prim, xform_op: str, set_valve: Any) None[source]

Add xform data of a prim with new data

Parameters:
  • prim (Usd.Prim) – objects prim

  • xform_op (str) – which op to be set

  • set_valve (Any) – new data to be set, could be Gf.Vec3d, Gf.Rotation

grutopia.core.scene.scene.util.usd_op.compute_bbox(prim: Prim) Range3d[source]

Compute Bounding Box using ComputeWorldBound at UsdGeom.Imageable

Parameters:

prim – A prim to compute the bounding box.

Returns:

A range (i.e. bounding box)

grutopia.core.scene.scene.util.usd_op.create_new_usd(new_usd_path: str, default_prim_name: str, default_axis: str | None = None) Stage[source]

Create a new usd

Parameters:
  • new_usd_path (str) – where to place this new usd

  • default_prim_name (str) – default prim name (root prim path)

  • default_axis (str) – default axis for new usd

grutopia.core.scene.scene.util.usd_op.delete_prim_in_stage(stage: Stage, prim: Prim) None[source]

Delete a prim in stage

Parameters:
  • stage (Usd.Stage) – objects stage

  • prim (Usd.Prim) – prim to be deleted

grutopia.core.scene.scene.util.usd_op.delete_xform_of_prim(prim: Prim, xform_op: str) None[source]

Delete xform data of a prim

Parameters:
  • prim (Usd.Prim) – objects prim

  • xform_op (str) – which op to be deleted

grutopia.core.scene.scene.util.usd_op.get_local_transform_xform(prim: Prim) Tuple[Vec3d, Rotation, Vec3d][source]

Get the local transformation of a prim using Xformable.

Parameters:

prim – The prim to calculate the local transformation.

Returns:

  • Translation vector.

  • Rotation quaternion, i.e. 3d vector plus angle.

  • Scale vector.

Return type:

A tuple of

grutopia.core.scene.scene.util.usd_op.get_world_transform_xform(prim: Prim) Tuple[Vec3d, Rotation, Vec3d][source]

Get the local transformation of a prim using Xformable.

Parameters:

prim – The prim to calculate the world transformation.

Returns:

  • Translation vector.

  • Rotation quaternion, i.e. 3d vector plus angle.

  • Scale vector.

Return type:

A tuple of

grutopia.core.scene.scene.util.usd_op.set_xform_of_prim(prim: Prim, xform_op: str, set_valve: Any) None[source]

Set xform data of a prim with new data

Parameters:
  • prim (Usd.Prim) – objects prim

  • xform_op (str) – which op to be set

  • set_valve (Any) – new data to be set, could be np.array