PYTHON API#

Core Functions#

omni.replicator.core.get_global_seed()#

Return global seed value

Returns:

(int)seed value

omni.replicator.core.set_global_seed(seed: int)#

Set a global seed.

Parameters:

seed – Seed to use as initialization for the pseudo-random number generator. Seed is expected to be a non-negative integer.

omni.replicator.core.new_layer(name: str = None)#

Create a new authoring layer context. Use new_layer to keep replicator changes into a contained layer. If a layer of the same name already exists, the layer will be cleared before new changes are applied.

Parameters:

name – Name of the layer to be created. If ommitted, the name “Replicator” is used.

Example

>>> import omni.replicator.core as rep
>>> with rep.new_layer():
>>>     rep.create.cone(count=100, position=rep.distribution.uniform((-100,-100,-100),(100,100,100)))
omni.replicator.core.open_stage(
stage_path: str | Path | usdrt.Sdf.Path,
) Stage#

Helper method to open a new stage from a Usd file

Parameters:

stage_path – File path to the stage to load

Create#

create methods are helpers to put objects onto the USD stage.

omni.replicator.core.create.render_product(
camera: ReplicatorItem | str | List[str] | Path | List[Path] | usdrt.Usd.Prim | List[usdrt.Usd.Prim],
resolution: Tuple[int, int],
force_new: bool = False,
name: str | List[str] = None,
render_vars: List[str] = None,
) str | List#

Create a render product A RenderProduct describes images or other file-like artifacts produced by a render, such as rgb (LdrColor), normals, depth, etc. If an existing render product exists that have the same resolution and camera attached, it is returned. If no matching render product is found or if force_new is set to True, a new render product is created.

By default, the following render variables are automatically created for each render product: - LdrColor (RGB): The final rendered image - Depth: Linear depth from camera - InstanceSegmentation: Instance segmentation mask - SemanticSegmentation: Semantic segmentation mask - WorldPosition: World space position of each pixel - WorldNormals: World space normals - MotionVectors: Motion vectors for temporal effects

Note: When using Viewport 2.0, viewports are not generated to draw the render product on screen. Note: Render products can utilize a large amount of VRAM. Render Products no longer in use should be destroyed.

Parameters:
  • camera – The camera prim (pxr.Usd.Camera) or OmniSensor to attach to the render product. If a list of cameras is provided, a list of render products is created.

  • resolution – (width, height) resolution of the render product

  • force_new – If True, force creation of a new render product. If False, existing render products will be re-used if currently assigned to same camera and of the same resolution. Is overriden to True if a name is provided.

  • name – Optionally specify the name(s) of the render product(s). Name must produce a valid USD path. If no name is provided, defaults to Replicator. The render product will be created at the following path within the Session Layer: /Render/<render product prefix><name> where <render product prefix> is HydraTextures/ by default. If multiple cameras are provided or if a render product of the specified name already exists, a _<num> suffix is added starting at _01. If specifying unique names for multiple cameras, name can be supplied as a list of strings of the same length as camera.

  • render_vars – List of custom render variables to create. Valid options include: [“GenericModelOutput”, “RtxSensorCpu”, “RtxSensorGpu”, “RtxSensorMetadata”]. If None, default render variables are created.

Example

>>> import omni.replicator.core as rep
>>> render_product = rep.create.render_product(
...     rep.create.camera(), resolution=(1024, 1024), name="MyRenderProduct"
... )
>>> # Create render product with custom render variables
>>> render_product = rep.create.render_product(
...     rep.create.camera(), resolution=(1024, 1024),
...     render_vars=["GenericModelOutput", "RtxSensorMetadata"]
... )
omni.replicator.core.create.register(
fn: Callable[[...], ReplicatorItem | omni.graph.core.Node],
override: bool = True,
fn_name: str | None = None,
) None#

Register a new function under omni.replicator.core.create. Extend the default capabilities of omni.replicator.core.create by registering new functionality. New functions must return a ReplicatorItem or an OmniGraph node.

Parameters:
  • fn – A function that returns a ReplicatorItem or an OmniGraph node.

  • override – If True, will override existing functions of the same name. If False, an error is raised.

  • fn_name – Optional arg that let user choose the function name when registering it in replicator. If not specified, the function name is used. fn_name must follow valid [Python identifier rules] (https://docs.python.org/3.10/reference/lexical_analysis.html#identifiers)

Example

>>> import omni.replicator.core as rep
>>> def light_cluster(num_lights: int = 10):
...     lights = rep.create.light(
...         light_type="sphere",
...         count=num_lights,
...         position=rep.distribution.uniform((-500, -500, -500), (500, 500, 500)),
...         intensity=rep.distribution.uniform(10000, 20000),
...         temperature=rep.distribution.uniform(1000, 10000),
...     )
...     return lights
>>> rep.create.register(light_cluster)
>>> lights = rep.create.light_cluster(50)

Lights#

omni.replicator.core.create.light(
position: ReplicatorItem | float | Tuple[float] = None,
scale: ReplicatorItem | float | Tuple[float] = None,
rotation: ReplicatorItem | float | Tuple[float] = None,
look_at: ReplicatorItem | str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: ReplicatorItem | Tuple[float] = None,
light_type: str = 'Distant',
color: ReplicatorItem | Tuple[float, float, float] = (1.0, 1.0, 1.0),
intensity: ReplicatorItem | float = 1000.0,
exposure: ReplicatorItem | float = None,
temperature: ReplicatorItem | float = 6500,
texture: ReplicatorItem | str = None,
count: int = 1,
name: str | None = None,
parent: ReplicatorItem | str | Path | Prim = None,
) ReplicatorItem#

Create a light

Parameters:
  • position – XYZ coordinates in world space. If a single value is provided, all axes will be set to that value. Ignored for dome and distant light types.

  • scale – Scaling factors for XYZ axes. If a single value is provided, all axes will be set to that value. Ignored for dome and distant light types.

  • rotation – Euler angles in degrees in XYZ order. If a single value is provided, all axes will be set to that value.

  • look_at – Look-at target, specified either as a ReplicatorItem, a prim path, or world coordinates. If multiple prims are set, the target point will be the mean of their positions.

  • look_at_up_axis – Look-at up axis of the created prim.

  • light_type – Light type. Select from [“cylinder”, “disk”, “distant”, “dome”, “rect”, “sphere”]

  • color – Light color in (R,G,B). Float values from [0.0-1.0]

  • intensity – Light intensity. Scales the power of the light linearly.

  • exposure – Scales the power of the light exponentially as a power of 2. The result is multiplied with intensity.

  • temperature – Color temperature in degrees Kelvin indicating the white point. Lower values are warmer, higher values are cooler. Valid range [1000-10000].

  • texture – Image texture to use for dome light such as an HDR (High Dynamic Range) intended for IBL (Image Based Lighting). Ignored for other light types.

  • count – Number of objects to create.

  • name – Name of the light.

  • parent – Optional parent prim path. The object will be created as a child of this prim.

Examples

>>> import omni.replicator.core as rep
>>> distance_light = rep.create.light(
...     rotation=rep.distribution.uniform((0,-180,-180), (0,180,180)),
...     intensity=rep.distribution.normal(10000, 1000),
...     temperature=rep.distribution.normal(6500, 1000),
...     light_type="distant"
... )
>>> dome_light = rep.create.light(
...     rotation=rep.distribution.uniform((0,-180,-180), (0,180,180)),
...     texture=rep.distribution.choice(rep.example.TEXTURES),
...     light_type="dome"
... )

Misc#

omni.replicator.core.create.group(
items: List[ReplicatorItem | str | Path],
semantics: Dict[str, List | str] | List[Tuple[str, str]] = None,
name=None,
) ReplicatorItem#

Group assets into a common node. Grouping assets makes it easier and faster to apply randomizations to multiple assets simultaneously.

Parameters:
  • items – Assets to be grouped together.

  • semantics – Dictionary specifying semantic type and values. Legacy lists of tuples are also accepted but will be converted to dictionaries.

  • name (optional) – A name for the given group node

Example

>>> import omni.replicator.core as rep
>>> cones = [rep.create.cone() for _ in range(100)]
>>> group = rep.create.group(cones, semantics={"class": "cone"})

Cameras#

omni.replicator.core.create.camera(
position: ReplicatorItem | float | Tuple[float] = None,
rotation: ReplicatorItem | float | Tuple[float] = None,
look_at: ReplicatorItem | str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: ReplicatorItem | Tuple[float] = None,
focal_length: ReplicatorItem | float = 24.0,
focus_distance: ReplicatorItem | float = 400.0,
f_stop: ReplicatorItem | float = 0.0,
horizontal_aperture: ReplicatorItem | float = 20.955,
horizontal_aperture_offset: ReplicatorItem | float = 0.0,
vertical_aperture_offset: ReplicatorItem | float = 0.0,
clipping_range: ReplicatorItem | Tuple[float, float] = (1.0, 1000000.0),
projection_type: ReplicatorItem | str = 'pinhole',
fisheye_nominal_width: ReplicatorItem | float = 1936.0,
fisheye_nominal_height: ReplicatorItem | float = 1216.0,
fisheye_optical_centre_x: ReplicatorItem | float = 970.94244,
fisheye_optical_centre_y: ReplicatorItem | float = 600.37482,
fisheye_max_fov: ReplicatorItem | float = 200.0,
fisheye_polynomial_a: ReplicatorItem | float = 0.0,
fisheye_polynomial_b: ReplicatorItem | float = 0.00245,
fisheye_polynomial_c: ReplicatorItem | float = 0.0,
fisheye_polynomial_d: ReplicatorItem | float = 0.0,
fisheye_polynomial_e: ReplicatorItem | float = 0.0,
fisheye_polynomial_f: ReplicatorItem | float = 0.0,
fisheye_p0: ReplicatorItem | float = -0.00037,
fisheye_p1: ReplicatorItem | float = -0.00074,
fisheye_s0: ReplicatorItem | float = -0.00058,
fisheye_s1: ReplicatorItem | float = -0.00022,
fisheye_s2: ReplicatorItem | float = 0.00019,
fisheye_s3: ReplicatorItem | float = -0.0002,
cross_camera_reference_name: str | None = None,
count: int = 1,
parent: ReplicatorItem | str | Path | Prim = None,
name: str | None = None,
) ReplicatorItem#

Create a camera

Parameters:
  • position – XYZ coordinates in world space. If a single value is provided, all axes will be set to that value.

  • rotation – Euler angles in degrees in XYZ order. If a single value is provided, all axes will be set to that value.

  • look_at – Look-at target, specified either as a ReplicatorItem, a prim path, or world coordinates. If multiple prims are set, the target point will be the mean of their positions.

  • look_at_up_axis – Look-at up axis of the created prim.

  • focal_length – Physical focal length of the camera in units equal to 0.1 * world units.

  • focus_distance – Distance from the camera to the focus plane in world units.

  • f_stop – Lens aperture. Default 0.0 turns off focusing.

  • horizontal_aperture – Horizontal aperture in units equal to 0.1 * world units. Default simulates a 35mm spherical projection aperture.

  • horizontal_aperture_offset – Horizontal aperture offset in units equal to 0.1 * world units.

  • vertical_aperture_offset – Vertical aperture offset in units equal to 0.1 * world units.

  • clipping_range – (Near, Far) clipping distances of the camera in world units.

  • projection_type – Camera projection model. Select from [“pinhole”, “pinholeOpenCV”, “fisheye_polynomial”, “fisheyeSpherical”, “fisheyeKannalaBrandtK3”, “fisheyeRadTanThinPrism”, “fisheyeOpenCV”, “omniDirectionalStereo”, “generalizedProjection”].

  • fisheye_nominal_width – Nominal width of fisheye lens model.

  • fisheye_nominal_height – Nominal height of fisheye lens model.

  • fisheye_optical_centre_x – Horizontal optical centre position of fisheye lens model.

  • fisheye_optical_centre_y – Vertical optical centre position of fisheye lens model.

  • fisheye_max_fov – Maximum field of view of fisheye lens model.

  • fisheye_polynomial_a – First polynomial coefficient of fisheye camera.

  • fisheye_polynomial_b – Second polynomial coefficient of fisheye camera.

  • fisheye_polynomial_c – Third polynomial coefficient of fisheye camera.

  • fisheye_polynomial_d – Fourth polynomial coefficient of fisheye camera.

  • fisheye_polynomial_e – Fifth polynomial coefficient of fisheye camera.

  • fisheye_polynomial_f – Sixth polynomial coefficient of fisheye camera.

  • fisheye_p0 – Distortion coefficient to calculate tangential distortion for rad tan thin prism camera.

  • fisheye_p1 – Distortion coefficient to calculate tangential distortion for rad tan thin prism camera.

  • fisheye_s0 – Distortion coefficient to calculate thin prism distortion for rad tan thin prism camera.

  • fisheye_s1 – Distortion coefficient to calculate thin prism distortion for rad tan thin prism camera.

  • fisheye_s2 – Distortion coefficient to calculate thin prism distortion for rad tan thin prism camera.

  • fisheye_s3 – Distortion coefficient to calculate thin prism distortion for rad tan thin prism camera.,

  • count – Number of objects to create.

  • parent – Optional parent prim path. The camera will be created as a child of this prim.

  • name – Name of the camera

Example

>>> import omni.replicator.core as rep
>>> # Create camera
>>> camera = rep.create.camera(
...     position=rep.distribution.uniform((0,0,0), (100, 100, 100)),
...     rotation=(45, 45, 0),
...     focus_distance=rep.distribution.normal(400.0, 100),
...     f_stop=1.8,
... )
>>> # Attach camera to render product
>>> render_product = rep.create.render_product(camera, resolution=(1024, 1024))
omni.replicator.core.create.stereo_camera(
stereo_baseline: ReplicatorItem | float,
position: ReplicatorItem | float | Tuple[float] = None,
rotation: ReplicatorItem | float | Tuple[float] = None,
look_at: ReplicatorItem | str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: ReplicatorItem | Tuple[float] = None,
focal_length: ReplicatorItem | float = 24.0,
focus_distance: ReplicatorItem | float = 400.0,
f_stop: ReplicatorItem | float = 0.0,
horizontal_aperture: ReplicatorItem | float = 20.955,
horizontal_aperture_offset: ReplicatorItem | float = 0.0,
vertical_aperture_offset: ReplicatorItem | float = 0.0,
clipping_range: ReplicatorItem | Tuple[float, float] = (1.0, 1000000.0),
projection_type: ReplicatorItem | str = 'pinhole',
fisheye_nominal_width: ReplicatorItem | float = 1936.0,
fisheye_nominal_height: ReplicatorItem | float = 1216.0,
fisheye_optical_centre_x: ReplicatorItem | float = 970.94244,
fisheye_optical_centre_y: ReplicatorItem | float = 600.37482,
fisheye_max_fov: ReplicatorItem | float = 200.0,
fisheye_polynomial_a: ReplicatorItem | float = 0.0,
fisheye_polynomial_b: ReplicatorItem | float = 0.00245,
fisheye_polynomial_c: ReplicatorItem | float = 0.0,
fisheye_polynomial_d: ReplicatorItem | float = 0.0,
fisheye_polynomial_e: ReplicatorItem | float = 0.0,
fisheye_polynomial_f: ReplicatorItem | float = 0.0,
fisheye_p0: ReplicatorItem | float = -0.00037,
fisheye_p1: ReplicatorItem | float = -0.00074,
fisheye_s0: ReplicatorItem | float = -0.00058,
fisheye_s1: ReplicatorItem | float = -0.00022,
fisheye_s2: ReplicatorItem | float = 0.00019,
fisheye_s3: ReplicatorItem | float = -0.0002,
count: int = 1,
name: str | None = None,
parent: ReplicatorItem | str | Path | Prim = None,
) ReplicatorItem#

Create a stereo camera pair.

Parameters:
  • stereo_baseline – Distance between stereo camera pairs.

  • position – XYZ coordinates in world space. If a single value is provided, all axes will be set to that value.

  • rotation – Euler angles in degrees in XYZ order. If a single value is provided, all axes will be set to that value.

  • look_at – Look-at target, specified either as a ReplicatorItem, a prim path or as coordinates. If multiple prims are set, the target point will be the mean of their positions.

  • look_at_up_axis – Look-at up axis of the created prim.

  • focal_length – Physical focal length of the camera in units equal to 0.1 * world units.

  • focus_distance – Distance from the camera to the focus plane in world units.

  • f_stop – Lens aperture. Default 0.0 turns off focusing.

  • horizontal_aperture – Horizontal aperture in units equal to 0.1 * world units. Default simulates a 35mm spherical projection aperture.

  • horizontal_aperture_offset – Horizontal aperture offset in units equal to 0.1 * world units.

  • vertical_aperture_offset – Vertical aperture offset in units equal to 0.1 * world units.

  • clipping_range – (Near, Far) clipping distances of the camera in world units.

  • projection_type – Camera projection model. Select from [“pinhole”, “fisheye_polynomial”,”fisheyeSpherical”, fisheyeKannalaBrandtK3”, “fisheyeRadTanThinPrism”, “fisheyeOpenCV”, “generalizedProjection”].

  • fisheye_nominal_width – Nominal width of fisheye lens model.

  • fisheye_nominal_height – Nominal height of fisheye lens model.

  • fisheye_optical_centre_x – Horizontal optical centre position of fisheye lens model.

  • fisheye_optical_centre_y – Vertical optical centre position of fisheye lens model.

  • fisheye_max_fov – Maximum field of view of fisheye lens model.

  • fisheye_polynomial_a – 1st component of fisheye polynomial (only valid for fisheye_polynomial projection type).

  • fisheye_polynomial_b – 2nd component of fisheye polynomial (only valid for fisheye_polynomial projection type).

  • fisheye_polynomial_c – 3rd component of fisheye polynomial (only valid for fisheye_polynomial projection type).

  • fisheye_polynomial_d – 4th component of fisheye polynomial (only valid for fisheye_polynomial projection type).

  • fisheye_polynomial_e – 5th component of fisheye polynomial (only valid for fisheye_polynomial projection type).

  • count – Number of objects to create.

  • name – Name of the cameras. _L and _R will be appended for Left and Right cameras, respectively.

  • parent – Optional parent prim path. The cameras will be created as a child of this prim.

Example

>>> import omni.replicator.core as rep
>>> # Create stereo camera
>>> stereo_camera_pair = rep.create.stereo_camera(
...     stereo_baseline=10,
...     position=(10, 10, 10),
...     rotation=(45, 45, 0),
...     focus_distance=rep.distribution.normal(400.0, 100),
...     f_stop=1.8,
... )
>>> # Attach camera to render product
>>> render_product = rep.create.render_product(stereo_camera_pair, resolution=(1024, 1024))

Materials#

omni.replicator.core.create.material_omnipbr(
diffuse: Tuple[float] = None,
diffuse_texture: str = None,
roughness: float = None,
roughness_texture: str = None,
metallic: float = None,
metallic_texture: str = None,
specular: float = None,
emissive_color: Tuple[float] = None,
emissive_texture: str = None,
emissive_intensity: float = 0.0,
project_uvw: bool = False,
semantics: Dict[str, List | str] | List[Tuple[str, str]] = None,
count: int = 1,
) ReplicatorItem#

Create an OmniPBR Material

Parameters:
  • diffuse – Diffuse/albedo color in RGB colorspace

  • diffuse_texture – Path to diffuse texture

  • roughness – Material roughness in the range [0, 1]

  • roughness_texture – Path to roughness texture

  • metallic – Material metallic value in the range [0, 1]. Typically, metallic is assigned either 0.0 or 1.0

  • metallic_texture – Path to metallic texture

  • specular – Intensity of specular reflections in the range [0, 1]

  • emissive_color – Color of emissive light emanating from material in RGB colorspace

  • emissive_texture – Path to emissive texture

  • emissive_intensity – Emissive intensity of the material. Setting to 0.0 (default) disables emission.

  • project_uvw – When True, UV coordinates will be generated by projecting them from a coordinate system.

  • semantics – Assign semantics to material

  • count – Number of objects to create.

Example

>>> import omni.replicator.core as rep
>>> mat1 = rep.create.material_omnipbr(
...    diffuse=rep.distribution.uniform((0, 0, 0), (1, 1, 1)),
...    roughness=rep.distribution.uniform(0, 1),
...    metallic=rep.distribution.choice([0, 1]),
...    emissive_color=rep.distribution.uniform((0, 0, 0.5), (0, 0, 1)),
...    emissive_intensity=rep.distribution.uniform(0, 1000),
... )
>>> mat2 = rep.create.material_omnipbr(
...    diffuse_texture=rep.distribution.choice(rep.example.TEXTURES),
...    roughness_texture=rep.distribution.choice(rep.example.TEXTURES),
...    metallic_texture=rep.distribution.choice(rep.example.TEXTURES),
...    emissive_texture=rep.distribution.choice(rep.example.TEXTURES),
...    emissive_intensity=rep.distribution.uniform(0, 1000),
... )
>>> cone = rep.create.cone(material=mat1)
>>> torus = rep.create.torus(material=mat2)
omni.replicator.core.create.projection_material(
proxy_prim: ReplicatorItem | str | Path,
semantics: Dict[str, List | str] | List[Tuple[str, str]] = None,
material: ReplicatorItem | str | Path = None,
offset_scale: float = 0.01,
input_prims: ReplicatorItem | List[str] = None,
name: str | None = None,
) ReplicatorItem#

Project a texture onto a target prim.

ProjectPBRMaterial is used to facilitate these projections. The proxy prim is a prim used to control the position, rotation and scale of the projection. There can only be one proxy/projection pair, so a proxy prim can only modify a single projection. The projection will happen in the direction of the negative x-axis. This node only sets up the projection material, the rep.modify.projection_material node should be used to update the projection itself.

Parameters:
  • proxy_prim – The prims which will be used to manipulate the projection.

  • material – Projection material to apply to the projection. If not provided, use ‘ProjectPBRMaterial’.

  • semantics – Semantics to apply to the defect.

  • offset_scale – Scale factor when extruding target_prim points.

  • input_prims – The prim which will be projected on to. If using with syntax, this argument can be omitted.

  • name (optional) – A name for the given projection node.

Example

>>> import omni.replicator.core as rep
>>> torus = rep.create.torus()
>>> cube = rep.create.cube(position=(50, 100, 0), rotation=(0, 0, 90), scale=(0.2, 0.2, 0.2))
>>> sem = [('class', 'shape')]
>>> with torus:
...     rep.create.projection_material(cube, sem)
omni.replicator.core.create.projection_material
omni.replicator.core.create.mdl_from_json(
material_def: Dict = None,
material_def_path: str = None,
) ReplicatorItem#

Create a MDL ShaderGraph material defined in a json dictionary.

Parameters:
  • material_def – A dictionary object defining the MDL material graph.

  • material_def_path – A path to a json file to decode and generate an MDL material graph from.

Example

>>> import omni.replicator.core as rep
>>> gen_mat = rep.create.mdl_from_json(material_def=rep.example.MDL_JSON_EXAMPLE)
>>> cube = rep.create.cube(material=gen_mat)

Shapes#

omni.replicator.core.create.cone(
position: ReplicatorItem | float | Tuple[float] = None,
scale: ReplicatorItem | float | Tuple[float] = None,
pivot: ReplicatorItem | Tuple[float] = None,
rotation: ReplicatorItem | float | Tuple[float] = None,
look_at: ReplicatorItem | str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: ReplicatorItem | Tuple[float] = None,
semantics: Dict[str, List | str] | List[Tuple[str, str]] = None,
material: ReplicatorItem | Prim = None,
visible: bool = True,
as_mesh: bool = True,
count: int = 1,
name: str | None = None,
parent: ReplicatorItem | str | Path | Prim = None,
) ReplicatorItem#

Create a cone

Parameters:
  • position – XYZ coordinates in world space. If a single value is provided, all axes will be set to that value.

  • scale – Scaling factors for XYZ axes. If a single value is provided, all axes will be set to that value.

  • pivot – Pivot that sets the center point of translate and rotate operation. Pivot values are normalized between [-1, 1] for each axis based on the prim’s axis aligned extents.

  • rotation – Euler angles in degrees in XYZ order. If a single value is provided, all axes will be set to that value.

  • look_at – Look-at target, specified either as a ReplicatorItem, a prim path, or world coordinates. If multiple prims are set, the target point will be the mean of their positions.

  • look_at_up_axis – Look-at up axis of the created prim.

  • semantics – Dictionary specifying semantic type and values. Legacy lists of tuples are also accepted but will be converted to dictionaries.

  • material – Material to attach to the cone.

  • visible – If False, the prim will be invisible. This is often useful when creating prims to use as bounds with other randomizers.

  • as_mesh – If False, create a Usd.Cone prim. If True, create a mesh.

  • count – Number of objects to create.

  • name – Name of the object.

  • parent – Optional parent prim path. The object will be created as a child of this prim.

Example

>>> import omni.replicator.core as rep
>>> cone = rep.create.cone(
...     position=rep.distribution.uniform((0,0,0), (100, 100, 100)),
...     scale=2,
...     rotation=(45, 45, 0),
...     semantics={"class": "cone"},
... )
omni.replicator.core.create.cube(
position: ReplicatorItem | float | Tuple[float] = None,
scale: ReplicatorItem | float | Tuple[float] = None,
pivot: ReplicatorItem | Tuple[float] = None,
rotation: ReplicatorItem | float | Tuple[float] = None,
look_at: ReplicatorItem | str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: ReplicatorItem | Tuple[float] = None,
semantics: Dict[str, List | str] | List[Tuple[str, str]] = None,
material: ReplicatorItem | Prim = None,
visible: bool = True,
as_mesh: bool = True,
count: int = 1,
name: str | None = None,
parent: ReplicatorItem | str | Path | Prim = None,
) ReplicatorItem#

Create a cube

Parameters:
  • position – XYZ coordinates in world space. If a single value is provided, all axes will be set to that value.

  • scale – Scaling factors for XYZ axes. If a single value is provided, all axes will be set to that value.

  • pivot – Pivot that sets the center point of translate and rotate operation. Pivot values are normalized between [-1, 1] for each axis based on the prim’s axis aligned extents.

  • rotation – Euler angles in degrees in XYZ order. If a single value is provided, all axes will be set to that value.

  • look_at – Look-at target, specified either as a ReplicatorItem, a prim path, or world coordinates. If multiple prims are set, the target point will be the mean of their positions.

  • look_at_up_axis – Look-at up axis of the created prim.

  • semantics – Dictionary specifying semantic type and values. Legacy lists of tuples are also accepted but will be converted to dictionaries.

  • material – Material to attach to the cube.

  • visible – If False, the prim will be invisible. This is often useful when creating prims to use as bounds with other randomizers.

  • as_mesh – If False, create a Usd.Cube prim. If True, create a mesh.

  • count – Number of objects to create.

  • name – Name of the object

  • parent – Optional parent prim path. The object will be created as a child of this prim.

Example

>>> import omni.replicator.core as rep
>>> cube = rep.create.cube(
...     position=rep.distribution.uniform((0,0,0), (100, 100, 100)),
...     scale=2,
...     rotation=(45, 45, 0),
...     semantics={"class": "cube"},
... )
omni.replicator.core.create.cylinder(
position: ReplicatorItem | float | Tuple[float] = None,
scale: ReplicatorItem | float | Tuple[float] = None,
pivot: ReplicatorItem | Tuple[float] = None,
rotation: ReplicatorItem | float | Tuple[float] = None,
look_at: ReplicatorItem | str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: ReplicatorItem | Tuple[float] = None,
semantics: Dict[str, List | str] | List[Tuple[str, str]] = None,
material: ReplicatorItem | Prim = None,
visible: bool = True,
as_mesh: bool = True,
count: int = 1,
name: str | None = None,
parent: ReplicatorItem | str | Path | Prim = None,
) ReplicatorItem#

Create a cylinder

Parameters:
  • position – XYZ coordinates in world space. If a single value is provided, all axes will be set to that value.

  • scale – Scaling factors for XYZ axes. If a single value is provided, all axes will be set to that value.

  • pivot – Pivot that sets the center point of translate and rotate operation. Pivot values are normalized between [-1, 1] for each axis based on the prim’s axis aligned extents.

  • rotation – Euler angles in degrees in XYZ order. If a single value is provided, all axes will be set to that value.

  • look_at – Look-at target, specified either as a ReplicatorItem, a prim path, or world coordinates. If multiple prims are set, the target point will be the mean of their positions.

  • look_at_up_axis – Look-at up axis of the created prim.

  • semantics – Dictionary specifying semantic type and values. Legacy lists of tuples are also accepted but will be converted to dictionaries.

  • material – Material to attach to the cylinder.

  • visible – If False, the prim will be invisible. This is often useful when creating prims to use as bounds with other randomizers.

  • as_mesh – If False, create a Usd.Cylinder prim. If True, create a mesh.

  • count – Number of objects to create.

  • name – Name of the object

  • parent – Optional parent prim path. The object will be created as a child of this prim.

Example

>>> import omni.replicator.core as rep
>>> cylinder = rep.create.cylinder(
...     position=rep.distribution.uniform((0,0,0), (100, 100, 100)),
...     scale=2,
...     rotation=(45, 45, 0),
...     semantics={"class": "cylinder"},
... )
omni.replicator.core.create.disk(
position: ReplicatorItem | float | Tuple[float] = None,
scale: ReplicatorItem | float | Tuple[float] = None,
pivot: ReplicatorItem | Tuple[float] = None,
rotation: ReplicatorItem | float | Tuple[float] = None,
look_at: ReplicatorItem | str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: ReplicatorItem | Tuple[float] = None,
semantics: Dict[str, List | str] | List[Tuple[str, str]] = None,
material: ReplicatorItem | Prim = None,
visible: bool = True,
count: int = 1,
name: str | None = None,
parent: ReplicatorItem | str | Path | Prim = None,
) ReplicatorItem#

Create a disk

Parameters:
  • position – XYZ coordinates in world space. If a single value is provided, all axes will be set to that value.

  • scale – Scaling factors for XYZ axes. If a single value is provided, all axes will be set to that value.

  • pivot – Pivot that sets the center point of translate and rotate operation. Pivot values are normalized between [-1, 1] for each axis based on the prim’s axis aligned extents.

  • rotation – Euler angles in degrees in XYZ order. If a single value is provided, all axes will be set to that value.

  • look_at – Look-at target, specified either as a ReplicatorItem, a prim path, or world coordinates. If multiple prims are set, the target point will be the mean of their positions.

  • look_at_up_axis – Look-at up axis of the created prim.

  • semantics – Dictionary specifying semantic type and values. Legacy lists of tuples are also accepted but will be converted to dictionaries.

  • material – Material to attach to the disk.

  • visible – If False, the prim will be invisible. This is often useful when creating prims to use as bounds with other randomizers.

  • count – Number of objects to create.

  • name – Name of the object.

  • parent – Optional parent prim path. The object will be created as a child of this prim.

Example

>>> import omni.replicator.core as rep
>>> disk = rep.create.disk(
...     position=rep.distribution.uniform((0,0,0), (100, 100, 100)),
...     scale=2,
...     rotation=(45, 45, 0),
...     semantics={"class": ["disk"]},
... )
omni.replicator.core.create.plane(
position: ReplicatorItem | float | Tuple[float] = None,
scale: ReplicatorItem | float | Tuple[float] = None,
pivot: ReplicatorItem | Tuple[float] = None,
rotation: ReplicatorItem | float | Tuple[float] = None,
look_at: ReplicatorItem | str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: ReplicatorItem | Tuple[float] = None,
semantics: Dict[str, List | str] | List[Tuple[str, str]] = None,
material: ReplicatorItem | Prim = None,
visible: bool = True,
count: int = 1,
name: str | None = None,
parent: ReplicatorItem | str | Path | Prim = None,
) ReplicatorItem#

Create a plane

Parameters:
  • position – XYZ coordinates in world space. If a single value is provided, all axes will be set to that value.

  • scale – Scaling factors for XYZ axes. If a single value is provided, all axes will be set to that value.

  • pivot – Pivot that sets the center point of translate and rotate operation. Pivot values are normalized between [-1, 1] for each axis based on the prim’s axis aligned extents.

  • rotation – Euler angles in degrees in XYZ order. If a single value is provided, all axes will be set to that value.

  • look_at – Look-at target, specified either as a ReplicatorItem, a prim path, or world coordinates. If multiple prims are set, the target point will be the mean of their positions.

  • look_at_up_axis – Look-at up axis of the created prim.

  • semantics – Dictionary specifying semantic type and values. Legacy lists of tuples are also accepted but will be converted to dictionaries.

  • material – Material to attach to the plane.

  • visible – If False, the prim will be invisible. This is often useful when creating prims to use as bounds with other randomizers.

  • count – Number of objects to create.

  • name – Name of the object

  • parent – Optional parent prim path. The object will be created as a child of this prim.

Example

>>> import omni.replicator.core as rep
>>> plane = rep.create.plane(
...     position=rep.distribution.uniform((0,0,0), (100, 100, 100)),
...     scale=2,
...     rotation=(45, 45, 0),
...     semantics={"class": "plane"},
... )
omni.replicator.core.create.sphere(
position: ReplicatorItem | float | Tuple[float] = None,
scale: ReplicatorItem | float | Tuple[float] = None,
pivot: ReplicatorItem | Tuple[float] = None,
rotation: ReplicatorItem | float | Tuple[float] = None,
look_at: ReplicatorItem | str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: ReplicatorItem | Tuple[float] = None,
semantics: Dict[str, List | str] | List[Tuple[str, str]] = None,
material: ReplicatorItem | Prim = None,
visible: bool = True,
as_mesh: bool = True,
count: int = 1,
name: str | None = None,
parent: ReplicatorItem | str | Path | Prim = None,
) ReplicatorItem#

Create a sphere

Parameters:
  • position – XYZ coordinates in world space. If a single value is provided, all axes will be set to that value.

  • scale – Scaling factors for XYZ axes. If a single value is provided, all axes will be set to that value.

  • pivot – Pivot that sets the center point of translate and rotate operation. Pivot values are normalized between [-1, 1] for each axis based on the prim’s axis aligned extents.

  • rotation – Euler angles in degrees in XYZ order. If a single value is provided, all axes will be set to that value.

  • look_at – Look-at target, specified either as a ReplicatorItem, a prim path, or world coordinates. If multiple prims are set, the target point will be the mean of their positions.

  • look_at_up_axis – Look-at up axis of the created prim.

  • semantics – Dictionary specifying semantic type and values. Legacy lists of tuples are also accepted but will be converted to dictionaries.

  • material – Material to attach to the sphere.

  • visible – If False, the prim will be invisible. This is often useful when creating prims to use as bounds with other randomizers.

  • as_mesh – If False, create a Usd.Sphere prim. If True, create a mesh.

  • count – Number of objects to create.

  • name – Name of the object.

  • parent – Optional parent prim path. The object will be created as a child of this prim.

Example

>>> import omni.replicator.core as rep
>>> sphere = rep.create.sphere(
...     position=rep.distribution.uniform((0,0,0), (100, 100, 100)),
...     scale=2,
...     rotation=(45, 45, 0),
...     semantics={"class": ["sphere"]},
... )
omni.replicator.core.create.torus(
position: ReplicatorItem | float | Tuple[float] = None,
scale: ReplicatorItem | float | Tuple[float] = None,
pivot: ReplicatorItem | Tuple[float] = None,
rotation: ReplicatorItem | float | Tuple[float] = None,
look_at: ReplicatorItem | str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: ReplicatorItem | Tuple[float] = None,
semantics: Dict[str, List | str] | List[Tuple[str, str]] = None,
material: ReplicatorItem | Prim = None,
visible: bool = True,
count: int = 1,
name: str | None = None,
parent: ReplicatorItem | str | Path | Prim = None,
) ReplicatorItem#

Create a torus

Parameters:
  • position – XYZ coordinates in world space. If a single value is provided, all axes will be set to that value.

  • scale – Scaling factors for XYZ axes. If a single value is provided, all axes will be set to that value.

  • pivot – Pivot that sets the center point of translate and rotate operation. Pivot values are normalized between [-1, 1] for each axis based on the prim’s axis aligned extents.

  • rotation – Euler angles in degrees in XYZ order. If a single value is provided, all axes will be set to that value.

  • look_at – Look-at target, specified either as a ReplicatorItem, a prim path, or world coordinates. If multiple prims are set, the target point will be the mean of their positions.

  • look_at_up_axis – Look-at up axis of the created prim.

  • semantics – Dictionary specifying semantic type and values. Legacy lists of tuples are also accepted but will be converted to dictionaries.

  • material – Material to attach to the torus.

  • visible – If False, the prim will be invisible. This is often useful when creating prims to use as bounds with other randomizers.

  • count – Number of objects to create.

  • name – Name of the object

  • parent – Optional parent prim path. The object will be created as a child of this prim.

Example

>>> import omni.replicator.core as rep
>>> torus = rep.create.torus(
...     position=rep.distribution.uniform((0,0,0), (100, 100, 100)),
...     scale=2,
...     rotation=(45, 45, 0),
...     semantics={"class": ["torus"]},
... )
omni.replicator.core.create.xform(
position: ReplicatorItem | float | Tuple[float] = None,
scale: ReplicatorItem | float | Tuple[float] = None,
rotation: ReplicatorItem | float | Tuple[float] = None,
look_at: ReplicatorItem | str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: ReplicatorItem | Tuple[float] = None,
semantics: Dict[str, List | str] | List[Tuple[str, str]] = None,
visible: bool = True,
count: int = 1,
name: str | None = None,
parent: ReplicatorItem | str | Path | Prim = None,
) ReplicatorItem#

Create a Xform

Parameters:
  • position – XYZ coordinates in world space. If a single value is provided, all axes will be set to that value.

  • scale – Scaling factors for XYZ axes. If a single value is provided, all axes will be set to that value.

  • rotation – Euler angles in degrees in XYZ order. If a single value is provided, all axes will be set to that value.

  • look_at – Look-at target, specified either as a ReplicatorItem, a prim path, or world coordinates. If multiple prims are set, the target point will be the mean of their positions.

  • look_at_up_axis – Look-at up axis of the created prim.

  • semantics – Dictionary specifying semantic type and values. Legacy lists of tuples are also accepted but will be converted to dictionaries.

  • visible – If False, the prim will be invisible. This is often useful when creating prims to use as bounds with other randomizers.

  • count – Number of objects to create.

  • name – Name of the object.

  • parent – Optional parent prim path. The xform will be created as a child of this prim.

Example

>>> import omni.replicator.core as rep
>>> xform = rep.create.xform(
...     position=rep.distribution.uniform((0,0,0), (100, 100, 100)),
...     semantics={"class": ["thing"]},
... )

USD#

omni.replicator.core.create.from_dir(
dir_path: str,
recursive: bool = False,
path_filter: str = None,
semantics: Dict[str, List | str] | List[Tuple[str, str]] = None,
) ReplicatorItem#

Create a group of assets from the USD files found in dir_path

Parameters:
  • dir_path – The root path to search from.

  • recursive – If True, search through sub-folders.

  • path_filter – A Regular Expression (RegEx) string to filter paths with.

  • semantics – Dictionary specifying semantic type and values. Legacy lists of tuples are also accepted but will be converted to dictionaries.

Example

>>> import omni.replicator.core as rep
>>> asset_path = rep.example.ASSETS_DIR
>>> asset = rep.create.from_dir(asset_path, path_filter="rocket")
omni.replicator.core.create.from_usd(
usd: str,
position: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
scale: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
rotation: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
look_at: str | Path | Prim | Tuple[float, float, float] | List[str | Path | Prim | Tuple[float, float, float]] = None,
look_at_up_axis: Tuple[float] = None,
semantics: Dict[str, List | str] | List[Tuple[str, str]] = None,
count: int = 1,
name: str | None = None,
parent: str | Path | Prim = None,
) ReplicatorItem#

Reference a USD into the current USD stage.

Parameters:
  • usd – Path to a usd file (\*.usd, \*.usdc, \*.usda)

  • semantics – Dictionary specifying semantic type and values. Legacy lists of tuples are also accepted but will be converted to dictionaries.

Example

>>> import omni.replicator.core as rep
>>> usd_path = rep.example.ASSETS[0]
>>> asset = rep.create.from_usd(usd_path, semantics={"class": "example"})

Get#

get methods are helpers to get objects from the USD stage, either by path or by semantic label.

get.prims is very broad with its regex matching on the USD stage, so individual helper methods are provided to narrow the search field to differnt USD types (mesh, light, etc.)

omni.replicator.core.get.camera(
path_pattern: str = None,
path_pattern_exclusion: str = None,
semantics: List[Tuple[str, str]] | Tuple[str, str] = None,
semantics_exclusion: List[Tuple[str, str]] | Tuple[str, str] = None,
cache_result: bool = True,
name: str | None = None,
path_match: str = None,
) ReplicatorItem#

Get Usd ‘Camera’ types based on specified constraints.

Parameters:
  • path_pattern – The RegEx (Regular Expression) path pattern to match.

  • path_pattern_exclusion – The RegEx (Regular Expression) path pattern to ignore.

  • semantics – Semantic type-value pairs of semantics to include

  • semantics_exclusion – Semantic type-value pairs of semantics to ignore

  • cache_result – Run get prims a single time, then return the cached result

  • name (optional) – A name for the graph node.

  • path_match – Python string matching. Faster than regex matching.

omni.replicator.core.get.curve(
path_pattern: str = None,
path_pattern_exclusion: str = None,
semantics: List[Tuple[str, str]] | Tuple[str, str] = None,
semantics_exclusion: List[Tuple[str, str]] | Tuple[str, str] = None,
cache_result: bool = True,
name: str | None = None,
path_match: str = None,
) ReplicatorItem#

Get Usd ‘Curve’ types based on specified constraints.

Parameters:
  • path_pattern – The RegEx (Regular Expression) path pattern to match.

  • path_pattern_exclusion – The RegEx (Regular Expression) path pattern to ignore.

  • semantics – Semantic type-value pairs of semantics to include

  • semantics_exclusion – Semantic type-value pairs of semantics to ignore

  • cache_result – Run get prims a single time, then return the cached result

  • name (optional) – A name for the graph node.

  • path_match – Python string matching. Faster than regex matching.

omni.replicator.core.get.geomsubset(
path_pattern: str = None,
path_pattern_exclusion: str = None,
semantics: List[Tuple[str, str]] | Tuple[str, str] = None,
semantics_exclusion: List[Tuple[str, str]] | Tuple[str, str] = None,
cache_result: bool = True,
name: str | None = None,
path_match: str = None,
) ReplicatorItem#

Get Usd ‘GeomSubset’ types based on specified constraints.

Parameters:
  • path_pattern – The RegEx (Regular Expression) path pattern to match.

  • path_pattern_exclusion – The RegEx (Regular Expression) path pattern to ignore.

  • semantics – Semantic type-value pairs of semantics to include

  • semantics_exclusion – Semantic type-value pairs of semantics to ignore

  • cache_result – Run get prims a single time, then return the cached result

  • name (optional) – A name for the graph node.

  • path_match – Python string matching. Faster than regex matching.

omni.replicator.core.get.graph(
path_pattern: str = None,
path_pattern_exclusion: str = None,
semantics: List[Tuple[str, str]] | Tuple[str, str] = None,
semantics_exclusion: List[Tuple[str, str]] | Tuple[str, str] = None,
cache_result: bool = True,
name: str | None = None,
path_match: str = None,
) ReplicatorItem#

Get all ‘Graph’ types based on specified constraints.

Parameters:
  • path_pattern – The RegEx (Regular Expression) path pattern to match.

  • path_pattern_exclusion – The RegEx (Regular Expression) path pattern to ignore.

  • semantics – Semantic type-value pairs of semantics to include

  • semantics_exclusion – Semantic type-value pairs of semantics to ignore

  • cache_result – Run get prims a single time, then return the cached result

  • name (optional) – A name for the graph node.

  • path_match – Python string matching. Faster than regex matching.

omni.replicator.core.get.light(
path_pattern: str = None,
path_pattern_exclusion: str = None,
semantics: List[Tuple[str, str]] | Tuple[str, str] = None,
semantics_exclusion: List[Tuple[str, str]] | Tuple[str, str] = None,
cache_result: bool = True,
name: str | None = None,
path_match: str = None,
) ReplicatorItem#
Get Usd ‘light’ types based on specified constraints.

Matches types RectLight, SphereLight, CylinderLight, DiskLight, DistantLight, SphereLight

Parameters:
  • path_pattern – The RegEx (Regular Expression) path pattern to match.

  • path_pattern_exclusion – The RegEx (Regular Expression) path pattern to ignore.

  • semantics – Semantic type-value pairs of semantics to include

  • semantics_exclusion – Semantic type-value pairs of semantics to ignore

  • cache_result – Run get prims a single time, then return the cached result

  • name (optional) – A name for the graph node.

  • path_match – Python string matching. Faster than regex matching.

omni.replicator.core.get.listener(
path_pattern: str = None,
path_pattern_exclusion: str = None,
semantics: List[Tuple[str, str]] | Tuple[str, str] = None,
semantics_exclusion: List[Tuple[str, str]] | Tuple[str, str] = None,
cache_result: bool = True,
name: str | None = None,
path_match: str = None,
) ReplicatorItem#

Get Usd Listener types based on specified constraints.

Parameters:
  • path_pattern – The RegEx (Regular Expression) path pattern to match.

  • path_pattern_exclusion – The RegEx (Regular Expression) path pattern to ignore.

  • semantics – Semantic type-value pairs of semantics to include

  • semantics_exclusion – Semantic type-value pairs of semantics to ignore

  • cache_result – Run get prims a single time, then return the cached result

  • name (optional) – A name for the graph node.

  • path_match – Python string matching. Faster than regex matching.

omni.replicator.core.get.material(
path_pattern: str = None,
path_pattern_exclusion: str = None,
semantics: List[Tuple[str, str]] | Tuple[str, str] = None,
semantics_exclusion: List[Tuple[str, str]] | Tuple[str, str] = None,
cache_result: bool = True,
name: str | None = None,
path_match: str = None,
) ReplicatorItem#

Get Usd Material types based on specified constraints.

Parameters:
  • path_pattern – The RegEx (Regular Expression) path pattern to match.

  • path_pattern_exclusion – The RegEx (Regular Expression) path pattern to ignore.

  • semantics – Semantic type-value pairs of semantics to include

  • semantics_exclusion – Semantic type-value pairs of semantics to ignore

  • cache_result – Run get prims a single time, then return the cached result

  • name (optional) – A name for the graph node.

  • path_match – Python string matching. Faster than regex matching.

omni.replicator.core.get.mesh(
path_pattern: str = None,
path_pattern_exclusion: str = None,
semantics: List[Tuple[str, str]] | Tuple[str, str] = None,
semantics_exclusion: List[Tuple[str, str]] | Tuple[str, str] = None,
cache_result: bool = True,
name: str | None = None,
path_match: str = None,
) ReplicatorItem#

Get Usd Mesh types based on specified constraints.

Parameters:
  • path_pattern – The RegEx (Regular Expression) path pattern to match.

  • path_pattern_exclusion – The RegEx (Regular Expression) path pattern to ignore.

  • semantics – Semantic type-value pairs of semantics to include

  • semantics_exclusion – Semantic type-value pairs of semantics to ignore

  • cache_result – Run get prims a single time, then return the cached result

  • name (optional) – A name for the graph node.

  • path_match – Python string matching. Faster than regex matching.

omni.replicator.core.get.physics(
path_pattern: str = None,
path_pattern_exclusion: str = None,
semantics: List[Tuple[str, str]] | Tuple[str, str] = None,
semantics_exclusion: List[Tuple[str, str]] | Tuple[str, str] = None,
cache_result: bool = True,
name: str | None = None,
path_match: str = None,
) ReplicatorItem#

Get Physics/PhysicsScene types based on specified constraints.

Parameters:
  • path_pattern – The RegEx (Regular Expression) path pattern to match.

  • path_pattern_exclusion – The RegEx (Regular Expression) path pattern to ignore.

  • semantics – Semantic type-value pairs of semantics to include

  • semantics_exclusion – Semantic type-value pairs of semantics to ignore

  • cache_result – Run get prims a single time, then return the cached result

  • name (optional) – A name for the graph node.

  • path_match – Python string matching. Faster than regex matching.

omni.replicator.core.get.prim_at_path(
path: str | List[str] | ReplicatorItem,
name: str | None = None,
) ReplicatorItem#

Get the prim at the exact path

Parameters:
  • path – USD path to the desired prim. Defaults to None.

  • name (optional) – A name for the graph node.

omni.replicator.core.get.prims(
path_pattern: str = None,
path_match: str = None,
path_pattern_exclusion: str = None,
prim_types: str | List[str] = None,
prim_types_exclusion: str | List[str] = None,
semantics: List[Tuple[str, str]] | Tuple[str, str] = None,
semantics_exclusion: List[Tuple[str, str]] | Tuple[str, str] = None,
cache_result: bool = True,
ignore_case: bool = True,
name: str | None = None,
) ReplicatorItem#

Get prims based on specified constraints.

Search the stage for stage paths with matches to the specified constraints.

Parameters:
  • path_pattern – The RegEx (Regular Expression) path pattern to match.

  • path_match – Python string matching. Faster than regex matching.

  • path_pattern_exclusion – The RegEx (Regular Expression) path pattern to ignore.

  • prim_types – List of prim types to include

  • prim_types_exclusion – List of prim types to ignore

  • semantics – Semantic type-value pairs of semantics to include

  • semantics_exclusion – Semantic type-value pairs of semantics to ignore

  • cache_result – Run get prims a single time, then return the cached result

  • ignore_case – Case-insensitive regex matching

  • name (optional) – A name for the graph node.

omni.replicator.core.get.renderproduct(
path_pattern: str = None,
path_pattern_exclusion: str = None,
semantics: List[Tuple[str, str]] | Tuple[str, str] = None,
semantics_exclusion: List[Tuple[str, str]] | Tuple[str, str] = None,
cache_result: bool = True,
name: str | None = None,
path_match: str = None,
) ReplicatorItem#

Get Usd renderproduct types based on specified constraints.

Parameters:
  • path_pattern – The RegEx (Regular Expression) path pattern to match.

  • path_pattern_exclusion – The RegEx (Regular Expression) path pattern to ignore.

  • semantics – Semantic type-value pairs of semantics to include

  • semantics_exclusion – Semantic type-value pairs of semantics to ignore

  • cache_result – Run get prims a single time, then return the cached result

  • name (optional) – A name for the graph node.

  • path_match – Python string matching. Faster than regex matching.

omni.replicator.core.get.rendervar(
path_pattern: str = None,
path_pattern_exclusion: str = None,
semantics: List[Tuple[str, str]] | Tuple[str, str] = None,
semantics_exclusion: List[Tuple[str, str]] | Tuple[str, str] = None,
cache_result: bool = True,
name: str | None = None,
path_match: str = None,
) ReplicatorItem#

Get Usd RenderVar types based on specified constraints.

Parameters:
  • path_pattern – The RegEx (Regular Expression) path pattern to match.

  • path_pattern_exclusion – The RegEx (Regular Expression) path pattern to ignore.

  • semantics – Semantic type-value pairs of semantics to include

  • semantics_exclusion – Semantic type-value pairs of semantics to ignore

  • cache_result – Run get prims a single time, then return the cached result

  • name (optional) – A name for the graph node.

  • path_match – Python string matching. Faster than regex matching.

omni.replicator.core.get.scope(
path_pattern: str = None,
path_pattern_exclusion: str = None,
semantics: List[Tuple[str, str]] | Tuple[str, str] = None,
semantics_exclusion: List[Tuple[str, str]] | Tuple[str, str] = None,
cache_result: bool = True,
name: str | None = None,
path_match: str = None,
) ReplicatorItem#

Get Usd ‘Scope’ types based on specified constraints.

Parameters:
  • path_pattern – The RegEx (Regular Expression) path pattern to match.

  • path_pattern_exclusion – The RegEx (Regular Expression) path pattern to ignore.

  • semantics – Semantic type-value pairs of semantics to include

  • semantics_exclusion – Semantic type-value pairs of semantics to ignore

  • cache_result – Run get prims a single time, then return the cached result

  • name (optional) – A name for the graph node.

  • path_match – Python string matching. Faster than regex matching.

omni.replicator.core.get.shader(
path_pattern: str = None,
path_pattern_exclusion: str = None,
semantics: List[Tuple[str, str]] | Tuple[str, str] = None,
semantics_exclusion: List[Tuple[str, str]] | Tuple[str, str] = None,
cache_result: bool = True,
name: str | None = None,
path_match: str = None,
) ReplicatorItem#

Get Usd ‘Shader’ types based on specified constraints.

Parameters:
  • path_pattern – The RegEx (Regular Expression) path pattern to match.

  • path_pattern_exclusion – The RegEx (Regular Expression) path pattern to ignore.

  • semantics – Semantic type-value pairs of semantics to include

  • semantics_exclusion – Semantic type-value pairs of semantics to ignore

  • cache_result – Run get prims a single time, then return the cached result

  • name (optional) – A name for the graph node.

  • path_match – Python string matching. Faster than regex matching.

omni.replicator.core.get.shape(
path_pattern: str = None,
path_pattern_exclusion: str = None,
semantics: List[Tuple[str, str]] | Tuple[str, str] = None,
semantics_exclusion: List[Tuple[str, str]] | Tuple[str, str] = None,
cache_result: bool = True,
name: str | None = None,
path_match: str = None,
) ReplicatorItem#
Get Usd ‘shape’ types based on specified constraints.

Includes Capsule, Cone, Cube, Cylinder, Plane, Sphere

Parameters:
  • path_pattern – The RegEx (Regular Expression) path pattern to match.

  • path_pattern_exclusion – The RegEx (Regular Expression) path pattern to ignore.

  • semantics – Semantic type-value pairs of semantics to include

  • semantics_exclusion – Semantic type-value pairs of semantics to ignore

  • cache_result – Run get prims a single time, then return the cached result

  • name (optional) – A name for the graph node.

  • path_match – Python string matching. Faster than regex matching.

omni.replicator.core.get.skelanimation(
path_pattern: str = None,
path_pattern_exclusion: str = None,
semantics: List[Tuple[str, str]] | Tuple[str, str] = None,
semantics_exclusion: List[Tuple[str, str]] | Tuple[str, str] = None,
cache_result: bool = True,
name: str | None = None,
path_match: str = None,
) ReplicatorItem#

Get Usd ‘SkelAnimation’ types based on specified constraints.

Parameters:
  • path_pattern – The RegEx (Regular Expression) path pattern to match.

  • path_pattern_exclusion – The RegEx (Regular Expression) path pattern to ignore.

  • semantics – Semantic type-value pairs of semantics to include

  • semantics_exclusion – Semantic type-value pairs of semantics to ignore

  • cache_result – Run get prims a single time, then return the cached result

  • name (optional) – A name for the graph node.

  • path_match – Python string matching. Faster than regex matching.

omni.replicator.core.get.skeleton(
path_pattern: str = None,
path_pattern_exclusion: str = None,
semantics: List[Tuple[str, str]] | Tuple[str, str] = None,
semantics_exclusion: List[Tuple[str, str]] | Tuple[str, str] = None,
cache_result: bool = True,
name: str | None = None,
path_match: str = None,
) ReplicatorItem#

Get Usd ‘skeleton’ types based on specified constraints.

Parameters:
  • path_pattern – The RegEx (Regular Expression) path pattern to match.

  • path_pattern_exclusion – The RegEx (Regular Expression) path pattern to ignore.

  • semantics – Semantic type-value pairs of semantics to include

  • semantics_exclusion – Semantic type-value pairs of semantics to ignore

  • cache_result – Run get prims a single time, then return the cached result

  • name (optional) – A name for the graph node.

  • path_match – Python string matching. Faster than regex matching.

omni.replicator.core.get.sound(
path_pattern: str = None,
path_pattern_exclusion: str = None,
semantics: List[Tuple[str, str]] | Tuple[str, str] = None,
semantics_exclusion: List[Tuple[str, str]] | Tuple[str, str] = None,
cache_result: bool = True,
name: str | None = None,
path_match: str = None,
) ReplicatorItem#

Get Usd ‘Sound’ types based on specified constraints.

Parameters:
  • path_pattern – The RegEx (Regular Expression) path pattern to match.

  • path_pattern_exclusion – The RegEx (Regular Expression) path pattern to ignore.

  • semantics – Semantic type-value pairs of semantics to include

  • semantics_exclusion – Semantic type-value pairs of semantics to ignore

  • cache_result – Run get prims a single time, then return the cached result

  • name (optional) – A name for the graph node.

  • path_match – Python string matching. Faster than regex matching.

omni.replicator.core.get.xform(
path_pattern: str = None,
path_pattern_exclusion: str = None,
semantics: List[Tuple[str, str]] | Tuple[str, str] = None,
semantics_exclusion: List[Tuple[str, str]] | Tuple[str, str] = None,
cache_result: bool = True,
name: str | None = None,
path_match: str = None,
) ReplicatorItem#

Get Usd ‘Xform’ types based on specified constraints.

Parameters:
  • path_pattern – The RegEx (Regular Expression) path pattern to match.

  • path_pattern_exclusion – The RegEx (Regular Expression) path pattern to ignore.

  • semantics – Semantic type-value pairs of semantics to include

  • semantics_exclusion – Semantic type-value pairs of semantics to ignore

  • cache_result – Run get prims a single time, then return the cached result

  • name (optional) – A name for the graph node.

  • path_match – Python string matching. Faster than regex matching.

omni.replicator.core.get.register(
func: Callable[[...], ReplicatorItem | omni.graph.core.Node],
override: bool = True,
fn_name: str = None,
) None#

Register a new function under omni.replicator.core.get. Extend the default capabilities of omni.replicator.core.get by registering new functionality. New functions must return a ReplicatorItem or an OmniGraph node.

Parameters:
  • func – A function that returns a ReplicatorItem or an OmniGraph node.

  • override – If True, will override existing functions of the same name. If False, an error is raised.

  • fn_name – Optional arg that let user choose the function name when registering it in replicator. If not specified, the function name is used. fn_name must follow valid [Python identifier rules] (https://docs.python.org/3.10/reference/lexical_analysis.html#identifiers)

Distribution#

distribution methods are helpers set a range of values to simulate complex behavior.

omni.replicator.core.distribution.choice(
choices: List[str],
weights: List[float] = None,
num_samples: ReplicatorItem | int = 1,
seed: int | None = -1,
with_replacements: bool = True,
name: str | None = None,
) ReplicatorItem#

Provides sampling from a list of values

Parameters:
  • choices – Values in the distribution to choose from.

  • weights – Matching list of weights for each choice.

  • num_samples – The number of times to sample.

  • seed (optional) – A seed to use for the sampling.

  • with_replacements – If True, allow re-sampling the same element. If False, each element can only be sampled once. Note that in this case, the size of the elements being sampled must be larger than the sampling size. Default is True.

  • name (optional) – A name for the given distribution. Named distributions will have their values available to the Writer.

omni.replicator.core.distribution.combine(
distributions: List[ReplicatorItem | Tuple[ReplicatorItem]],
name: str | None = None,
) ReplicatorItem#

Combine input from different distributions.

Parameters:
  • distributions – List of Replicator distribution nodes or numbers.

  • name (optional) – A name for the given distribution. Named distributions will have their values available to the Writer.

omni.replicator.core.distribution.log_uniform(
lower: Tuple,
upper: Tuple,
num_samples: int = 1,
seed: int | None = None,
name: str | None = None,
) ReplicatorItem#

Provides sampling with a log uniform distribution

Parameters:
  • lower – Lower end of the distribution.

  • upper – Upper end of the distribution.

  • num_samples – The number of times to sample.

  • seed (optional) – A seed to use for the sampling.

  • name (optional) – A name for the given distribution. Named distributions will have their values available to the Writer.

omni.replicator.core.distribution.normal(
mean: Tuple,
std: Tuple,
num_samples: int = 1,
seed: int | None = None,
name: str | None = None,
) ReplicatorItem#

Provides sampling with a normal distribution

Parameters:
  • mean – Average value for the distribution.

  • std – Standard deviation value for the distribution.

  • num_samples – The number of times to sample.

  • seed (optional) – A seed to use for the sampling.

  • name (optional) – A name for the given distribution. Named distributions will have their values available to the Writer.

omni.replicator.core.distribution.sequence(
items: List | ReplicatorItem,
ordered: bool | None = True,
seed: int | None = -1,
name: str | None = None,
) ReplicatorItem#

Provides sampling sequentially

Parameters:
  • items – Ordered list of items to sample sequentially.

  • ordered – Whether to return item in order.

  • seed (optional) – A seed to use for the sampling.

  • name (optional) – A name for the given distribution. Named distributions will have their values available to the Writer.

Example

>>> import omni.replicator.core as rep
>>> cube = rep.create.cube(count=1)
>>> with cube:
...     rep.modify.pose(
...         position=rep.distribution.sequence(
...             [(0.0, 0.0, 200.0), (0.0, 200.0, 0.0), (200.0, 0.0, 0.0)]
...         )
...     )
omni.replicator.core.distribution.sequence
omni.replicator.core.distribution.uniform(
lower: Tuple,
upper: Tuple,
num_samples: int = 1,
seed: int | None = None,
name: str | None = None,
) ReplicatorItem#

Provides sampling with a uniform distribution

Parameters:
  • lower – Lower end of the distribution.

  • upper – Upper end of the distribution.

  • num_samples – The number of times to sample.

  • seed (optional) – A seed to use for the sampling.

  • name (optional) – A name for the given distribution. Named distributions will have their values available to the Writer.

omni.replicator.core.distribution.register(
fn: Callable[[...], ReplicatorItem | omni.graph.core.Node],
override: bool = True,
fn_name: str = None,
) None#

Register a new function under omni.replicator.core.distribution. Extend the default capabilities of omni.replicator.core.distribution by registering new functionality. New functionsmust return a ReplicatorItem or an OmniGraph node.

Parameters:
  • fn – A function that returns a ReplicatorItem or an OmniGraph node.

  • override – If True, will override existing functions of the same name. If False, an error is raised.

  • fn_name – Optional arg that let user choose the function name when registering it in replicator. If not specified, the function name is used. fn_name must follow valid [Python identifier rules] (https://docs.python.org/3.10/reference/lexical_analysis.html#identifiers)

Modify#

modify methods are helpers to get change objects on the USD stage.

omni.replicator.core.modify.animation(
values: ReplicatorItem | List[str] | List[Path] | List[usdrt.Sdf.Path],
reset_timeline: bool = False,
input_prims: ReplicatorItem | List[str] = None,
) ReplicatorItem#

Modify the bound animation on a skeleton. This does not do any retargetting.

Parameters:
  • values – The animation to set to the skeleton. If a list of values is provided, one will be chosen at random.

  • reset_timeline – Reset the timeline after changing the animation.

  • input_prims – The skeleton to modify. If using with syntax, this argument can be omitted.

Example

>>> import omni.replicator.core as rep
>>> from pxr import Sdf
>>> person = rep.get.skeleton('/World/Worker/Worker')
>>> new_anim = Sdf.Path('/World/other_anim')
>>> with person:
...    rep.modify.animation([new_anim])
omni.replicator.core.modify.animation
omni.replicator.core.modify.attribute(
name: str,
value: Any | ReplicatorItem,
attribute_type: str = None,
input_prims: ReplicatorItem | List[str] = None,
) ReplicatorItem#

Modify the attribute of the prims specified in input_prims.

Parameters:
  • name – The name of the attribute to modify.

  • value – The value to set the attribute to.

  • attribute_type – The data type of the attribute. This parameter is required if the attribute specified does not already exist and must be created.

  • input_prims – The prims to be modified. If using with syntax, this argument can be omitted.

Example

>>> import omni.replicator.core as rep
>>> sphere = rep.create.sphere(as_mesh=False)
>>> with sphere:
...     rep.modify.attribute("radius", rep.distribution.uniform(1, 5))
omni.replicator.core.modify.attribute
omni.replicator.core.modify.material(
value: ReplicatorItem | List[str] = None,
input_prims: ReplicatorItem | List[str] = None,
name: str | None = None,
) ReplicatorItem#

Modify the bound material of the prims specified in input_prims.

Parameters:
  • value – The material to bind to the prims. If multiple materials provided, a random one will be chosen.

  • input_prims – The prims to be modified. If using with syntax, this argument can be omitted.

  • name (optional) – A name for the graph node.

Example

>>> import omni.replicator.core as rep
>>> mat = rep.create.material_omnipbr()
>>> sphere = rep.create.sphere(as_mesh=False)
>>> with sphere:
...     rep.modify.material(["/Replicator/Looks/OmniPBR"])
omni.replicator.core.modify.material
omni.replicator.core.modify.pose(
position: ReplicatorItem | float | Tuple[float] = None,
position_x: ReplicatorItem | float = None,
position_y: ReplicatorItem | float = None,
position_z: ReplicatorItem | float = None,
rotation: ReplicatorItem | float | Tuple[float] = None,
rotation_x: ReplicatorItem | float = None,
rotation_y: ReplicatorItem | float = None,
rotation_z: ReplicatorItem | float = None,
rotation_order: str = 'XYZ',
scale: ReplicatorItem | float | Tuple[float] = None,
size: ReplicatorItem | float | Tuple[float] = None,
pivot: ReplicatorItem | Tuple[float] = None,
look_at: ReplicatorItem | str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: str | Tuple[float, float, float] = None,
input_prims: ReplicatorItem | List[str] = None,
name: str | None = None,
) ReplicatorItem#

Modify the position, rotation, scale, and/or look-at target of the prims specified in input_prims.

Parameters:
  • position – XYZ coordinates in world space.

  • position_x – coordinates value along the x axis.

  • position_y – coordinates value along the y axis.

  • position_z – coordinates value along the z axis.

  • rotation – Rotation in degrees for the axes specified in rotation_order.

  • rotation_x – Rotation in degrees for the X axis.

  • rotation_y – Rotation in degrees for the Y axis.

  • rotation_z – Rotation in degrees for the Z axis.

  • rotation_order – Order of rotation. Select from [XYZ, XZY, YXZ, YZX, ZXY, ZYX]

  • scale – Scale factor for each of XYZ axes.

  • size – Desired size of the input prims. Each input prim is scaled to match the specified size extents in each of the XYZ axes.

  • pivot – Pivot that sets the center point of translate and rotate operation.

  • look_at – The look at target to orient towards specified as either a ReplicatorItem, a prim path, or world coordinates. If multiple prims are set, the target point will be the mean of their positions.

  • look_at_up_axis – The up axis used in look_at function

  • input_prims – The prims to be modified. If using with syntax, this argument can be omitted.

  • name (optional) – A name for the graph node.

Note

  • position and any of (position_x, position_y, and position_z) cannot both be specified.

  • rotation and look_at cannot both be specified.

  • size and scale cannot both be specified.

  • size is converted to scale based on the prim’s current axis-aligned bounding box size. If a scale is already applied, it might not be able to reflect the true size of the prim.

Example

>>> import omni.replicator.core as rep
>>> with rep.create.cube():
...     rep.modify.pose(position=rep.distribution.uniform((0, 0, 0), (100, 100, 100)),
...                     scale=rep.distribution.uniform(0.1, 10),
...                     look_at=(0, 0, 0))
omni.replicator.core.modify.pose
omni.replicator.core.modify.pose_camera_relative(
camera: ReplicatorItem | List[str],
render_product: ReplicatorItem,
distance: float,
horizontal_location: float = 0,
vertical_location: float = 0,
input_prims=None,
) ReplicatorItem#

Modify the positions of the prim relative to a camera.

Parameters:
  • camera – Camera that the prim is relative to.

  • horizontal_location – Horizontal location in the camera space, which is in the range [-1, 1].

  • vertical_location – Vertical location in the camera space, which is in the range [-1, 1].

  • distance – Distance from the prim to the camera.

  • input_prims – The prims to be modified. If using with syntax, this argument can be omitted.

Example

>>> import omni.replicator.core as rep
>>> camera = rep.create.camera()
>>> render_product = rep.create.render_product(camera, (1024, 512))
>>> with rep.create.cube():
...     rep.modify.pose_camera_relative(
...         camera, render_product, distance=500, horizontal_location=0, vertical_location=0
...     )
omni.replicator.core.modify.pose_camera_relative
omni.replicator.core.modify.pose_orbit(
barycentre: ReplicatorItem | Tuple[float, float, float] | str,
distance: ReplicatorItem | float,
azimuth: ReplicatorItem | float,
elevation: ReplicatorItem | float,
look_at_barycentre: bool = True,
input_prims: ReplicatorItem | List[str] = None,
) omni.graph.core.Node#

Position the input_prims in an orbit around a point.

Parameters:
  • barycentre – The point around which to position the input prims. The barycentre can be specified as either coordinates or as prim paths. If more than one prim path is provided, the barycentre will be set to the mean of the prim centres.

  • distance – Distance from barycentre

  • azimuth – Horizontal angle (in degrees).

  • elevation – Vertical angle (in degrees).

  • look_at_centre – If True, orient the input_prims towards the barycentre. Default True.

  • input_prims – The prims to be modified. If using with syntax, this argument can be omitted.

Example

>>> import omni.replicator.core as rep
>>> cube = rep.create.cube()
>>> camera = rep.create.camera()
>>> with camera:
...     rep.modify.pose_orbit(
...         barycentre=cube,
...         distance=rep.distribution.uniform(400, 500),
...         azimuth=45,
...         elevation=rep.distribution.uniform(-180, 180),
...     )
omni.replicator.core.modify._pose_orbit
omni.replicator.core.modify.projection_material(
position: ReplicatorItem | List[str] = None,
rotation: ReplicatorItem | List[str] = None,
scale: ReplicatorItem | List[str] = None,
texture_group: ReplicatorItem | List[str] = None,
diffuse: ReplicatorItem | List[str] = None,
normal: ReplicatorItem | List[str] = None,
roughness: ReplicatorItem | List[str] = None,
metallic: ReplicatorItem | List[str] = None,
input_prims: ReplicatorItem | List[str] = None,
name: str | None = None,
) omni.graph.core.Node#

Modify values on a projection and update the transform via updates to the proxy prim.

The proxy prims’ transforms can be modified outside this function and then this function can be used to update the projection position, scale, and rotation if not manually provided.

Parameters:
  • position – Manually update the position of the projection, this will override the position from the proxy.

  • rotation – Manually update the rotation of the projection, this will override the rotation from the proxy.

  • scale – Manually update the scale of the projection, this will override the scale from the proxy.

  • texture_group – Update the diffuse, normal, roughness, and/or metallic texture simultaniously. Use where there are diffuse, normal, roughness, and/or metallic textures in a set. If using this arg, the diffuse, normal, roughness and/or metallic args should be set to the suffix used to denote each type.

  • diffuse – Update the diffuse texture used on the projection material. Will not change if not provided.

  • normal – Update the normal texture used on the projection material. Will not change if not provided.

  • roughness – Update the roughness texture used on the projection material. Will not change if not provided.

  • metallic – Update the metallic texture used on the projection material. Will not change if not provided.

  • input_prims – The projection prim to modify. If using with syntax, this argument can be omitted.

  • name (optional) – A name for the graph node.

Example

>>> import omni.replicator.core as rep
>>> import os
>>> torus = rep.create.torus()
>>> cube = rep.create.cube(position=(50, 100, 0), rotation=(0, 0, 90), scale=(0.2, 0.2, 0.2))
>>> sem = [('class', 'shape')]
>>> with torus:
...     projection = rep.create.projection_material(cube, sem)
>>> with projection:
...     rep.modify.projection_material(diffuse=os.path.join(rep.example.TEXTURES_DIR, "smiley_albedo.png"))
omni.replicator.core.modify.projection_material
omni.replicator.core.modify.semantics(
semantics: Dict[str, str] | List[Tuple[str, str]] | None = None,
input_prims: ReplicatorItem | List[str] = None,
mode: str = 'add',
) ReplicatorItem#

Add semantics to the target prims

Parameters:
  • semanticsTYPE,VALUE pairs of semantic labels to include on the prim. (Ex: (‘class’, ‘sphere’))

  • input_prims – The prims to be modified. If using with syntax, this argument can be omitted.

  • mode – Semantics modification mode. Select from [add, replace, clear]. In add mode, semantic labels are added to the prim, labels with the same TYPE:VALUE will be skipped. (eg. class:car, class:sedan -> class:car, class:sedan, class:automobile). In replace mode, the semantics VALUE specified will replace any existing value of the same semantic TYPE (eg. class:car, class:sedan, subclass:emergency -> class:automobile, subclass:emergency). In clear mode, ALL existing semantics are cleared before adding the specified semantics. (eg. class:car, subclass:emergency, region:usa -> class:automobile).

Example

>>> import omni.replicator.core as rep
>>> with rep.create.sphere():
...     rep.modify.semantics([("class", "sphere")])
omni.replicator.core.modify.semantics
omni.replicator.core.modify.variant(
name: str,
value: List[str] | ReplicatorItem,
input_prims: ReplicatorItem | List[str] = None,
) ReplicatorItem#

Modify the variant of the prims specified in input_prims.

Parameters:
  • name – The name of the variant set to modify.

  • value – The value to set the variant to.

  • input_prims – The prims to be modified. If using with syntax, this argument can be omitted.

Example

>>> import os
>>> import omni.replicator.core as rep
>>> sphere = rep.create.from_usd(os.path.join(rep.example.ASSETS_DIR, "variant.usd"))
>>> with rep.trigger.on_frame(max_execs=10):
...     with sphere:
...         rep.modify.variant("colorVariant", rep.distribution.choice(["red", "green", "blue"]))
omni.replicator.core.modify.variant
omni.replicator.core.modify.visibility(
value: ReplicatorItem | List[bool] | bool = None,
input_prims: ReplicatorItem | List[str] = None,
name: str | None = None,
) ReplicatorItem#

Modify the visibility of prims.

Parameters:
  • value – True, False. Or a list of bools for each prim to be modified, or a Replicator Distribution.

  • input_prims – The prims to be modified. If using with syntax, this argument can be omitted.

  • name (optional) – A name for the graph node.

Example

>>> import omni.replicator.core as rep
>>> sphere = rep.create.sphere(position=(100, 0, 100))
>>> with sphere:
...     rep.modify.visibility(False)
omni.replicator.core.modify.visibility
>>> with rep.trigger.on_frame(max_execs=10):
...    with sphere:
...        rep.modify.visibility(rep.distribution.sequence([True, False]))
omni.replicator.core.modify.visibility
omni.replicator.core.modify.register(
fn: Callable[[...], ReplicatorItem | omni.graph.core.Node],
override: bool = True,
fn_name: str = None,
) None#

Register a new function under omni.replicator.core.modify. Extend the default capabilities of omni.replicator.core.modify by registering new functionality. New functions must return a ReplicatorItem or an OmniGraph node.

Parameters:
  • fn – A function that returns a ReplicatorItem or an OmniGraph node.

  • override – If True, will override existing functions of the same name. If False, an error is raised.

  • fn_name – Optional arg that let user choose the function name when registering it in replicator. If not specified, the function name is used. fn_name must follow valid [Python identifier rules] (https://docs.python.org/3.10/reference/lexical_analysis.html#identifiers)

Time#

omni.replicator.core.modify.time(
value: float | ReplicatorItem,
) ReplicatorItem#

Set the timeline time value (in seconds).

Parameters:

value – The value to set the time to.

Example

>>> import omni.replicator.core as rep
>>> with rep.trigger.on_frame(max_execs=10):
...     rep.modify.time(rep.distribution.uniform(0, 500))
omni.replicator.core.modify.time
omni.replicator.core.modify.timeline(
value: float | ReplicatorItem,
modify_type: str = None,
) ReplicatorItem#

Modify the timeline by frame number or time value (in seconds).

Parameters:
  • value – The value to set the frame number or time to.

  • modify_type – The method with which to modify the timeline by. Valid types are [time, start_time, end_time, frame, start_frame, end_frame]

Example

>>> import omni.replicator.core as rep
>>> with rep.trigger.on_frame(max_execs=10):
...     rep.modify.timeline(rep.distribution.uniform(0, 500), "frame")
omni.replicator.core.modify.timeline

Randomizer#

omni.replicator.core.randomizer.color(
colors: ReplicatorItem | List[Tuple[float]],
per_sub_mesh: bool = False,
seed: int = None,
input_prims: ReplicatorItem | List[str] = None,
) ReplicatorItem#

Randomize colors Creates and binds an OmniPBR material to each prim in input_prims and randomizes colors.

Parameters:
  • colors – List of colors, or a ReplicatorItem that outputs a list of colors. If supplied as a list, a choice sampler is automatically created to sample from the supplied color list.

  • per_sub_mesh – If True, bind a color to each mesh and geom_subset. If False, a color is bound only to the specified prim.

  • seed – If colors is specified as a list, optionally provide seed for color sampler. Unused if colors is a ReplicatorItem.

  • input_prims – List of input_prims. If constructing using with structure, set to None to bind input_prims to the current context.

Example

>>> import omni.replicator.core as rep
>>> cones = rep.create.cone(position=rep.distribution.uniform((-100,-100,-100),(100,100,100)), count=100)
>>> with cones:
...     rep.randomizer.color(colors=rep.distribution.uniform((0, 0, 0), (1, 1, 1)))
omni.replicator.core.randomizer.color
omni.replicator.core.randomizer.instantiate(
paths: ReplicatorItem | List[str | Path | usdrt.Sdf.Path | Prim | ReplicatorItem],
size: ReplicatorItem | int,
weights: List[float] = None,
mode: str = 'scene_instance',
with_replacements=True,
seed: int = None,
name: str = None,
use_cache: bool = True,
semantics: List[Tuple[str, str]] = None,
) ReplicatorItem#

Sample size number of prims from the paths provided.

Parameters:
  • paths – The list of USD paths pointing to the assets to sample from.

  • size – The number of samples to sample. NOTE: if the paths is a ReplicatorItem, size will be ignored.

  • weights – The weights to use for sampling. If provided, the length of weights must match the length of paths. If omitted, uniform sampling will be used. NOTE: if the paths is a ReplicatorItem, weights will be ignored.

  • mode – The instantiation mode. Choose from [scene_instance, point_instance, reference]. Defaults to scene_instance. Scene Instance creates a prototype in the cache, and new instances reference the prototype. Point Instancesare best suited for situations requiring a very large number of samples, but only pose attributes can be modified per instance. Reference mode is used for asset references that need to be modified (WARNING: this mode has known material loading issue.)

  • with_replacements – When False, avoids duplicates when sampling. Default True. NOTE: if the paths is a ReplicatorItem, with_replacements will be ignored.

  • seed – Seed to use as initialization for the pseudo-random number generator. If not specified, the global seed will be used. NOTE: if the paths is a ReplicatorItem, seed will be ignored.

  • name – Optionally prepend a name to the population.

  • use_cache – If True, cache the assets in paths to speed up randomization. Set to False if the size of the population is too large to be cached. Default: True.

  • semantics – List of semantic type-label pairs.

Example

>>> import omni.replicator.core as rep
>>> usds = rep.utils.get_usd_files(rep.example.ASSETS_DIR)
>>> with rep.randomizer.instantiate(usds, size=100):
...     rep.modify.pose(position=rep.distribution.uniform((-50,-50,-50),(50,50,50)))
omni.replicator.core.modify.pose
omni.replicator.core.randomizer.materials(
materials: ReplicatorItem | List[str],
seed: int = None,
max_cached_materials: int = 0,
input_prims=None,
name: str | None = None,
) ReplicatorItem#

Sample materials from provided materials and bind to the input_prims.

Note that binding materials is a relatively expensive operation. It is generally more efficient to modify materials already bound to prims.

Parameters:
  • materials – The list of materials to sample from and bind to the input prims. The materials can be prim paths, MDL paths or a ReplicatorItem.

  • seed – Seed to use as initialization for the pseudo-random number generator. If not specified, the global seed will be used.

  • max_cached_materials – Maximum number of materials allowed to remain in the scene when not attached to a prim. A larger value allows more materials to remain in the scene, reducing the number of materials that need to be re-created each call at the expense of memory usage. Only applies to materials created from MDL paths specified in materials. The default value of 0 removes all cached materials at the end of each call.

  • input_prims – The prims to be modified. If using with syntax, this argument can be omitted.

  • name (optional) – A name for the graph node.

Example

>>> import omni.replicator.core as rep
>>> mats = rep.create.material_omnipbr(diffuse=rep.distribution.uniform((0,0,0), (1,1,1)), count=100)
>>> spheres = rep.create.sphere(
...     scale=0.2,
...     position=rep.distribution.uniform((-100,-100,-100), (100,100,100)),
...     count=100
... )
>>> with spheres:
...     rep.randomizer.materials(mats)
omni.replicator.core.randomizer.materials
omni.replicator.core.randomizer.rotation(
min_angle: Tuple[float, float, float] = (-180.0, -180.0, -180.0),
max_angle: Tuple[float, float, float] = (180.0, 180.0, 180.0),
seed: int = None,
input_prims: ReplicatorItem | List[str] = None,
) ReplicatorItem#

Randomize the rotation of the input prims

This randomizer produces a truly uniformly distributed rotations to the input prims. In contrast, rotations are not truly uniformly distributed when simply sampling uniformly for each rotation axis.

Parameters:
  • min_angle – Minimum value for Euler angles in XYZ form (degrees)

  • max_angle – Maximum value for Euler angles in XYZ form (degrees)

  • seed – Seed to use as initialization for the pseudo-random number generator. If not specified, the global seed will be used.

  • input_prims – The prims to be modified. If using with syntax, this argument can be omitted.

Example

>>> import omni.replicator.core as rep
>>> cubes = rep.create.cube(position=rep.distribution.uniform((-100,-100,-100),(100,100,100)), count=100)
>>> with cubes:
...     rep.randomizer.rotation()
omni.replicator.core.randomizer.rotation
omni.replicator.core.randomizer.scatter_2d(
surface_prims: ReplicatorItem | List[str],
no_coll_prims: ReplicatorItem | List[str] = None,
min_samp: Tuple[float, float, float] = (None, None, None),
max_samp: Tuple[float, float, float] = (None, None, None),
seed: int = None,
offset: int = 0,
check_for_collisions: bool = False,
input_prims: ReplicatorItem | List[str] = None,
name: str | None = None,
) ReplicatorItem#

Scatter input prims across the surface of the specified surface prims.

Parameters:
  • surface_prims – The prims across which to scatter the input prims. These can be meshes or GeomSubsets which specify a subset of a mesh’s polygons on which to scatter.

  • no_coll_prims – Existing prim(s) to prevent collisions with - if any prims are passed they will be checked for collisions which may slow down compute, regardless if check_for_collisions is True or False.

  • min_samp – The minimum position in global space to sample from.

  • max_samp – The maximum position in global space to sample from.

  • seed – Seed to use as initialization for the pseudo-random number generator. If not specified, the global seed will be used.

  • offset – The distance the prims should be offset along the normal of the surface of the mesh.

  • check_for_collisions

    Whether the scatter operation should ensure that objects are not intersecting.

    • 0: No collision checking (fastest)

    • 1: Check for collisions among the sampled input prims,

    • 2: No collision checking among sampled input prims, but compute collision convex meshes for all the prims on the stage by recursively traversing the stage, and make sure the sampled prims do not collide with any of them.

    • 3: Make sure the sampled prims don’t collide with anything (slowest)

  • input_prims – The prims to be modified. If using with syntax, this argument can be omitted.

  • name (optional) – A name for the graph node.

Example

>>> import omni.replicator.core as rep
>>> spheres = rep.create.sphere(count=100)
>>> surface_prim = rep.create.torus(scale=20, visible=False)
>>> with spheres:
...     rep.randomizer.scatter_2d(surface_prim)
omni.replicator.core.randomizer.scatter_2d
omni.replicator.core.randomizer.scatter_3d(
volume_prims: ReplicatorItem | List[str] = None,
no_coll_prims: ReplicatorItem | List[str] = None,
volume_excl_prims: ReplicatorItem | List[str] = None,
min_samp: Tuple[float, float, float] = (None, None, None),
max_samp: Tuple[float, float, float] = (None, None, None),
resolution_scaling: float = 1.0,
voxel_size: float = 0.0,
check_for_collisions: bool = False,
prevent_vol_overlap: bool = True,
viz_sampled_voxels: bool = False,
seed: int = None,
input_prims: ReplicatorItem | List[str] = None,
name: str | None = None,
) ReplicatorItem#

Scatter input prims within the bounds of the specified volume prims.

Parameters:
  • volume_prims – The prims within which to scatter the input prims. Currently, only meshes are supported, and they must be watertight. If no prims are provided, you must specify min_samp and max_samp bounds.

  • no_coll_prims – Existing prim(s) to prevent collisions with - if any prims are passed they will be checked for collisions using rejection sampling. This may slow down compute, regardless if check_for_collisions is True/False.

  • volume_excl_prims – Prim(s) from which to exclude from sampling. Must have watertight meshes. Similar effect to no_coll_prims, but more efficient and less accurate. Rather than performing rejection sampling based on collision with the provided volume (as no_coll_prims does), this prunes off the voxelized sampling space enclosed by volume_excl_prims so the rejection rate is 0 because it never tires to sample in the excluded space. However, some objects may get sampled very close to the edge of a mesh in volume_excl_prims, where the sampled root point is outside volume_excl_prims but parts of the mesh extend to overlap the space. To get the best of both worlds, you can pass the same volume prim to both no_coll_prims and to volume_excl_prims, providing a high accuracy and a low rejection rate.

  • min_samp – The minimum position in global space to sample from.

  • max_samp – The maximum position in global space to sample from.

  • resolution_scaling – Amount the default voxel resolution used in sampling should be scaled. More complex meshes may require higher resolution. Default voxel resolution is 30 for the longest side of the mean sized volumePrim mesh provided. Higher values will ensure more fine-grained voxels, but will come at the cost of performance.

  • voxel_size – Voxel size used to compute the resolution. If this is provided, then resolution_scaling is ignored, otherwise (if it is 0 by default) resolution_scaling is used.

  • check_for_collisions – Whether the scatter operation should ensure that sampled objects are not intersecting.

  • prevent_vol_overlap – If True, prevents double sampling even when multiple enclosing volumes overlap, so that the entire enclosed volume is sampled uniformly. If False, it allows overlapped sampling with higher density in overlapping areas.

  • viz_sampled_voxels – If True, creates semi-transparent green cubes in all voxels in the scene that the input prim positions are sampled from.

  • seed – Seed to use as initialization for the pseudo-random number generator. If not specified, the global seed will be used.

  • input_prims – The prims to be modified. If using with syntax, this argument can be omitted.

  • name (optional) – A name for the graph node.

Example

>>> import omni.replicator.core as rep
>>> spheres = rep.create.sphere(count=100)
>>> volume_prim = rep.create.torus(scale=20, visible=False)
>>> with spheres:
...     rep.randomizer.scatter_3d(volume_prim)
omni.replicator.core.randomizer.scatter_3d
omni.replicator.core.randomizer.texture(
textures: ReplicatorItem | List[str],
texture_scale: ReplicatorItem | List[Tuple[float, float]] = None,
texture_rotate: ReplicatorItem | List[int] = None,
per_sub_mesh: bool = False,
project_uvw: bool = False,
seed: int = None,
input_prims: ReplicatorItem | List[str] = None,
) ReplicatorItem#

Randomize texture Creates and binds an OmniPBR material to each prim in input_prims and modifies textures.

Parameters:
  • textures – List of texture paths, or a ReplicatorItem that outputs a list of texture paths. If a list of texture paths is provided, they will be sampled uniformly using the global seed.

  • texture_scale – List of texture scales in (X, Y) represented by positive floats. Larger values will make the texture appear smaller on the asset.

  • texture_rotate – Rotation in degrees of the texture.

  • per_sub_mesh – If True, bind a material to each mesh and geom_subset. If False, a material is bound only to the specified prim.

  • project_uvw – When True, UV coordinates will be generated by projecting them from a coordinate system.

  • seed – Seed to use as initialization for the pseudo-random number generator. If not specified, the global seed will be used.

  • input_prims – List of input_prims. If constructing using with structure, set to None to bind input_prims to the current context.

Example

>>> import omni.replicator.core as rep
>>> with rep.create.cone(position=rep.distribution.uniform((-100,-100,-100),(100,100,100)), count=100):
...     rep.randomizer.texture(textures=rep.example.TEXTURES, texture_scale=[(0.5, 0.5)], texture_rotate=[45])
omni.replicator.core.randomizer.texture
omni.replicator.core.randomizer.register(
fn: Callable[[...], ReplicatorItem | omni.graph.core.Node],
override: bool = True,
fn_name: str = None,
) None#

Register a new function under omni.replicator.core.randomizer. Extend the default capabilities of omni.replicator.core.randomizer by registering new functionality. New functions must return a ReplicatorItem or an OmniGraph node.

Parameters:
  • fn – A function that returns a ReplicatorItem or an OmniGraph node.

  • override – If True, will override existing functions of the same name. If False, an error is raised.

  • fn_name – Optional arg that let user choose the function name when registering it in replicator. If not

  • specified

  • rules] (the function name is used. fn_name must follow valid [Python identifier)

  • (https – //docs.python.org/3.10/reference/lexical_analysis.html#identifiers)

Example

>>> import omni.replicator.core as rep
>>> def scatter_points(points):
...     return rep.modify.pose(position=rep.distribution.choice(points))
>>> rep.randomizer.register(scatter_points)
>>> with rep.create.cone():
...     rep.randomizer.scatter_points([(0, 0, 0), (0, 0, 100), (0, 0, 200)])
omni.replicator.core.randomizer.scatter_points

Physics#

omni.replicator.core.physics.collider(
approximation_shape: str = 'convexHull',
contact_offset: float = None,
rest_offset: float = None,
physics_scene: str = None,
input_prims: ReplicatorItem | List = None,
) None#

Applies the Physx Collision API to the prims specified in input_prims.

Parameters:
  • approximation_shape – The approximation used in the collider (by default, convex hull). Other approximations include “convexDecomposition”, “boundingSphere”, “boundingCube”, “meshSimplification”, and “none”. “none” will just use default mesh geometry.

  • contact_offset – Offset used when generating contact points. If it is None, it will determined by scene’s current meters_per_unit. Default: None.

  • rest_offset – Offset used when generating rest contact points. If it is None, it will determined by scene’s current meters_per_unit. Default: None.

  • physics_scene – If provided, the assign the collider to physics scene at specified path. If None, the collider is assigned to the default physics scene.

  • input_prims – The prims to be modified. If using with syntax, this argument can be omitted.

Example

>>> import omni.replicator.core as rep
>>> with rep.create.cube():
...     rep.physics.collider()
omni.replicator.core.physics.collider
omni.replicator.core.physics.drive_properties(
stiffness: ReplicatorItem | float = 0.0,
damping: ReplicatorItem | float = 0.0,
input_prims: ReplicatorItem | List = None,
) None#

Applies the Drive API to the prims specified in input_prims, if necessary. Prims must be either revolute or prismatic joints. For D6 joint randomization, please refer to omni.replicator.core.modify.attribute and provide the exact attribute name of the drive parameter to be randomized.

Parameters:
  • stiffness – The stiffness of the drive (unitless).

  • damping – The damping of the drive (unitless).

  • input_prims – The prims to be modified. If using with syntax, this argument can be omitted.

omni.replicator.core.physics.mass(
mass: float | None = None,
density: float | None = None,
center_of_mass: List | None = None,
diagonal_inertia: List | None = None,
principal_axes: List | None = None,
input_prims: ReplicatorItem | List = None,
) None#

Applies the Physx Mass API to the prims specified in input_prims, if necessary. This function sets up randomization parameters for various mass-related properties in the mass API.

Parameters:
  • mass – The mass of the prim. By default mass is derived from the volume of the collision geometry multiplied by a density.

  • density – The density of the prim.

  • center_of_mass – Center of the mass of the prim in local coordinates.

  • diagonal_inertia – Constructs a diagonalized inertia tensor along the principal axes.

  • principal_axes – A quaternion (wxyz) representing the orientation of the principal axes in the local coordinate frame.

  • input_prims – The prims to be modified. If using with syntax, this argument can be omitted.

Example

>>> import omni.replicator.core as rep
>>> with rep.create.cube():
...     rep.physics.mass(mass=rep.distribution.uniform(1.0, 50.0))
omni.replicator.core.physics.mass
omni.replicator.core.physics.physics_material(
static_friction: ReplicatorItem | float = None,
dynamic_friction: ReplicatorItem | float = None,
restitution: ReplicatorItem | float = None,
input_prims: ReplicatorItem | List = None,
) None#

If input prim is a material, the physics material API will be applied if necessary. Otherwise, if the prim has a bound material, then randomizations will be made on this material (where once again, with the physics material API being bound if necessary). If the prim does not have a bound material, then a physics material will be created at <prim_path>/PhysicsMaterial and bound at the prim.

Parameters:
  • static_friction – Static friction coefficient (unitless).

  • dynamic_friction – Dynamic friction coefficient (unitless).

  • restitution – Restitution coefficient (unitless).

  • input_prims – The prims to be modified. If using with syntax, this argument can be omitted.

Example

>>> import omni.replicator.core as rep
>>> with rep.create.cube():
...     rep.physics.physics_material(
...         static_friction=rep.distribution.uniform(0.0, 1.0),
...         dynamic_friction=rep.distribution.uniform(0.0, 1.0),
...         restitution=rep.distribution.uniform(0.0, 1.0)
...     )
omni.replicator.core.physics.physics_material
omni.replicator.core.physics.rigid_body(
velocity: ReplicatorItem | Tuple[float, float, float] = (0.0, 0.0, 0.0),
angular_velocity: ReplicatorItem | Tuple[float, float, float] = None,
contact_offset: float = None,
rest_offset: float = None,
overwrite: bool = False,
physics_scene: str = None,
input_prims: ReplicatorItem | List = None,
) None#

Randomizes the velocity and angular velocity of the prims specified in input_prims. If they do not have the RigidBodyAPI then one will be created for the prim.

Parameters:
  • velocity – The velocity of the prim.

  • angular_velocty – The angular velocity of the prim (degrees / time).

  • contact_offset – Offset used when generating contact points. If it is None, it will determined by scene’s current meters_per_unit. Default: None.

  • rest_offset – Offset used when generating rest contact points. If it is None, it will determined by scene’s current meters_per_unit. Default: None.

  • overwrite – If True, apply rigid body to the input prim and remove any rigid body already applied to a descendent of the input prim. If False, rigid body is only be applied to the input prim if no descendent is already specified as a rigid body. This is because PhysX does not allow nested rigid body hierarchies.

  • physics_scene – If provided, the assign the rigid body to physics scene at specified path. If None, the rigid body is assigned to the default physics scene.

  • input_prims – The prims to be modified. If using with syntax, this argument can be omitted.

Example

>>> import omni.replicator.core as rep
>>> with rep.create.cube():
...     rep.physics.rigid_body(
...         velocity=rep.distribution.uniform((0, 0, 0), (100, 100, 100)),
...         angular_velocity=rep.distribution.uniform((30, 30, 30), (300, 300, 300))
...     )
omni.replicator.core.physics.rigid_body

Annotators#

omni.replicator.core.annotators.get(
name: str,
init_params: dict = None,
render_product_idxs: List[int] = None,
device: str = None,
do_array_copy: bool = True,
) Annotator#

Get annotator from registry

Parameters:
  • name – Name of annotator to be retrieved from registry

  • init_params – Annotator initialization parameters

  • render_product_idxs – Index of render products to utilize

  • device – If set, make annotator data available to specified device if possible. Select from ['cpu', 'cuda', 'cuda:<device_index>']. Defaults to cpu

  • do_array_copy – If True, retrieve a copy of the data array. This is recommended for workflows using asynchronous backends to manage the data lifetime. Can be set to False to gain performance if the data is expected to be used immediately within the writer. Defaults to True

omni.replicator.core.annotators.get_augmentation(
name: str,
) Augmentation#

Get Augmentation from registry

Parameters:

name – Name of augmentation to retrieve from registry

omni.replicator.core.annotators.get_registered_annotators() List[str]#

Returns a list names of registered annotators.

Returns:

List of registered annotators.

omni.replicator.core.annotators.register(
name: str,
annotator: Annotator | str,
) None#

Register annotator

Parameters:
  • name – Name under which to register annotator

  • annotator – Annotator to be registered

omni.replicator.core.annotators.register_augmentation(
name: str,
augmentation: Augmentation | str,
) None#

Register an augmentation operation.

Parameters:
  • name – Name under which to register augmentation

  • augmentation – Augmentation to be registered. Can be specified as an Augmentation, the name of a registered augmentation or the node type id of an omnigraph node to be used as an augmentation.

Example

>>> import omni.replicator.core as rep
>>> def make_opaque(data_in):
...    data_in[..., 3] = 255
>>> rep.annotators.register_augmentation("makeOpaque", rep.annotators.Augmentation(make_opaque))
omni.replicator.core.annotators.unregister_augmentation(name: str) None#

Unregister a registered augmentation

Parameters:

name – Name of augmentation to unregister

class omni.replicator.core.annotators.Annotator(
name: str,
init_params: dict = None,
render_product_idxs: List[int] = None,
device: str = None,
render_products: list = None,
template_name: str = None,
do_array_copy: bool = True,
public_name: str = None,
)#

Annotator class Annotator instances identify the annotator name, it’s initialization parameters, the render products it is tied to, as well as the name of the OmniGraph template.

Initialization parameters can be overridden with initialize(), and render products can be set with attach(). Once attached, the data from an annotator can be retrieved with get_data().

Parameters:
  • name – Annotator name

  • init_params – Optional parameters specifying the parameters to initialize the annotator with

  • render_product_idxs – Optionally specify the index of render products to utilize

  • device – If set, make annotator data available to specified device if possible. Select from ['cpu', 'cuda', 'cuda:<device_index>']. Defaults to cpu.

  • render_products[List] – If set, attach annotator to specified render products

  • template_name – Optional name of the template describing the annotator graph

  • do_array_copy – If True, retrieve a copy of the data array. This is recommended for workflows using asynchronous backends to manage the data lifetime. Can be set to False to gain performance if the data is expected to be used immediately within the writer. Defaults to True

  • public_name – Optional name of the annotator to be used in a writer payload. Defaults to None

initialize(**kwargs) None#

Initialize annotator parameters The initialization parameters of the annotator. Initialize can only be called before the annotator has been attached.

Parameters:

kwargs – Optional parameters specifying the parameters to initialize the annotator with

property documentation: str#
property docs: str#
property template_name: str#
property template: dict#
attach(
render_products: str | HydraTexture,
render_product_idxs: List[int] = None,
) None#

Attach annotator to specified render products. Creates the OmniGraph nodes and connections.

Parameters:
  • render_products – Render product to attach the annotator to. Note: a list of render products is currently not supported

  • render_product_idxs – Optionally specify the index of render products to attach to from the render product list provided. Note: Currently not used.

detach(
render_products: str | HydraTexture | List[str | HydraTexture] = None,
) None#

Detach an attached annotator.

If render products are specified, detach only from those render products.

Parameters:

render_product – Optional list of render products from which the annotator is to be detached. If not provided, detach annotator from all attached render products

get_data(
device: str = None,
do_array_copy: bool = False,
use_legacy_structure: bool = True,
) Any#

Return annotator data.

Note that if calling get_data() immediately after initialization, the annotator output will not yet be available. Please allow for at least one update.

Parameters:
  • device – Device to hold data in. Select from ['cpu', 'cuda', 'cuda:<device_index>']. If cpu is specified, the output data is returned in the form of a numpy array. If cuda is selected, a Warp array is returned. Note that only valid datatypes will be moved to the GPU. Defaults to the device specified on annotator initialization.

  • do_array_copy – If True, return a copy of the data. This is necessary if the data is expected to persist, such as when used in conjunction with asynchronous backends.

  • use_legacy_structure

    Specifies the output structure to return. If True, the legacy structure is returned. The legacy structure changes depending on the data being returned:

    • only array data: <array>

    • only non-array data: {<anno_attribute_0>: <anno_output_0>, <anno_attribute_n>: <aanno_output_n>}

    • array data and non-array data: {“data”: <array>, “info”: {<anno_attribute_0>: <anno_output_0>, <anno_attribute_n>: <aanno_output_n>}}

    If False, a more consistent data structure is returned:

    • all cases: {“data”: <array>, <anno_attribute_0>: <anno_output_0>, <anno_attribute_n>: <aanno_output_n>}

    Defaults to True

Example

>>> import omni.replicator.core as rep
>>> async def capture(ldr_annotator):
...     await rep.orchestrator.step_async()
...     data_warp = ldr_annotator.get_data(device="cuda")
...     data_np = data_warp.numpy()
...     data_np2 = ldr_annotator.get_data(deviec="cpu")
property is_attached: bool#

Returns True if annotator is attached to render product(s)

property name: str#

Annotator name to use as writer payload key

get_name() str#

Get annotator name

get_node() omni.graph.core.Node#

Get annotator node

augment(
augmentation: Augmentation | str | Callable | Kernel,
data_out_shape: Tuple[int] = None,
name: str = None,
device: str = None,
**kwargs,
) Annotator#

Augment annotator

Add an augmentation operation to the annotator

Parameters:
  • augmentation – Augmentation operation to apply to the annotator output

  • data_out_shape – Specifies the shape of the output array if the augmentation is specified as a warp kernel and the output array is a different shape than that of the input array. An axis value of -1 indicates that the axis is the same size of the corresponding axis in the input array.

  • name – Optional augmentation name. The augmentation name serves as the key in a writer payload dictionary. If set to None, the augmentation will take the name of the annotator. Defaults to None

  • device – Optionally specify the target device. If the augmentation is a warp kernel, the device will automatically default to "cuda".

  • kwargs – Parameters specifying the parameters to initialize the augmentation with

augment_compose(
augmentations: List[Augmentation | str],
name: str = None,
) Annotator#

Augment annotator with multiple augmentation operations

Augment annotator with a chain one or more augmentation operations

Parameters:
  • augmentations – List of augmentations to be applied in sequence to the annotator

  • name – Optional augmentation name. The augmentation name serves as the key in a writer payload dictionary. If set to None, the augmentation will take the name of the annotator. Defaults to None

Example

>>> import omni.replicator.core as rep
>>> import warp as wp
>>> @wp.kernel
... def rgba_to_rgb(data_in: wp.array3d(dtype=wp.uint8), data_out: wp.array3d(dtype=wp.uint8)):
...    i, j = wp.tid()
...    data_out[i, j, 0] = data_in[i, j, 0]
...    data_out[i, j, 1] = data_in[i, j, 1]
...    data_out[i, j, 2] = data_in[i, j, 2]
>>> def rgb_to_greyscale(data_in):
...     r, g, b = data_in[..., 0], data_in[..., 1], data_in[..., 2]
...     return (0.299 * r + 0.587 * g + 0.114 * b).astype(np.uint8)
>>> greyscale_anno = rep.annotators.get("rgb").augment_compose([
...     rep.annotators.Augmentation.from_function(rgba_to_rgb, data_out_shape=(-1, -1, 3)),
...     rep.annotators.Augmentation.from_function(rgb_to_greyscale),
... ])
class omni.replicator.core.annotators.AnnotatorRegistry#

Registry of annotators providing groundtruth data to writers.

classmethod register_augmentation(
name: str,
augmentation: Augmentation | str,
) None#

Register an augmentation operation.

Parameters:
  • name – Name under which to register augmentation

  • augmentation – Augmentation to register

Example

>>> import omni.replicator.core as rep
>>> def make_opaque(data_in):
...    data_in[..., 3] = 255
>>> rep.AnnotatorRegistry.register_augmentation(
...     "makeOpaque", rep.annotators.Augmentation.from_function(make_opaque)
... )
classmethod unregister_augmentation(name: str) None#

Register an augmentation operation.

Parameters:

name – Name of augmentation to unregister

Example

>>> import omni.replicator.core as rep
>>> def make_opaque(data_in):
...    data_in[..., 3] = 255
>>> rep.AnnotatorRegistry.register_augmentation("makeOpaque", make_opaque)
classmethod register_annotator_from_node(
name: str,
input_rendervars: List[str | list | omni.syntheticdata.SyntheticData.NodeConnectionTemplate],
node_type_id: str,
init_params: dict = None,
render_product_idxs: tuple = (0,),
output_rendervars: List[str | list] = None,
output_data_type: Any = None,
output_is_2d: bool = False,
output_channels: int = 1,
is_gpu_enabled: bool = True,
hidden: bool = False,
on_attach_callback: Callable = None,
documentation: str = None,
) None#

Register annotator from an omnigraph node definition.

Parameters:
  • name – Annotator name. This name will be used to retrieve the annotator from the registry and will be used as the key in the data dictionary provided to the writer.

  • input_rendervars – List of rendervars or other nodes that supply inputs to the node.

  • node_type_id – Node type ID

  • init_params – Annotator initialization parameters

  • render_product_idxs – Index of render products to utilize

  • output_rendervars – Specifies the render vars output by the node

  • output_data_type – Specifies the output data type

  • output_is_2d – Set to True if output is a 2D array

  • output_channels – Specifies the number of output channels of the array. Ignored if output_is_2d is set to False

  • is_gpu_enabled – If False, annotator device cannot be set to “cuda” and data will only be provided through system memory.

  • hidden – If True, annotator is not exposed by calls to get and get_registered_annotators. Intermediate annotator representations should be hidden. Defaults to False

  • on_attach_callback – Optional function to call after attaching annotator. Takes annotator node as argument.

  • documentation – Optionally document annotator functionality, input parameters and output format.

classmethod register_annotator_from_aov(
aov: str,
output_data_type: Any = None,
output_channels: int = 1,
on_attach_callback: Callable = None,
name: str = None,
is_gpu_enabled: bool = True,
documentation: str = None,
) None#

Register annotator from an Arbitrary Output Variable (AOV).

Parameters:
  • aov – AOV name

  • output_data_type – Specifies the output data type

  • output_channels – Specifies the number of output channels of the array. Ignored if output_is_2d is set to False

  • name – Optionally provide a name. If a name is not provided, the AOV name is used.

  • on_attach_callback – Optional function to call after attaching annotator. Takes annotator node as argument.

  • is_gpu_enabled – If False, annotator device cannot be set to “cuda” and data will only be provided through system memory.

  • documentation – Optionally document annotator functionality, input parameters and output format.

classmethod detach(
annotator: str | Annotator,
render_products: List[str | HydraTexture],
) None#

Detach annotator from render products

Parameters:
  • annotator – Annotator name or Annotator object to be detached

  • render_product – List of render products from which the annotator is to be detached

classmethod get_registered_annotators() List[str]#

Returns a list names of registered annotators.

Note: Hidden annotators are not returned

Returns:

List of registered annotators.

classmethod get_annotator(
name: str,
init_params: dict = None,
render_product_idxs: List[int] = None,
device: str = None,
do_array_copy: bool = True,
) Annotator#

Create a new annotator instance of given annotator name

Parameters:
  • name – Name of annotator to be retrieved from registry

  • init_params – Annotator initialization parameters

  • render_product_idxs – Index of render products to utilize

  • device – If set, make annotator data available to specified device if possible. Select from [‘cpu’, ‘cuda’, ‘cuda:<device_index>’]. Defaults to cpu

  • do_array_copy – If True, retrieve a copy of the data array. This is recommended for workflows using asynchronous backends to manage the data lifetime. Can be set to False to gain performance if the data is expected to be used immediately within the writer. Defaults to True

classmethod get_augmentation(
name: str,
) Augmentation#

Get Augmentation from registry

Parameters:

name – Augmentation name

classmethod unregister_annotator(name: str) None#

Unregister annotator

Parameters:

name – Annotator name

Default Annotators#

The current annotators that are available through the registry are:

Annotators#

Standard Annotators

RT Annotators

PathTracing Annotators

LdrColor/rgb

SmoothNormal

PtDirectIllumation

HdrColor

BumpNormal

PtGlobalIllumination

camera_params/CameraParams

Motion2d

PtReflections

normals

DiffuseAlbedo

PtRefractions

motion_vectors

SpecularAlbedo

PtSelfIllumination

cross_correspondence

Roughness

PtBackground

distance_to_image_plane

DirectDiffuse

PtWorldNormal

distance_to_camera

DirectSpecular

PtRefractionFilter

primPaths

Reflections

PtMultiMatte<0-7>

bounding_box_2d_tight_fast

IndirectDiffuse

PtWorldPos

bounding_box_2d_tight

DepthLinearized

PtZDepth

bounding_box_2d_loose_fast

EmissionAndForegroundMask

PtVolumes

bounding_box_2d_loose

AmbientOcclusion

PtDiffuseFilter

bounding_box_3d_360

PtReflectionFilter

bounding_box_3d_fast

bounding_box_3d

semantic_segmentation

instance_segmentation_fast

instance_segmentation

skeleton_data

pointcloud

CrossCorrespondence

MotionVectors

Occlusion

Some annotators support initialization parameters. For example, segmentation annotators can be parametrized with a colorize attribute specify the output format.

omni.replicator.core.annotators.get("semantic_segmentation", init_params={"colorize": True})

To see how annotators are used within a writer, we have prepared scripts that implement the basic writer which covers all standard annotators.

Standard Annotators#

These annotators can be used in any rendering mode. Each annotator’s usage and outputs are described below.

LdrColor#

Annotator Name: LdrColor, (alternative name: rgb)

The LdrColor or rgb annotator produces the low dynamic range output image as an array of type np.uint8 with shape (width, height, 4), where the four channels correspond to R,G,B,A.

Example

import omni.replicator.core as rep

async def test_ldr():
    # Add Default Light
    distance_light = rep.create.light(rotation=(315,0,0), intensity=3000, light_type="distant")

    cone = rep.create.cone()

    cam = rep.create.camera(position=(500,500,500), look_at=cone)
    rp = rep.create.render_product(cam, (1024, 512))

    ldr = rep.AnnotatorRegistry.get_annotator("LdrColor")
    ldr.attach(rp)

    await rep.orchestrator.step_async()
    data = ldr.get_data()
    print(data.shape, data.dtype)   # ((512, 1024, 4), uint8)

import asyncio
asyncio.ensure_future(test_ldr())
Normals#

Annotator Name: normals

The normals annotator produces an array of type np.float32 with shape (height, width, 4). The first three channels correspond to (x, y, z). The fourth channel is unused.

Example

import omni.replicator.core as rep

async def test_normals():
    # Add Default Light
    distance_light = rep.create.light(rotation=(315,0,0), intensity=3000, light_type="distant")

    cone = rep.create.cone()

    cam = rep.create.camera(position=(500,500,500), look_at=cone)
    rp = rep.create.render_product(cam, (1024, 512))

    normals = rep.AnnotatorRegistry.get_annotator("normals")
    normals.attach(rp)

    await rep.orchestrator.step_async()
    data = normals.get_data()
    print(data.shape, data.dtype)   ~ ((512, 1024, 4), float32)

import asyncio
asyncio.ensure_future(test_normals())
Distance to Camera#

Annotator Name: distance_to_camera

Outputs a depth map from objects to camera positions. The distance_to_camera annotator produces a 2d array of types np.float32 with 1 channel.

Data Details

  • The unit for distance to camera is in meters (For example, if the object is 1000 units from the camera, and the meters_per_unit variable of the scene is 100, the distance to camera would be 10).

  • 0 in the 2d array represents infinity (which means there is no object in that pixel).

Distance to Camera
Distance to Image Plane#

Annotator Name: distance_to_image_plane

Outputs a depth map from objects to image plane of the camera. The distance_to_image_plane annotator produces a 2d array of types np.float32 with 1 channel.

Data Details

  • The unit for distance to image plane is in meters (For example, if the object is 1000 units from the image plane of the camera, and the meters_per_unit variable of the scene is 100, the distance to camera would be 10).

  • 0 in the 2d array represents infinity (which means there is no object in that pixel).

Distance to Image Plane
Motion Vectors#

Annotator Name: motion_vectors

Outputs a 2D array of motion vectors representing the relative motion of a pixel in the camera’s viewport between frames.

The MotionVectors annotator returns the per-pixel motion vectors in in image space.

Output Format

array((height, width, 4), dtype=<np.float32>)

The components of each entry in the 2D array represent four different values encoded as floating point values:

  • x: motion distance in the horizontal axis (image width) with movement to the left of the image being positive and movement to the right being negative.

  • y: motion distance in the vertical axis (image height) with movement towards the top of the image being positive and movement to the bottom being negative.

  • z: unused

  • w: unused

Example

import asyncio
import omni.replicator.core as rep

async def test_motion_vectors():
    # Add an object to look at
    cone = rep.create.cone()

    # Add motion to object
    cone_prim = cone.get_output_prims()["prims"][0]
    cone_prim.GetAttribute("xformOp:translate").Set((-100, 0, 0), time=0.0)
    cone_prim.GetAttribute("xformOp:translate").Set((100, 50, 0), time=10.0)

    camera = rep.create.camera()
    render_product = rep.create.render_product(camera, (512, 512))

    motion_vectors_anno = rep.annotators.get("MotionVectors")
    motion_vectors_anno.attach(render_product)

    # Take a step to render the initial state (no movement yet)
    await rep.orchestrator.step_async()

    # Capture second frame (now the timeline is playing)
    await rep.orchestrator.step_async()
    data = motion_vectors_anno.get_data()
    print(data.shape, data.dtype, data.reshape(-1, 4).min(axis=0), data.reshape(-1, 4).max(axis=0))
    # (1024, 512, 4), float32,  [-93.80073  -1.       -1.       -1.     ] [ 0.       23.450201  1.        1.      ]

asyncio.ensure_future(test_motion_vectors())

Note

The values represent motion relative to camera space.

RT Annotators#

RT Annotators are only available in RayTracedLighting rendering mode (RTX - Real-Time)

Example

import asyncio
import omni.replicator.core as rep

async def test_pt_anno():
    # Set rendermode to PathTracing
    rep.settings.set_render_rtx_realtime()

    # Create an interesting scene
    red_diffuse = rep.create.material_omnipbr(diffuse=(1, 0, 0.2), roughness=1.0)
    metallic_reflective = rep.create.material_omnipbr(roughness=0.01, metallic=1.0)
    glow = rep.create.material_omnipbr(emissive_color=(1.0, 0.5, 0.4), emissive_intensity=100000.0)
    rep.create.cone(material=metallic_reflective)
    rep.create.cube(position=(100, 50, -100), material=red_diffuse)
    rep.create.sphere(position=(-100, 50, 100), material=glow)
    ground = rep.create.plane(scale=(100, 1, 100), position=(0, -50, 0))

    # Attach render product
    W, H = (1024, 512)
    camera = rep.create.camera(position=(400., 400., 400.), look_at=ground)
    render_product = rep.create.render_product(camera, (W, H))

    anno = rep.annotators.get("SmoothNormal")
    anno.attach(render_product)

    await rep.orchestrator.step_async()

    data = anno.get_data()
    print(data.shape, data.dtype)
    # (512, 1024, 4), float32

asyncio.ensure_future(test_pt_anno())
SmoothNormal#

Output Format

np.ndtype(np.float32)   # shape: (H, W, 4)
BumpNormal#

Output Format

np.ndtype(np.float32)   # shape: (H, W, 4)
AmbientOcclusion#

Output Format

np.ndtype(np.float16)   # shape: (H, W, 4)
Motion2d#

Output Format

np.ndtype(np.float32)   # shape: (H, W, 4)
DiffuseAlbedo#

Output Format

np.ndtype(np.uint8) # shape: (H, W, 4)
SpecularAlbedo#

Output Format

np.ndtype(np.float16)   # shape: (H, W, 4)
Roughness#

Output Format

np.ndtype(np.uint8) # shape: (H, W, 4)
DirectDiffuse#

Output Format

np.ndtype(np.float16)   # shape: (H, W, 4)
DirectSpecular#

Output Format

np.ndtype(np.float16)   # shape: (H, W, 4)
Reflections#

Output Format

np.ndtype(np.float32)   # shape: (H, W, 4)
IndirectDiffuse#

Output Format

np.ndtype(np.float16)   # shape: (H, W, 4)
DepthLinearized#

Output Format

np.ndtype(np.float32)   # shape: (H, W, 1)
EmissionAndForegroundMask#

Output Format

np.ndtype(np.float16)   # shape: (H, W, 1)

PathTracing Annotators#

PathTracing Annotators are only available in PathTracing rendering mode (RTX - Interactive). In addition, the following carb settings must be set on app launch:

  • rtx-transient.aov.enableRtxAovs = true

  • rtx-transient.aov.enableRtxAovsSecondary = true

Example

import asyncio
import omni.replicator.core as rep

async def test_pt_anno():
    # Set rendermode to PathTracing
    rep.settings.set_render_pathtraced()

    # Create an interesting scene
    red_diffuse = rep.create.material_omnipbr(diffuse=(1, 0, 0.2), roughness=1.0)
    metallic_reflective = rep.create.material_omnipbr(roughness=0.01, metallic=1.0)
    glow = rep.create.material_omnipbr(emissive_color=(1.0, 0.5, 0.4), emissive_intensity=100000.0)
    rep.create.cone(material=metallic_reflective)
    rep.create.cube(position=(100, 50, -100), material=red_diffuse)
    rep.create.sphere(position=(-100, 50, 100), material=glow)
    ground = rep.create.plane(scale=(100, 1, 100), position=(0, -50, 0))

    # Attach render product
    W, H = (1024, 512)
    camera = rep.create.camera(position=(400., 400., 400.), look_at=ground)
    render_product = rep.create.render_product(camera, (W, H))

    anno = rep.annotators.get("PtGlobalIllumination")
    anno.attach(render_product)

    await rep.orchestrator.step_async()

    data = anno.get_data()
    print(data.shape, data.dtype)
    # (512, 1024, 4), float16

asyncio.ensure_future(test_pt_anno())
PtDirectIllumation#

Output Format

np.ndtype(np.float16)   # Shape: (Height, Width, 4)
PtGlobalIllumination#

Output Format

np.ndtype(np.float16)   # Shape: (Height, Width, 4)
PtReflections#

Output Format

np.ndtype(np.float16)   # Shape: (Height, Width, 4)
PtRefractions#

Output Format

np.ndtype(np.float16)   # Shape: (Height, Width, 4)
PtSelfIllumination#

Output Format

np.ndtype(np.float16)   # Shape: (Height, Width, 4)
PtBackground#

Output Format

np.ndtype(np.float16)   # Shape: (Height, Width, 4)
PtWorldNormal#

Output Format

np.ndtype(np.float16)   # Shape: (Height, Width, 4)
PtWorldPos#

Output Format

np.ndtype(np.float16)   # Shape: (Height, Width, 4)
PtZDepth#

Output Format

np.ndtype(np.float16)   # Shape: (Height, Width, 4)
PtVolumes#

Output Format

np.ndtype(np.float16)   # Shape: (Height, Width, 4)
PtDiffuseFilter#

Output Format

np.ndtype(np.float16)   # Shape: (Height, Width, 4)
PtReflectionFilter#

Output Format

np.ndtype(np.float16)   # Shape: (Height, Width, 4)
PtRefractionFilter#

Output Format

np.ndtype(np.float16)   # Shape: (Height, Width, 4)
PtMultiMatte0#

Output Format

np.ndtype(np.float16)   # Shape: (Height, Width, 4)
PtMultiMatte1#

Output Format

np.ndtype(np.float16)   # Shape: (Height, Width, 4)
PtMultiMatte2#

Output Format

np.ndtype(np.float16)   # Shape: (Height, Width, 4)
PtMultiMatte3#

Output Format

np.ndtype(np.float16)   # Shape: (Height, Width, 4)
PtMultiMatte4#

Output Format

np.ndtype(np.float16)   # Shape: (Height, Width, 4)
PtMultiMatte5#

Output Format

np.ndtype(np.float16)   # Shape: (Height, Width, 4)
PtMultiMatte6#

Output Format

np.ndtype(np.float16)   # Shape: (Height, Width, 4)
PtMultiMatte7#

Output Format

np.ndtype(np.float16)   # Shape: (Height, Width, 4)

Annotator Exceptions#

exception omni.replicator.core.annotators.AnnotatorError(msg=None)#

Bases: Exception

Base exception for errors raised by annotator

exception omni.replicator.core.annotators.AnnotatorRegistryError(msg=None)#

Bases: Exception

Base exception for errors raised by the annotator registry

exception omni.replicator.core.annotators.AugmentationError(msg=None)#

Bases: Exception

Base exception for errors raised by augmentation

Annotator Utils#

class omni.replicator.core.utils.annotator_utils.AnnotatorCache#

Cache static annotator parameters to improve performance

Accessing OmniGraph attributes is relatively expensive. Cache static attributes where possible to improve performance in certain scenarios.

annotators = {}#
classmethod get_data(
annotator_id: int,
node_params: Dict,
annotator_params: Tuple,
target_device: str,
**kwargs,
)#

Retrieve annotator array data.

Parameters:
  • annotator_id – Unique annotator identifier.

  • node_params – Node parameters.

  • annotator_params – Annotator parameters as an AnnotatorParams object.

  • target_device – Target device onto white to return the data (eg. “cpu”, “cuda:0”)

classmethod get_common_params(
annotator_id: int,
node_params: Dict,
annotator_params: Tuple,
target_device: str,
use_cache: bool = False,
)#

Get annotator common parameters.

Retrieves common parameters that rarely change so they can be cached for faster data retrieval.

Parameters:
  • annotator_id – Unique annotator identifier.

  • node_params – Node parameters.

  • annotator_params – Annotator parameters as an AnnotatorParams object.

  • target_device – Target device onto white to return the data (eg. “cpu”, “cuda:0”)

  • use_cache – If True, cache common params for faster data retrieval. Defaults to False.

classmethod clear(annotator_id: int = None)#

Clear cache

Parameters:

annotator_id – Optionally specify the annotator to clear from the cache. If None, clear entire cache. Defaults to None.

omni.replicator.core.utils.annotator_utils.get_extra_data(params: Dict)#

Get all other annotator outputs, excluding array data.

Parameters:

params – Annotator parameters

omni.replicator.core.utils.annotator_utils.get_annotator_data(
node: omni.graph.core.Node,
annotator_params: Tuple,
from_inputs: bool = False,
device: str = 'cpu',
annotator_id: Tuple[str] = None,
do_copy: bool = False,
use_legacy_structure: bool = True,
) Dict#

Retrieve data from annotator node.

Parameters:
  • node – The OmniGraph annotator node object from which to retrieve data.

  • annotator_params – AnnotatorParams tuple specifying annotator metadata.

  • from_inputs – If True, annotator data is extracted from the node inputs. Defaults to False.

  • device – Specifies the device onto white to return array data. Valid values: ["cpu", "cuda", "cuda:<index>"] Defaults to "cpu".

  • annotator_id – Unique annotator identifier. Defaults to None.

  • do_copy – If True, arrays are copied before being returned. This copy ensures that the data lifetime can be managed by downstream processes. Defaults to False.

  • use_legacy_structure

    Specifies the output structure to return. If True, the legacy structure is returned. The legacy structure changes depending on the data being returned:

    • only array data: <array>

    • only non-array data: {<anno_attribute_0>: <anno_output_0>, <anno_attribute_n>: <aanno_output_n>}

    • array data and non-array data: {“data”: <array>, “info”: {<anno_attribute_0>: <anno_output_0>, <anno_attribute_n>: <aanno_output_n>}}

    If False, a consistent data structure is returned:

    • all cases: {<anno_attribute_0>: <anno_output_0>, <anno_attribute_n>: <anno_output_n>}

    Defaults to True.

omni.replicator.core.utils.annotator_utils.script_node_check(nodes: list = [])#

Prompt user before enabling a script node

Call this script in any node capable of executing arbitrary scripts within the node’s initialize() call.

Note

Only one prompt attempt is made per session

omni.replicator.core.utils.annotator_utils.check_should_run_script()#

Augmentations#

omni.replicator.core.annotators.augment(
source_annotator: Annotator | str,
augmentation: str | Augmentation,
data_out_shape: Tuple = None,
name: str = None,
device: str = None,
**kwargs,
) Annotator#

Create an augmented annotator

Parameters:
  • source_annotator – Annotator to be augmented

  • augmentation – Augmentation to be applied to source annotator. Can be specified as an Augmentation, the name of a registered augmentation or the node type id of an omnigraph node to be used as an augmentation.

  • data_out_shape – Specifies the shape of the output array if the augmentation is specified as a warp kernel and the output array is a different shape than that of the input array. An axis value of -1 indicates that the axis is the same size of the corresponding axis in the input array.

  • name – Optional augmentation name. The augmentation name serves as the key in a writer payload dictionary. If set to None, the augmentation will take the name of the source annotator. Defaults to None

  • device – Optionally specify the target device. If the augmentation is a warp kernel, the device will automatically default to "cuda".

  • kwargs – Optional parameters specifying the parameters with which to initialize the augmentation.

Example

>>> import omni.replicator.core as rep
>>> @wp.kernel
... def rgba_to_rgb(data_in: wp.array3d(dtype=wp.uint8), data_out: wp.array3d(dtype=wp.uint8)):
...    i, j = wp.tid()
...    data_out[i, j, 0] = data_in[i, j, 0]
...    data_out[i, j, 1] = data_in[i, j, 1]
...    data_out[i, j, 2] = data_in[i, j, 2]
>>> rgb_anno = rep.annotators.augment(
...     source_annotator="rgb",
...     augmentation=rep.annotators.Augmentation.from_function(rgba_to_rgb)
... )
omni.replicator.core.annotators.augment_compose(
source_annotator: Annotator | str,
augmentations: List[Augmentation | str],
name: str = None,
) Annotator#

Compose an augmentated Annotator from multiple augmentation operations

Chain one or more augmentation operations together to be applied to a source annotator.

Parameters:
  • source_annotator – Annotator to be augmented

  • augmentations – List of augmentations to be applied in sequence to the source annotator

  • name – Optional augmentation name. The augmentation name serves as the key in a writer payload dictionary. If set to None, the augmentation will take the name of the source annotator. Defaults to None

Example

>>> import omni.replicator.core as rep
>>> @wp.kernel
... def rgba_to_rgb(data_in: wp.array3d(dtype=wp.uint8), data_out: wp.array3d(dtype=wp.uint8)):
...    i, j = wp.tid()
...    data_out[i, j, 0] = data_in[i, j, 0]
...    data_out[i, j, 1] = data_in[i, j, 1]
...    data_out[i, j, 2] = data_in[i, j, 2]
>>> def rgb_to_greyscale(data_in):
...     r, g, b = data_in[..., 0], data_in[..., 1], data_in[..., 2]
...     return (0.299 * r + 0.587 * g + 0.114 * b).astype(np.uint8)
>>> greyscale_anno = rep.annotators.augment_compose(
...     source_annotator="rgb",
...     augmentations=[
...         rep.annotators.Augmentation.from_function(rgba_to_rgb),
...         rep.annotators.Augmentation.from_function(rgb_to_greyscale),
...     ]
... )
class omni.replicator.core.annotators.Augmentation(
node_type_id: str,
data_out_shape: Tuple[int] = None,
documentation: str = None,
**kwargs,
)#

Augmentation class

Augmentations are defined by a python function or warp kernel which manipulates the array held in a required data_in argument. Augmentations can be applied to any annotator which outputs a data attribute along with corresponding width and height attributes.

Parameters:
  • augmentation

    Python function or Warp kernel describing the augmentation operation. Details on required and supported optional arguments as follows:

    • data_in: Required by both python and warp augmentations and is populated with the input data array

    • data_out: Required by warp functions, holds the output array. Not supported in conjunction with python functions.

    • data_out_shape: Required for warp functions if the shape of the output array does not match that of the input array. An axis value of -1 indicate that the axis matches the input’s axis dimension.

    • seed: Optional argument that can be used with both python and warp functions. If set to None or <0, will use Replicator’s global seed together with the node identifier to produce a repeatable unique seed. When used with warp kernels, the seed is used to initialize a random number generator that produces a new integer seed value for each warp kernel call.

  • data_out_shape – Specifies the shape of the output array if the augmentation is specified as a warp kernel and the output array is a different shape than that of the input array. An axis value of -1 indicates that the axis is the same size of the corresponding axis in the input array.

  • documentation – Optionally document augmentation functionality, input parameters and output format.

  • kwargs – Optional parameters specifying the parameters to initialize the augmentation with

Example

>>> import omni.replicator.core as rep
>>> import warp as wp
>>> @wp.kernel
... def rgba_to_rgb(data_in: wp.array3d(dtype=wp.uint8), data_out: wp.array3d(dtype=wp.uint8)):
...    i, j = wp.tid()
...    data_out[i, j, 0] = data_in[i, j, 0]
...    data_out[i, j, 1] = data_in[i, j, 1]
...    data_out[i, j, 2] = data_in[i, j, 2]
>>> augmentation = rep.annotators.Augmentation.from_function(rgba_to_rgb, data_out_shape=(-1, -1, 3))
property documentation: str#
static from_node(
node_type_id: str,
attributes_mapping: Dict = None,
data_out_shape: Tuple[int] = None,
documentation: str = None,
**kwargs,
) Augmentation#

Create an augmentation from an existing OmniGraph node

When applied to an annotator, corresponding attributes between the annotator and the augmentation node will be automatically connected to one another.

Parameters:
  • node_type_id – Node type ID

  • attributes_mapping – Optional attribute mapping to connect non-matching attributes between the augmentation and the annotator to which it’s applied.

  • data_out_shape – Specifies the shape of the output array if the augmentation is specified as a warp kernel and the output array is a different shape than that of the input array. An axis value of -1 indicates that the axis is the same size of the corresponding axis in the input array.

  • documentation – Optionally document augmentation functionality, input parameters and output format.

  • kwargs – Optional parameters specifying the parameters to initialize the augmentation with

Example

>>> import omni.replicator.core as rep
>>> augmentation = rep.annotators.Augmentation.from_node("omni.replicator.core.CameraParams")
>>> anno = rep.annotators.get("PostProcessRenderProductCamera").augment(augmentation)
static from_function(
augmentation: Callable | Kernel,
data_out_shape: Tuple[int] = None,
documentation: str = None,
**kwargs,
) Augmentation#

Create an augmentation from a python function or warp kernel

Create an augmentation defined from a python function or warp kernel which manipulates the array held in a

data_in argument. Augmentations can be applied to any annotator which outputs a data attribute along with corresponding width and height attributes.

Parameters:
  • augmentation

    Python function or Warp kernel describing the augmentation operation. Details on required and supported optional arguments as follows:

    • data_in: Required by both python and warp augmentations and is populated with the input data array

    • data_out: Required by warp functions, holds the output array. Not supported in conjunction with python functions.

    • data_out_shape: Required for warp functions if the shape of the output array does not match that of the input array. An axis value of -1 indicate that the axis matches the input’s axis dimension.

    • seed: Optional argument that can be used with both python and warp functions. If set to None or < 0, will use Replicator’s global seed together with the node identifier to produce a repeatable unique seed. When used with warp kernels, the seed is used to initialize a random number generator that produces a new integer seed value for each warp kernel call.

  • data_out_shape – Specifies the shape of the output array if the augmentation is specified as a warp kernel and the output array is a different shape than that of the input array. An axis value of -1 indicates that the axis is the same size of the corresponding axis in the input array.

  • documentation – Optionally document augmentation functionality, input parameters and output format.

  • kwargs – Optional parameters specifying the parameters to initialize the augmentation with

Example

>>> import omni.replicator.core as rep
>>> import warp as wp
>>> @wp.kernel
... def rgba_to_rgb(data_in: wp.array3d(dtype=wp.uint8), data_out: wp.array3d(dtype=wp.uint8)):
...    i, j = wp.tid()
...    data_out[i, j, 0] = data_in[i, j, 0]
...    data_out[i, j, 1] = data_in[i, j, 1]
...    data_out[i, j, 2] = data_in[i, j, 2]
>>> augmentation = rep.annotators.Augmentation(rgba_to_rgb, data_out_shape=(-1, -1, 3))
apply(
annotator: str | Annotator,
name: str = None,
**kwargs,
) Annotator#

Apply augmentation to annotator

Parameters:
  • annotator – Annotator to apply the augmentation to.

  • name – Optional augmentation name. The augmentation name serves as the key in a writer payload dictionary. If set to None, the augmentation will take the name of the annotator. Defaults to None

  • kwargs – Optional parameters specifying the parameters with which to initialize the augmentation.

Default Augmentations#

Writers#

Writers are how to get data from Omniverse Replicator out to disk.

omni.replicator.core.writers.get(
name: str,
init_params: Dict = None,
render_products: List[str | HydraTexture] = None,
trigger: ReplicatorItem | Callable = 'omni.replicator.core.OgnOnFrame',
) Writer#

Get writer instance from registered writers

Parameters:
  • name – Writer name

  • init_params – Dictionary of initialization parameters with which to initialize writer

  • render_products – List of render products to attach to writer

  • trigger – Function or replicator trigger that triggers the write() function of the writer. If a function is supplied, it must return a boolean. If set to None, the writer is set to a manual mode where it can be triggered by calling writer.schedule_write().

Example

>>> import omni.replicator.core as rep
>>> rp = rep.create.render_product(rep.create.camera(), (512, 512))
>>> writer = rep.writers.get(
...     name="BasicWriter",
...     init_params={"output_dir": "_out", "rgb": True},
...     render_products=rp,
...     trigger=None,
... )
omni.replicator.core.writers.unregister_writer(writer_name) None#

Unregister a writer with specified name if it exists.

Parameters:

writer_name – Name of registered writer.

Example

>>> import omni.replicator.core as rep
>>> class MyWriter(rep.Writer):
...     def __init__(self):
...         self.annotators = ["LdrColor"]
...         self.frame_id
...     def write(self, data):
...         print(f"I have data #{self.frame_id}!")
...         self.frame_id += 1
>>> rep.writers.register_writer(MyWriter)
>>> rep.writers.unregister_writer("MyWriter")
omni.replicator.core.writers.register_writer(
writer: Writer,
category: str = None,
) None#

Register a writer.

Registered writers can be retrieved with WriterRegistry.get(<writer_name>)

Parameters:
  • writer – Instance of class Writer.

  • category – Optionally specify a category of writer to group writers together.

Example

>>> import omni.replicator.core as rep
>>> class MyWriter(rep.Writer):
...     def __init__(self):
...         self.annotators = ["LdrColor"]
...         self.frame_id
...     def write(self, data):
...         print(f"I have data #{self.frame_id}!")
...         self.frame_id += 1
>>> rep.writers.register_writer(MyWriter)
omni.replicator.core.writers.register_node_writer(
name: str,
node_type_id: str,
annotators: List,
category: str = None,
**kwargs,
) None#

Register a Node Writer

Register a writer implemented as an omnigraph node.

Parameters:
  • node_type_id – The node’s type identifier (eg. 'my.extension.OgnCustomNode')

  • annotators – List of dependent annotators

  • category – Optionally specify a category of writer to group writers together.

  • kwargs – Node Writer input attribute initialization

class omni.replicator.core.writers.WriterRegistry#

This class stores a list of available registered writers and which writers are attached to render products.

One or more writers can be attached simultaneously to the same render product to simultaneously write ground truth in multiple formats.

Register a writer with WriterRegistry.register(ExampleWriter) Attach a writer to a render_product with WriterRegistry.attach("Example", "/World/Render Product") Detach a writer with WriterRegistry.detach("Example")

classmethod register(
writer: Writer,
category: str = None,
) None#

Register a writer.

Registered writers can be retrieved with WriterRegistry.get(<writer_name>)

Parameters:
  • writer – Instance of class Writer.

  • category – Optionally specify a category of writer to group writers together.

classmethod register_node_writer(
name: str,
node_type_id: str,
annotators: List[str | Annotator],
category: str = None,
**kwargs,
) None#

Register a Node Writer

Register a writer implemented as an omnigraph node.

Parameters:
  • node_type_id – The node’s type identifier (eg. 'my.extension.OgnCustomNode')

  • annotators – List of dependent annotators

  • category – Optionally specify a category of writer to group writers together.

  • kwargs – Node Writer input attribute initialization

classmethod unregister(writer_name) None#

Unregister a writer with specified name if it exists.

Parameters:

writer_name – Name of registered writer.

classmethod attach(
writer: Writer | NodeWriter,
render_products: str | HydraTexture | List[str | HydraTexture],
init_params: Dict = None,
trigger: ReplicatorItem | Callable = 'omni.replicator.core.OgnOnFrame',
**kwargs,
) None#

Attach writer with specified name to render_products.

Parameters:
  • writer – Writer instance

  • render_products – Render Product prim path(s).

  • init_params – (Deprecated) Dictionary of initialization parameters.

  • trigger – Function or replicator trigger that triggers the write() function of the writer. If a function is supplied, it must return a boolean. If set to None, the writer is set to a manual mode where it can be triggered by calling writer.schedule_write().

  • kwargs – Additional initialization parameters.

classmethod detach(
writer_name: str,
render_products: str | HydraTexture | List[str | HydraTexture] = None,
) None#

Detach active writer with specified id from render_products.

Parameters:
  • writer_name – Name of writer(s) to be detached.

  • render_products – List of render product prim paths from which to disable the specified writer. If not provided, writers of matching writer_name will be disabled from all render products.

classmethod get_writers(category: str = None) dict#

Return dictionary of registered writers with mapping {writer_name: writer}.

Parameters:

category – Optionally specify the category of the writers to retrieve.

classmethod get(
writer_name: str,
init_params: Dict = None,
render_products: List[str | HydraTexture] = None,
trigger: ReplicatorItem | Callable = 'omni.replicator.core.OgnOnFrame',
) Writer#

Get a registered writer

Parameters:
  • writer_name – Writer name

  • init_params – Dictionary of initialization parameters with which to initialize writer

  • render_products – List of render products to attach to writer

  • trigger – Function or replicator trigger that triggers the write() function of the writer. If a function is supplied, it must return a boolean. If set to None, the writer is set to a manual mode where it can be triggered by calling writer.schedule_write().

classmethod get_attached_writers(
render_products: str | HydraTexture | List[str | HydraTexture] = None,
) dict#

Return dictionary of enabled writers with mapping {writer_name: writer}.

Parameters:

render_products ([string, list[string]], optional) – Render Product prim path(s).

classmethod get_attached_writer(
writer_name: str,
render_products: str | HydraTexture | List[str | HydraTexture],
) Writer#

Return the Writer object of writer_name on render_products.

Parameters:
  • writer_name – Writer name

  • render_products – Render Product prim path(s)

classmethod get_writer_render_products() set#

Return set of all render_products that are associated with one or more enabled writers.

classmethod get_annotators(
render_products: str | HydraTexture | List[str | HydraTexture] = None,
) set#

Return a set of annotators required by all enabled writers associated with render_products.

Parameters:

render_products – Render Product prim path(s).

async classmethod initialize_annotators(
render_products: str | HydraTexture | List[str | HydraTexture] = None,
) None#

Call the initialize_fn of the annotators associated with render_products, if available.

Parameters:

render_products – Render Product prim path(s).

classmethod detach_all() None#

Detach all active writers

Writer Base Class#

class omni.replicator.core.writers.Writer#

Base Writer class.

Writers must specify a list of required annotators which will be called during data collection. Annotator data is packaged in a data dictionary of the form <annotator_name>: <annotator_data> and passed to the writer’s write function.

__init__() and write() must be implemented by custom writers that inherit from this class.

An optional on_final_frame() function can be defined to run once data generation is stopped.

backend#

Optionally specify a rep.backends.Backend object. The backend specified here is used to automatically write metadata data.

version#

Writer version number.

annotators#

Required list of annotators to attach to writer.

num_written#

Integer that is incremented with every call to write()

data_structure#

Specifies the writer’s output data structure. Valid values: ["legacy", "annotator", "renderProduct"] - annotator: {“annotators”: <anno>: {<render_product>: {<annotator_data>}}} - renderProduct: {“renderProducts”: <render_product>: {<anno>: {<annotator_data>}}} - legacy (multi renderProduct): {<render_product>_<anno>: {<annotator_data>}} - legacy (single renderProduct): {<anno>: {<annotator_data>}}

get_metadata()#

Get writer metadata

reset()#

Clear writer cached data

This ensures that cached data does not leak if a reference to the writer remains alive.

abstract write(data: dict)#

Write ground truth.

schedule_write()#

Manually schedule a write call to the writer

Sends a writerTrigger event to schedule the writer for the current simulation frame. Used in conjunction with writer trigger set to None (ie. writer.attach(<render_product>, trigger=None).

Note

The writer will not write data until the scheduled frame is rendered through subsequent update or step calls.

Example

>>> import omni.replicator.core as rep
>>> rp = rep.create.render_product(rep.create.camera(), (512, 512))
>>> writer = rep.writers.get(
...     name="BasicWriter",
...     init_params={"output_dir": "_out", "rgb": True},
...     render_products=rp,
...     trigger=None,
... )
>>> # ... initialize/step orchestrator
>>> writer.schedule_write()
>>> # ... step/update to render and write scheduled frame
get_data() Dict#

Get the writer’s current data payload.

Returns the data payload currently stored in the writer. Note that this payload corresponds to the frame at data["reference_time"] which may be older than the current simulation time. Use rep.orchestrator.step_async to ensure that the simulation state matches the writer payload data.

get_annotators() Dict#

Get Writer Annotators

Creates a dictionary of annotators indexed by their name.

get_attached_annotators() List#

Get all attached annotator instances across all render products

Parameters:

render_product_path – The render product path. If not specified, return all attached annotators.

Returns:

List of annotator instances

get_annotator(name: str) Dict#

Get Writer Annotator

Get the writer annotator of name name if it exists. If no annotator is found, return None.

Parameters:

name – Annotator name

add_annotator(
annotator: Annotator,
name: str = None,
) None#

Add an annotator

Add an annotator to the writer. If an existing annotator of the same name already exists, replace it.

Parameters:
  • annotator (Annotator) – Annotator providing data to the writer.

  • name – Optionally specify an annotator name. The annotator data will be passed to the writer payload indexed

  • None (on this name. If name is)

  • None. (the annotator name is used. Defaults to)

augment_annotator(
annotator_name: str,
augmentation: Augmentation | str | Callable | Kernel,
**kwargs,
) None#

Augment an existing writer annotator

The augmented annotator will be available under the same annotator name within the data payload. Note that care must be taken to ensure that the augmentation applied are compatible with the data processing and I/O operations within the writer.

Parameters:
  • annotator_name – The name of the annotator to be augmented.

  • augmentation – Augmentation to be applied to source annotator. Can be specified as an Augmentation, the name of a registered augmentation or the node type id of an omnigraph node to be used as augmentation.

  • kwargs – Optional parameters specifying the parameters with which to initialize the augmentation.

on_final_frame()#

Run after final frame is written.

initialize(**kwargs)#

Initialize writer If the writer takes initialization arguments, they can be set here.

Parameters:

**kwargs – Writer initialization arguments.

attach(
render_products: str | HydraTexture | List[str | HydraTexture],
trigger: ReplicatorItem | Callable = 'omni.replicator.core.OgnOnFrame',
)#

Attach writer to specified render products.

Parameters:
  • render_products – Render Product prim path(s) to which to attach the writer.

  • trigger – Function or replicator trigger that triggers the write function of the writer. If a function is supplied, it must return a boolean. If set to None, the writer is set to a manual mode where it can be triggered by calling writer.schedule_write.

async attach_async(
render_products: str | HydraTexture | List[str | HydraTexture],
trigger: ReplicatorItem | Callable = 'omni.replicator.core.OgnOnFrame',
)#

Attach writer to specified render products and await attachment completed

Parameters:
  • render_products – Render Product prim path(s) to which to attach the writer.

  • trigger – Function or replicator trigger that triggers the write() function of the writer. If a function is supplied, it must return a boolean. If set to None, the writer is set to a manual mode where it can be triggered by calling writer.schedule_write().

detach()#

Detach writer

get_node() omni.graph.core.Node#

Get writer node

Default Writers#

BasicWriter#

class omni.replicator.core.writers_default.BasicWriter(
output_dir: str = None,
s3_bucket: str = None,
s3_region: str = None,
s3_endpoint: str = None,
semantic_types: List[str] = None,
rgb: bool = False,
bounding_box_2d_tight: bool = False,
bounding_box_2d_loose: bool = False,
semantic_segmentation: bool = False,
instance_id_segmentation: bool = False,
instance_segmentation: bool = False,
distance_to_camera: bool = False,
distance_to_image_plane: bool = False,
bounding_box_3d: bool = False,
occlusion: bool = False,
normals: bool = False,
motion_vectors: bool = False,
camera_params: bool = False,
pointcloud: bool = False,
pointcloud_include_unlabelled: bool = False,
image_output_format: str = 'png',
colorize_semantic_segmentation: bool = True,
colorize_instance_id_segmentation: bool = True,
colorize_instance_segmentation: bool = True,
colorize_depth: bool = False,
skeleton_data: bool = False,
frame_padding: int = 4,
semantic_filter_predicate: str = None,
use_common_output_dir: bool = False,
backend: BaseBackend = None,
)#

Basic writer capable of writing built-in annotator groundtruth.

Parameters:
  • output_dir – Output directory string that indicates the directory to save the results.

  • s3_bucket – The S3 Bucket name to write to. If not provided, disk backend will be used instead. Default: None. This backend requires that AWS credentials are set up in ~/.aws/credentials. See https://boto3.amazonaws.com/v1/documentation/api/latest/guide/quickstart.html#configuration

  • s3_region – If provided, this is the region the S3 bucket will be set to. Default: us-east-1

  • s3_endpoint – If provided, this endpoint URL will be used instead of the default.

  • semantic_types – List of semantic types to consider when filtering annotator data. Default: ["class"]

  • rgb – Boolean value that indicates whether the rgb/LdrColor annotator will be activated and the data will be written or not. Default: False.

  • bounding_box_2d_tight – Boolean value that indicates whether the bounding_box_2d_tight annotator will be activated and the data will be written or not. Default: False.

  • bounding_box_2d_loose – Boolean value that indicates whether the bounding_box_2d_loose annotator will be activated and the data will be written or not. Default: False.

  • semantic_segmentation – Boolean value that indicates whether the semantic_segmentation annotator will be activated and the data will be written or not. Default: False.

  • instance_id_segmentation – Boolean value that indicates whether the instance_id_segmentation annotator will be activated and the data will be written or not. Default: False.

  • instance_segmentation – Boolean value that indicates whether the instance_segmentation annotator will be activated and the data will be written or not. Default: False.

  • distance_to_camera – Boolean value that indicates whether the distance_to_camera annotator will be activated and the data will be written or not. Default: False.

  • distance_to_image_plane – Boolean value that indicates whether the distance_to_image_plane annotator will be activated and the data will be written or not. Default: False.

  • bounding_box_3d – Boolean value that indicates whether the bounding_box_3d annotator will be activated and the data will be written or not. Default: False.

  • occlusion – Boolean value that indicates whether the occlusion annotator will be activated and the data will be written or not. Default: False.

  • normals – Boolean value that indicates whether the normals annotator will be activated and the data will be written or not. Default: False.

  • motion_vectors – Boolean value that indicates whether the motion_vectors annotator will be activated and the data will be written or not. Default: False.

  • camera_params – Boolean value that indicates whether the camera_params annotator will be activated and the data will be written or not. Default: False.

  • pointcloud – Boolean value that indicates whether the pointcloud annotator will be activated and the data will be written or not. Default: False.

  • pointcloud_include_unlabelled – If True, pointcloud annotator will capture any prim in the camera’s perspective, not matter if it has semantics or not. If False, only prims with semantics will be captured. Defaults to False.

  • image_output_format – String that indicates the format of saved RGB images. Default: "png"

  • colorize_semantic_segmentation – If True, semantic segmentation is converted to an image where semantic IDs are mapped to colors and saved as a uint8 4 channel PNG image. If False, the output is saved as a uint32 PNG image. Defaults to True.

  • colorize_instance_id_segmentation – If True, instance id segmentation is converted to an image where instance IDs are mapped to colors. and saved as a uint8 4 channel PNG image. If False, the output is saved as a uint32 PNG image. Defaults to True.

  • colorize_instance_segmentation – If True, instance segmentation is converted to an image where instance are mapped to colors. and saved as a uint8 4 channel PNG image. If False, the output is saved as a uint32 PNG image. Defaults to True.

  • colorize_depth – If True, will output an additional PNG image for depth for visualization Defaults to False.

  • frame_padding – Pad the frame number with leading zeroes. Default: 4

  • semantic_filter_predicate

    A string specifying a semantic filter predicate as a disjunctive normal form of semantic type, labels.

    Examples :

    ”typeA : labelA & !labelB | labelC , typeB: labelA ; typeC: labelD” “typeA : * ; * : labelA”

  • use_common_output_dir – If True, output for each annotator coming from multiple render products are saved under a common directory with the render product as the filename prefix (eg. <render_product_name>_<annotator_name>_<sequence>.<format>). If False, multiple render product outputs are placed into their own directory (eg. <render_product_name>/<annotator_name>_<sequence>.<format>). Setting is ignored if using the writer with a single render product. Defaults to False.

  • backend – Optionally pass a backend to use. If specified, output_dir and s3_<> arguments may be omitted. If both are provided, the backends will be grouped.

Example

>>> import omni.replicator.core as rep
>>> import carb
>>> camera = rep.create.camera()
>>> render_product = rep.create.render_product(camera, (1024, 1024))
>>> writer = rep.WriterRegistry.get("BasicWriter")
>>> tmp_dir = carb.tokens.get_tokens_interface().resolve("${temp}/rgb")
>>> writer.initialize(output_dir=tmp_dir, rgb=True)
>>> writer.attach([render_product])
>>> rep.orchestrator.run()

FPSWriter#

class omni.replicator.core.writers_default.FPSWriter#

Record Writer FPS

Writer that can be attached to record and print out writer FPS. Typically attached together with another writer.

Note

Writer does not write any data.

KittiWriter#

class omni.replicator.core.writers_default.KittiWriter(
output_dir: str,
s3_bucket: str = None,
s3_region: str = None,
s3_endpoint: str = None,
semantic_types: List[str] = None,
omit_semantic_type: bool = False,
bbox_height_threshold: int = 25,
partly_occluded_threshold: float = 0.5,
fully_visible_threshold: float = 0.95,
renderproduct_idxs: List[tuple] = None,
mapping_path: str = None,
mapping_dict: dict = None,
colorize_instance_segmentation: bool = False,
semantic_filter_predicate: str = None,
use_kitti_dir_names: bool = False,
)#

Writer outputting data in the KITTI annotation format: http://www.cvlibs.net/datasets/kitti/

Note

Development work to provide full-support is ongoing.

Supported Annotations: - RGB - Object Detection (partial 2D support, see notes) - Depth - Semantic Segmentation - Instance Segmentation

Parameters:
  • output_dir – Output directory to which KITTI annotations will be saved.

  • semantic_types – List of semantic types to consider. If None, only consider semantic types "class".

  • omit_semantic_type – If True, only record the semantic data (ie. class: car becomes car).

  • bbox_height_threshold – The minimum valid bounding box height, in pixels. Value must be positive integers.

  • partly_occluded_threshold – Minimum occlusion factor for bounding boxes to be considered partly occluded.

  • fully_visible_threshold – Minimum occlusion factor for bounding boxes to be considered fully visible.

  • mapping_path – File path to JSON to use as the label to color mapping for KITTI. ex: {'car':(155, 255, 74, 255)} If no mapping_path is supplied, the default semantics specified in the KITTI spec will be used. Note that semantics not specified in the mapping will be labelled as “unlabelled”. The mapping may include both “unlabelled” and “background” labels to specify how each is colored when colorize_instance_segmentation is True

  • mapping_dict – Dictionary of labels and their colors in (R,G,B,A). ex: {"my_semantic": (12, 07, 83, 255)} mapping_dict and mapping_path cannot both be specified.

  • colorize_instance_segmentation – If True, save an additional colorized instance segmentation image to the instance_rgb directory

  • use_kitti_dir_names – If True, use standard KITTI directory names: rgb -> image_02, semantic_segmentation -> semantic, instance_segmentation -> instance, object_detection -> label_02

Note

  • Object Detection

  • Bounding boxes with a height smaller than 25 pixels are discarded

  • Supported: bounding box extents, semantic labels

  • Partial Support: occluded (occlusion is estimated from the area ratio of tight / loose bounding boxes)

  • Unsupported: alpha, dimensions, location, rotation_y, truncated (all set to default values of 0.0)

COCOWriter#

class omni.replicator.core.writers_default.CocoWriter(
output_dir: str,
semantic_types: List[str] = None,
coco_categories: dict = None,
s3_bucket: str = None,
s3_region: str = None,
s3_endpoint: str = None,
dataset_id: str = None,
frame_padding: int = 4,
image_output_format: str = 'png',
coco_license_info: List[dict] = None,
**kwargs,
)#

Writer outputting data in the Coco annotation format: https://cocodataset.org/#format-data

Note

Development work to provide full-support is ongoing.

  • Supported: Object Detection, Stuff Segmentation, Panoptic Segmentation

  • Unsupported: Keypoints, Image Captioning, DensePose

cocodataset/panopticapi

Supported Annotations:
  • RGB

  • Object Detection

  • Semantic Segmentation

Parameters:
  • output_dir – Output directory to which Coco annotations will be saved.

  • semantic_types – List of semantic types to consider. If None, only consider semantic types ['class', 'coco', 'stuff', 'thing'].

  • coco_categories – Dictionary of COCO compatible labels. Required keys: name, id. If None, will use the built-in COCO labels from https://cocodataset.org ex: {"semantic_name": 'name': 'semantic_name', 'id': 1234, 'supercategory': 'super_name', 'color': (03, 23, 15), 'isthing': 1}

  • s3_bucket – The S3 Bucket name to write to. If not provided, disk backend will be used instead. Default: None. This backend requires that AWS credentials are set up in ~/.aws/credentials. See https://boto3.amazonaws.com/v1/documentation/api/latest/guide/quickstart.html#configuration

  • s3_region – If provided, this is the region the S3 bucket will be set to. Default: us-east-1

  • s3_endpoint – If provided, this endpoint URL will be used instead of the default.

  • dataset_id – An identifier to be added to the output file names. If None, will use a random string

  • image_output_format – Image filetype to write to disk, default is PNG

  • coco_license_info – Dictionary of license information to add. [{"id": int, "name": str, "url": str,},]. See: https://cocodataset.org/#format-data

Writer Utils#

omni.replicator.core.writers_default.tools.data_to_colour(data)
omni.replicator.core.writers_default.tools.colorize_distance(
distance_data: array | ndarray,
near: float = 1e-05,
far: float = 100.0,
)

Convert distance in meters to grayscale image.

Parameters:
  • distance_data (wp.array, numpy.array) – data returned by the annotator.

  • near (float) – near value to clip the distance_data. Set value to None to autofit data to min()

  • far (float) – far value to clip the distance_data. Set value to None to autofit data to max() (disregarding np.inf)

Returns:

Data converted to uint8 from (0, 255)

Return type:

(ndarray)

omni.replicator.core.writers_default.tools.binary_mask_to_rle(binary_mask)

Convert a Binary Mask to RLE format neeeded by Pycocotools: Args: binary_mask - numpy.array of 0’s and 1’s representing current segmentation returns - data in RLE format to be used by pycocotools.

omni.replicator.core.writers_default.tools.colorize_segmentation(data, labels, mapping=None)

Convert segmentation data into colored image.

Parameters:
  • data (numpy.array) – data returned by the annotator.

  • dict (labels) – label data mapping semantic IDs to semantic labels - {“0”: {“class”:”cube”}, “1”: {“class”, “sphere”}}

  • mapping (dict) – mapping from ids to labels used for retrieving color {(255, 0, 0): {“class”:”cube”}, (0, 255, 0)}: {“class”:”sphere”}}

Returns:

Data coverted to uint8 RGBA image and remapped labels

Return type:

Tuple[np.array, dict]

omni.replicator.core.writers_default.tools.colorize_motion_vector(data)

Convert motion vector into colored image. The conversion is done by mapping 3D direction vector to HLS space, then converted to RGB.

Parameters:

data (numpy.array) – data returned by the annotator of shape (H, W, 4).

Returns:

Data converted to uint8 RGBA image.

Return type:

(ndarray)

omni.replicator.core.writers_default.tools.colorize_bbox_2d(
image: ndarray,
data: ndarray,
xform: ndarray = None,
draw_rotated_boxes: bool = False,
) ndarray

Colorizes 2D bounding box data for visualization.

Parameters:
  • image – RGBA Image that bounding boxes are drawn onto.

  • data – 2D bounding box data from the annotator.

  • xform – Optional 3x3 transform matrix to apply to the points. The Xform expects height, width ordering.

  • draw_rotated_boxes – If True, draw bounding boxes with orientation using four corners when transformed using xform. Ignored if xform is None. Defaults to False.

Returns:

Data converted to uint8 RGB image, which the outline of the bounding box is colored.

Return type:

(ndarray)

omni.replicator.core.writers_default.tools.colorize_normals(data)

Convert normals data into colored image.

Parameters:

data (ndarray) – data returned by the annotator.

Returns:

Data converted to uint8 RGB image.

Return type:

(ndarray)

omni.replicator.core.writers_default.tools.random_colours(N, enable_random=True, num_channels=4)

Generate random colors. Generate visually distinct colours by linearly spacing the hue channel in HSV space and then convert to RGB space.

Triggers#

omni.replicator.core.trigger.on_frame(
interval: int = 1,
num_frames: int = 0,
name: str = 'on_frame',
rt_subframes: int = 1,
max_execs: int = 0,
) ReplicatorItem#

Execute on a specific generation frame.

Parameters:
  • interval – The generation frame interval to execute on.

  • num_frames – (Will be deprecated) Replaced by max_execs. The number of times to activate the trigger. Generation automatically stops when all triggers have reached their maximum activation number. Note that this determines the number of times that the trigger is activated and not the number of times data is written.

  • name – The name of the trigger.

  • rt_subframes – If rendering in RTX Realtime mode, specifies the number of subframes to render in order to reduce artifacts caused by large changes in the scene.

  • max_execs – The number of times to activate the trigger. Generation automatically stops when all triggers have reached their maximum activation number.

Example

>>> import omni.replicator.core as rep
>>> spheres = rep.create.sphere(count=10, scale=rep.distribution.uniform(1., 3.))
>>> with rep.trigger.on_frame(max_execs=10):
...    with spheres:
...        mod = rep.modify.pose(position=rep.distribution.uniform((-500., -500., -500.), (500., 500., 500.)))
omni.replicator.core.trigger.on_key_press(
key: str,
modifier: str = None,
name: str = None,
) ReplicatorItem#

Execute when a keyboard key is input.

Parameters:
  • key – The key to listen for.

  • modifier – Optionally add a modifier [shift, alt, ctrl]

  • name – The name of the trigger.

Example

>>> import omni.replicator.core as rep
>>> spheres = rep.create.sphere(count=10, scale=rep.distribution.uniform(1., 3.))
>>> with rep.trigger.on_key_press(key="P", modifier="shift"):
...    with spheres:
...        mod = rep.modify.pose(position=rep.distribution.uniform((-500., -500., -500.), (500., 500., 500.)))
omni.replicator.core.trigger.on_time(
interval: float = 1,
num: int = 0,
name: str = 'on_time',
rt_subframes: int = 32,
enable_capture_on_play: bool = True,
reset_physics: bool = True,
max_execs: int = 0,
) ReplicatorItem#

Execute on a specific time interval.

Parameters:
  • interval – The interval of elapsed time to execute on.

  • num – (Will be deprecated) Replaced by max_execs. The number of times to activate the trigger. Generation automatically stops when all triggers have reached their maximum activation number. Note that this determines the number of times that the trigger is activated and not the number of times data is written.

  • name – The name of the trigger.

  • rt_subframes – If rendering in RTX Realtime mode, specifies the number of subframes to render in order to reduce artifacts caused by large changes in the scene.

  • enable_capture_on_play – Enable CaptureOnPlay which ties replicator capture with the timeline state. Defaults to True.

  • reset_physics – If True physics simulation is reset on each trigger activation. Defaults to True.

  • max_execs – The number of times to activate the trigger. Generation automatically stops when all triggers have reached their maximum activation number. Note that this determines the number of times that the trigger is activated and not the number of times data is written.

Example

>>> import omni.replicator.core as rep
>>> spheres = rep.create.sphere(count=10, scale=rep.distribution.uniform(1., 3.))
>>> with rep.trigger.on_time(max_execs=10):
...    with spheres:
...        mod = rep.modify.pose(position=rep.distribution.uniform((-500., -500., -500.), (500., 500., 500.)))
omni.replicator.core.trigger.on_custom_event(
event_name: str,
) ReplicatorItem#

Execute when a specified event is received.

Parameters:

event_name – The name of the event to listen for.

Example

>>> import omni.replicator.core as rep
>>> spheres = rep.create.sphere(count=10, scale=rep.distribution.uniform(1., 3.))
>>> with rep.trigger.on_custom_event(event_name="Randomize!"):
...    with spheres:
...        mod = rep.modify.pose(position=rep.distribution.uniform((-500., -500., -500.), (500., 500., 500.)))
>>> # Send event
>>> rep.utils.send_og_event("Randomize!")
omni.replicator.core.trigger.on_condition(
condition: partial | Callable,
max_execs: int = 0,
rt_subframes: int = 1,
) ReplicatorItem#

Execute when a specified condition is met.

Create a OnCondition trigger which activates when condition returns True.

Parameters:
  • condition – The function or partial defining the condition to be met. Must return a bool. Function parameters are automatically added to the node as inputs. If default parameters are provided, these default values will be used.

  • max_execs – The number of times to activate the trigger. Generation automatically stops when all triggers have reached their maximum activation number.

  • rt_subframes – If rendering in RTX Realtime mode, specifies the number of subframes to render in order to reduce artifacts caused by large changes in the scene. Default is 1.

Example

>>> import omni.usd
>>> import omni.replicator.core as rep
>>> from functools import partial
>>> # Create a condition that returns ``True`` whenever a prim reaches the specified threshold
>>> def is_on_ground(prim_paths, threshold=0.):
...     import omni.usd
...     from pxr import UsdGeom
...     stage = omni.usd.get_context().get_stage()
...     up_axis = UsdGeom.GetStageUpAxis(stage)
...     op = "xformOp:translate"
...     idx = 1 if up_axis == "Y" else 2
...     for prim_path in prim_paths:
...         prim = stage.GetPrimAtPath(str(prim_path))
...         if prim.HasAttribute(op) and prim.GetAttribute(op).Get()[idx] <= threshold:
...             return True
...     return False
>>> spheres = rep.create.sphere(count=10, scale=rep.distribution.uniform(1., 3.))
>>> # Reposition the spheres when condition is met
>>> with rep.trigger.on_condition(condition=partial(is_on_ground, prim_paths=spheres.get_output("prims"))):
...    with spheres:
...        mod = rep.modify.pose(position=rep.distribution.uniform((-500., 200., 200.), (500., 500., 500.)))
...        phys = rep.physics.rigid_body()
omni.replicator.core.trigger.register(
fn: Callable[[...], ReplicatorItem | omni.graph.core.Node],
override: bool = True,
fn_name: str = None,
) None#

Register a new function under omni.replicator.core.trigger. Extend the default capabilities of omni.replicator.core.trigger by registering new functionality. New functions must return a ReplicatorItem or an OmniGraph node.

Parameters:
  • fn – A function that returns a ReplicatorItem or an OmniGraph node.

  • override – If True, will override existing functions of the same name. If False, an error is raised.

  • fn_name – Optional arg that let user choose the function name when registering it in replicator. If not specified, the function name is used. fn_name must follow valid [Python identifier rules] (https://docs.python.org/3.10/reference/lexical_analysis.html#identifiers)

Orchestrator#

Simulation Control#

omni.replicator.core.orchestrator.pause() None#

Pause a running replicator scenario

Submit the Pause command to replicator without waiting for its status to change to Paused.

omni.replicator.core.orchestrator.preview() None#

Run the replicator scenario for a single iteration

Submit the Preview command to replicator without waiting for a frame to be previewed. Writers are disabled during preview.

omni.replicator.core.orchestrator.resume() None#

Resume a paused replicator scenario

Submit the Resume command to replicator without waiting for its status to change to Started.

omni.replicator.core.orchestrator.run(num_frames: int = None, start_timeline: bool = False) None#

Run the replicator scenario

Submit the Start command to replicator without waiting for its status to change to Started.

Parameters:
  • num_frames – Optionally specify the maximum number of frames to capture. Note that num_frames does not override the number of frames specified in triggers defined in the scene.

  • start_timeline – Optionally start the timeline when Replicator starts.

omni.replicator.core.orchestrator.run_until_complete(
num_frames: int = None,
start_timeline: bool = False,
) None#

Run the replicator scenario until stopped (standalone workflow)

Synchronous function: only use from standalone workflow (controlling Kit app from python). Generation ends when all triggers have reached their end condition or when a stop event is published.

Parameters:

num_frames – Optionally specify the maximum number of frames to capture. Note that num_frames does not override the number of frames specified in triggers defined in the scene.

omni.replicator.core.orchestrator.step(
rt_subframes: int = -1,
pause_timeline: bool = True,
delta_time: float = None,
wait_for_render: bool = True,
) None#

Step one frame (standalone workflow)

Synchronous step function: only use from standalone workflow (controlling Kit app from python). If Replicator is not yet started, an initialization step is first taken to ensure the necessary settings are set for data capture. The renderer will then render as many subframes as required by current settings and schedule a frame to be captured by any active annotators and writers.

Parameters:
  • rt_subframes – Specify the number of subframes to render. During subframe generation, the simulation is paused. This is often beneficial when large scene changes occur to reduce rendering artifacts or to allow materials to fully load. This setting is enabled for both RTX Real-Time and Path Tracing render modes. Values must be greater than 0.

  • pause_timeline – If True, pause timeline after step. Defaults to True.

  • delta_time – The amount of time that timeline advances for each step call. When delta_time == None, default timeline rate will be used. When delta_time == 0.0, timeline will not advance. When delta_time > 0.0, timeline will advance by the custom delta_time.

  • wait_for_render – If True, wait for a render to complete. Set to True whenever it is necessary for the annotation/writer data match the current simulation state. Defaults to True.

omni.replicator.core.orchestrator.stop() None#

Stop the replicator scenario

Submit the Stop command to replicator without waiting for its status to change to Stopped.

omni.replicator.core.orchestrator.wait_until_complete() None#

Wait until generation is complete (standalone workflow)

Synchronous function: only use from standalone workflow (controlling Kit app from python). Blocks execution until synthetic data generation has completed.

Simulation Control (async)#

async omni.replicator.core.orchestrator.preview_async() None#

Run the replicator scenario for a single iteration

Submit the Preview command to replicator and wait for a frame to be previewed. Writers are disabled during preview.

async omni.replicator.core.orchestrator.run_async(
num_frames: int = None,
start_timeline: bool = False,
) None#

Run the replicator scenario and wait for orchestrator to start

Submit the Start command to replicator and wait for its status to change to Started.

Parameters:
  • num_frames – Optionally specify the maximum number of frames to capture. Note that num_frames does not override the number of frames specified in triggers defined in the scene.

  • start_timeline – Optionally start the timeline when Replicator starts.

async omni.replicator.core.orchestrator.run_until_complete_async(
num_frames: int = None,
start_timeline: bool = False,
) None#

Run the replicator scenario until stopped Generation ends when all triggers have reached their end condition or when a stop event is published.

Parameters:
  • num_frames – Optionally specify the maximum number of frames to capture. Note that num_frames does not override the number of frames specified in triggers defined in the scene.

  • start_timeline – Optionally start the timeline when Replicator starts.

async omni.replicator.core.orchestrator.step_async(
rt_subframes: int = -1,
pause_timeline: bool = True,
delta_time: float = None,
wait_for_render: bool = True,
) None#

Step one frame

If Replicator is not yet started, an initialization step is first taken to ensure the necessary settings are set for data capture. The renderer will then render as many subframes as required by current settings and schedule a frame to be captured by any active annotators and writers.

Parameters:
  • rt_subframes – Specify the number of subframes to render. During subframe generation, the simulation is paused. This is often beneficial when large scene changes occur to reduce rendering artifacts or to allow materials to fully load. This setting is enabled for both RTX Real-Time and Path Tracing render modes. Values must be greater than 0.

  • pause_timeline – If True, pause timeline after step. Defaults to True.

  • delta_time – The amount of time that timeline advances for each step call. When delta_time == None, default timeline rate will be used. When delta_time == 0.0, timeline will not advance. When delta_time > 0.0, timeline will advance by the custom delta_time.

  • wait_for_render – If True, wait for a render to complete. Set to True whenever it is necessary for the annotation/writer data match the current simulation state. Defaults to True.

async omni.replicator.core.orchestrator.wait_until_complete_async() None#

Wait until generation is complete

Blocks execution until synthetic data generation has completed.

Orchestrator info#

omni.replicator.core.orchestrator.get_is_paused() bool#

Return True if Replicator is Paused.

omni.replicator.core.orchestrator.get_is_started() bool#

Return True if Replicator is Started.

omni.replicator.core.orchestrator.get_is_stopped() bool#

Return True if Replicator is Stopped.

omni.replicator.core.orchestrator.get_sim_times_to_write() List#

Get list of simulation times scheduled to be written

omni.replicator.core.orchestrator.get_status() Status#

Return Replicator status

Other#

omni.replicator.core.orchestrator.register_status_callback(
callback: Callable,
) StatusCallback#

Register a callback on orchestrator status changed.

Register a callback and return a StatusCallback object that automatically unregisters callback when destroyed.

Parameters:

callback – Callback function that will be called whenever orchestrator status changes

Returns:

StatusCallback object which will automatically unregister callback when destroyed

Example

>>> import omni.replicator.core as rep
>>> def my_callback(status):
...     print(f"Orchestrator Status: {status}")
>>> # register callback
>>> my_callback = rep.orchestrator.register_status_callback(my_callback)
>>> my_callback2 = rep.orchestrator.register_status_callback(my_callback)
>>> # unregister callback manually
>>> my_callback.unregister()
>>> # unregister callback automatically
>>> del(my_callback)
omni.replicator.core.orchestrator.set_capture_on_play(value: bool) None#

Set Replicator to capture on timeline playing.

When capture on play is enabled, timeline operations (ie. Play, Stop, Pause) will trigger the corresponding Replicator commands.

Parameters:

value (bool) – If True, Replicator will engage when timeline is playing to capture frames.

omni.replicator.core.orchestrator.set_minimum_next_rt_subframes(rt_subframes: int) None#

Specify the minimum number of subframes to render

Specify the minimum number of subframes to render. During subframe generation, the simulation is paused. This is often beneficial when large scene changes occur to reduce rendering artifacts or to allow materials to fully load. This setting is enabled for both RTX Real-Time and Path Tracing render modes. Values must be greater than 0.

Parameters:

rt_subframes – Minimum number of subframes to render for the next frame. Resets on every frame.

omni.replicator.core.orchestrator.set_next_rt_subframes(rt_subframes: int) None#

Specify the number of subframes to render

Specify the number of subframes to render. During subframe generation, the simulation is paused. This is often beneficial when large scene changes occur to reduce rendering artifacts or to allow materials to fully load. This setting is enabled for both RTX Real-Time and Path Tracing render modes. Values must be greater than 0.

Parameters:

rt_subframes – Number of subframes to render for the next frame. Resets on every frame.

exception omni.replicator.core.orchestrator.OrchestratorError(msg=None)#

Base exception for errors raised by the orchestrator

Functional#

Create#

omni.replicator.core.functional.create.scope(
name: str = None,
parent: str | Path | Prim = None,
) Prim#

Create a Scope

Parameters:
  • name – Name of the object.

  • parent – Optional parent prim path. The scope will be created as a child of this prim.

Example

>>> import omni.replicator.core as rep
>>> scope = rep.functional.create.scope()
omni.replicator.core.functional.create.clone(
path: str | Path | usdrt.Sdf.Path,
position: float | Tuple[float] = None,
scale: float | Tuple[float] = None,
rotation: float | Tuple[float] = None,
look_at: str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: Tuple[float] = None,
pivot: Tuple[float, float, float] | List[Tuple[float, float, float]] | Vec3d = None,
relative_to: str | Path | Prim = None,
name: str = None,
parent: str | Path | Prim = None,
) List[Prim]#

Create a Clone

Parameters:
  • path – Path to the prim to clone.

  • position – XYZ coordinates in world space. If a single value is provided, all axes will be set to that value.

  • scale – Scaling factors for XYZ axes. If a single value is provided, all axes will be set to that value.

  • rotation – Euler angles in degrees in XYZ order. If a single value is provided, all axes will be set to that value.

  • look_at – Look-at target, specified either as a ReplicatorItem, a prim path, or world coordinates. If multiple prims are set, the target point will be the mean of their positions.

  • look_at_up_axis – Look-at up axis of the created prim.

  • pivot – Pivot point of the created prim normalized in the range [-1, 1] for each axis.

  • relative_to – If provided, position will be relative to this prim instead of world space.

  • name – Name of the object.

  • parent – Optional parent prim path. The clone will be created as a child of this prim.

Example

>>> import omni.replicator.core as rep
>>> original = rep.functional.create.sphere()
>>> clone = rep.functional.create.clone(
...     path="/Sphere",
... )
omni.replicator.core.functional.create.xform(
position: float | Tuple[float] = None,
scale: float | Tuple[float] = None,
rotation: float | Tuple[float] = None,
look_at: str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: Tuple[float] = None,
pivot: Tuple[float, float, float] | List[Tuple[float, float, float]] | Vec3d = None,
relative_to: str | Path | Prim = None,
semantics: Dict[str, List | str] | List[Tuple[str, str]] = None,
visible: bool = True,
name: str = None,
parent: str | Path | Prim = None,
) List[Prim]#

Create a Xform

Parameters:
  • position – XYZ coordinates in world space. If a single value is provided, all axes will be set to that value.

  • scale – Scaling factors for XYZ axes. If a single value is provided, all axes will be set to that value.

  • rotation – Euler angles in degrees in XYZ order. If a single value is provided, all axes will be set to that value.

  • look_at – Look-at target, specified either as a ReplicatorItem, a prim path, or world coordinates. If multiple prims are set, the target point will be the mean of their positions.

  • look_at_up_axis – Look-at up axis of the created prim.

  • pivot – Pivot point of the created prim normalized in the range [-1, 1] for each axis.

  • relative_to – If provided, position will be relative to this prim instead of world space.

  • semantics – Dictionary specifying semantic type and values. Legacy lists of tuples are also accepted but will be converted to dictionaries.

  • visible – If False, the prim will be invisible. This is often useful when creating prims to use as bounds with other randomizers.

  • name – Name of the object.

  • parent – Optional parent prim path. The xform will be created as a child of this prim.

Example

>>> import omni.replicator.core as rep
>>> rng = rep.rng.ReplicatorRNG()
>>> xform = rep.functional.create.xform(
...     position=rng.generator.uniform((0,0,0), (100, 100, 100)),
...     semantics={"class": "thing"},
... )
omni.replicator.core.functional.create.camera(
position: float | Tuple[float] = None,
scale: float | Tuple[float] = None,
rotation: float | Tuple[float] = None,
look_at: str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: Tuple[float] = None,
relative_to: str | Path | Prim = None,
focal_length: float = 24.0,
focus_distance: float = 400.0,
f_stop: float = 0.0,
horizontal_aperture: float = 20.955,
horizontal_aperture_offset: float = 0.0,
vertical_aperture_offset: float = 0.0,
clipping_range: Tuple[float, float] = (1.0, 1000000.0),
projection_type: str = 'pinhole',
fisheye_nominal_width: float = 1936.0,
fisheye_nominal_height: float = 1216.0,
fisheye_optical_centre_x: float = 970.94244,
fisheye_optical_centre_y: float = 600.37482,
fisheye_max_fov: float = 200.0,
fisheye_polynomial_a: float = 0.0,
fisheye_polynomial_b: float = 0.00245,
fisheye_polynomial_c: float = 0.0,
fisheye_polynomial_d: float = 0.0,
fisheye_polynomial_e: float = 0.0,
fisheye_polynomial_f: float = 0.0,
fisheye_p0: float = -0.00037,
fisheye_p1: float = -0.00074,
fisheye_s0: float = -0.00058,
fisheye_s1: float = -0.00022,
fisheye_s2: float = 0.00019,
fisheye_s3: float = -0.0002,
cross_camera_reference_name: str = None,
name: str = None,
parent: str | Path | Prim = None,
) Prim#

Create a Camera

Parameters:
  • position – XYZ coordinates in world space. If a single value is provided, all axes will be set to that value.

  • scale – Scaling factors for XYZ axes. If a single value is provided, all axes will be set to that value.

  • rotation – Euler angles in degrees in XYZ order. If a single value is provided, all axes will be set to that value.

  • look_at – Look-at target, specified either as a ReplicatorItem, a prim path, or world coordinates. If multiple prims are set, the target point will be the mean of their positions.

  • look_at_up_axis – Look-at up axis of the created prim.

  • relative_to – If provided, position will be relative to this prim instead of world space.

  • focal_length – Focal length of the camera.

  • focus_distance – Distance to the focus plane.

  • f_stop – F-stop of the camera.

  • horizontal_aperture – Horizontal aperture of the camera.

  • horizontal_aperture_offset – Horizontal aperture offset of the camera.

  • vertical_aperture_offset – Vertical aperture offset of the camera.

  • clipping_range – Clipping range of the camera.

  • projection_type – Projection type of the camera.

  • fisheye_nominal_width – Nominal width of the fisheye camera.

  • fisheye_nominal_height – Nominal height of the fisheye camera.

  • fisheye_optical_centre_x – Optical centre x of the fisheye camera.

  • fisheye_optical_centre_y – Optical centre y of the fisheye camera.

  • fisheye_max_fov – Maximum field of view of the fisheye camera.

  • fisheye_polynomial_a – Polynomial coefficient a of the fisheye camera.

  • fisheye_polynomial_b – Polynomial coefficient b of the fisheye camera.

  • fisheye_polynomial_c – Polynomial coefficient c of the fisheye camera.

  • fisheye_polynomial_d – Polynomial coefficient d of the fisheye camera.

  • fisheye_polynomial_e – Polynomial coefficient e of the fisheye camera.

  • fisheye_polynomial_f – Polynomial coefficient f of the fisheye camera.

  • fisheye_p0 – Polynomial coefficient p0 of the fisheye camera.

  • fisheye_p1 – Polynomial coefficient p1 of the fisheye camera.

  • fisheye_s0 – Polynomial coefficient s0 of the fisheye camera.

  • fisheye_s1 – Polynomial coefficient s1 of the fisheye camera.

  • fisheye_s2 – Polynomial coefficient s2 of the fisheye camera.

  • fisheye_s3 – Polynomial coefficient s3 of the fisheye camera.

  • cross_camera_reference_name – Name of the cross camera reference.

  • name – Name of the object.

  • parent – Optional parent prim path. The camera will be created as a child of this prim.

Example

>>> import omni.replicator.core as rep
>>> rng = rep.rng.ReplicatorRNG()
>>> camera = rep.functional.create.camera(
...     position=rng.generator.uniform((0,0,0), (100, 100, 100)),
... )
omni.replicator.core.functional.create.reference(
usd_path: str | List[str] = None,
prim_path: str | List[str] = None,
position: float | Tuple[float] = None,
scale: float | Tuple[float] = None,
rotation: float | Tuple[float] = None,
look_at: str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: Tuple[float] = None,
pivot: Tuple[float, float, float] | List[Tuple[float, float, float]] | Vec3d = None,
relative_to: str | Path | Prim = None,
semantics: Dict[str, List | str] | List[Tuple[str, str]] = None,
visible: bool = True,
name: str = None,
parent: str | Path | Prim = None,
) Prim#

Create a Reference

Parameters:
  • usd_path – USD path of the prim to reference.

  • prim_path – Prim path of the prim to reference.

  • position – XYZ coordinates in world space. If a single value is provided, all axes will be set to that value.

  • scale – Scaling factors for XYZ axes. If a single value is provided, all axes will be set to that value.

  • rotation – Euler angles in degrees in XYZ order. If a single value is provided, all axes will be set to that value.

  • look_at – Look-at target, specified either as a ReplicatorItem, a prim path, or world coordinates. If multiple prims are set, the target point will be the mean of their positions.

  • look_at_up_axis – Look-at up axis of the created prim.

  • pivot – Pivot point of the created prim normalized in the range [-1, 1] for each axis.

  • relative_to – If provided, position will be relative to this prim instead of world space.

  • semantics – Dictionary specifying semantic type and values. Legacy lists of tuples are also accepted but will be converted to dictionaries.

  • visible – If False, the prim will be invisible. This is often useful when creating prims to use as bounds with other randomizers.

  • name – Name of the object.

  • parent – Optional parent prim path. The reference will be created as a child of this prim.

Example

>>> import omni.replicator.core as rep
>>> rng = rep.rng.ReplicatorRNG()
>>> reference_internal = rep.functional.create.reference(
...     prim_path="/World/Looks/Red",
...     position=rng.generator.uniform((0,0,0), (100, 100, 100)),
...     semantics={"class": "internal_reference"},
... )
>>> reference_external = rep.functional.create.reference(
...     usd_path="/path/to/external/file.usd",
...     position=rng.generator.uniform((0,0,0), (100, 100, 100)),
...     semantics={"class": "external_reference"},
... )
omni.replicator.core.functional.create.plane(
position: float | Tuple[float] = None,
scale: float | Tuple[float] = None,
rotation: float | Tuple[float] = None,
look_at: str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: Tuple[float] = None,
pivot: Tuple[float, float, float] | List[Tuple[float, float, float]] | Vec3d = None,
relative_to: str | Path | Prim = None,
semantics: Dict[str, List | str] | List[Tuple[str, str]] = None,
visible: bool = True,
name: str = None,
parent: str | Path | Prim = None,
) Prim#

Create a Plane

Parameters:
  • position – XYZ coordinates in world space. If a single value is provided, all axes will be set to that value.

  • scale – Scaling factors for XYZ axes. If a single value is provided, all axes will be set to that value.

  • rotation – Euler angles in degrees in XYZ order. If a single value is provided, all axes will be set to that value.

  • look_at – Look-at target, specified either as a ReplicatorItem, a prim path, or world coordinates. If multiple prims are set, the target point will be the mean of their positions.

  • look_at_up_axis – Look-at up axis of the created prim.

  • pivot – Pivot point of the created prim normalized in the range [-1, 1] for each axis.

  • relative_to – If provided, position will be relative to this prim instead of world space.

  • semantics – Dictionary specifying semantic type and values. Legacy lists of tuples are also accepted but will be converted to dictionaries.

  • visible – If False, the prim will be invisible. This is often useful when creating prims to use as bounds with other randomizers.

  • name – Name of the object.

  • parent – Optional parent prim path. The plane will be created as a child of this prim.

Example

>>> import omni.replicator.core as rep
>>> rng = rep.rng.ReplicatorRNG()
>>> plane = rep.functional.create.plane(
...     position=rng.generator.uniform((0,0,0), (100, 100, 100)),
...     semantics={"class": "plane"},
... )
omni.replicator.core.functional.create.sphere(
position: float | Tuple[float] = None,
scale: float | Tuple[float] = None,
rotation: float | Tuple[float] = None,
look_at: str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: Tuple[float] = None,
pivot: Tuple[float, float, float] | List[Tuple[float, float, float]] | Vec3d = None,
relative_to: str | Path | Prim = None,
semantics: Dict[str, List | str] | List[Tuple[str, str]] = None,
visible: bool = True,
as_mesh: bool = True,
name: str = None,
parent: str | Path | Prim = None,
) Prim#

Create a Sphere

Parameters:
  • position – XYZ coordinates in world space. If a single value is provided, all axes will be set to that value.

  • scale – Scaling factors for XYZ axes. If a single value is provided, all axes will be set to that value.

  • rotation – Euler angles in degrees in XYZ order. If a single value is provided, all axes will be set to that value.

  • look_at – Look-at target, specified either as a ReplicatorItem, a prim path, or world coordinates. If multiple prims are set, the target point will be the mean of their positions.

  • look_at_up_axis – Look-at up axis of the created prim.

  • pivot – Pivot point of the created prim normalized in the range [-1, 1] for each axis.

  • relative_to – If provided, position will be relative to this prim instead of world space.

  • semantics – Dictionary specifying semantic type and values. Legacy lists of tuples are also accepted but will be converted to dictionaries.

  • visible – If False, the prim will be invisible. This is often useful when creating prims to use as bounds with other randomizers.

  • as_mesh – If True, creates a mesh sphere. If False, creates a native USD sphere

  • name – Name of the object.

  • parent – Optional parent prim path. The sphere will be created as a child of this prim.

Example

>>> import omni.replicator.core as rep
>>> rng = rep.rng.ReplicatorRNG()
>>> sphere = rep.functional.create.sphere(
...     position=rng.generator.uniform((0,0,0), (100, 100, 100)),
...     semantics={"class": "sphere"},
... )
omni.replicator.core.functional.create.cube(
position: float | Tuple[float] = None,
scale: float | Tuple[float] = None,
rotation: float | Tuple[float] = None,
look_at: str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: Tuple[float] = None,
pivot: Tuple[float, float, float] | List[Tuple[float, float, float]] | Vec3d = None,
relative_to: str | Path | Prim = None,
semantics: Dict[str, List | str] | List[Tuple[str, str]] = None,
visible: bool = True,
as_mesh: bool = True,
name: str = None,
parent: str | Path | Prim = None,
) Prim#

Create a Cube

Parameters:
  • position – XYZ coordinates in world space. If a single value is provided, all axes will be set to that value.

  • scale – Scaling factors for XYZ axes. If a single value is provided, all axes will be set to that value.

  • rotation – Euler angles in degrees in XYZ order. If a single value is provided, all axes will be set to that value.

  • look_at – Look-at target, specified either as a ReplicatorItem, a prim path, or world coordinates. If multiple prims are set, the target point will be the mean of their positions.

  • look_at_up_axis – Look-at up axis of the created prim.

  • pivot – Pivot point of the created prim normalized in the range [-1, 1] for each axis.

  • relative_to – If provided, position will be relative to this prim instead of world space.

  • semantics – Dictionary specifying semantic type and values. Legacy lists of tuples are also accepted but will be converted to dictionaries.

  • visible – If False, the prim will be invisible. This is often useful when creating prims to use as bounds with other randomizers.

  • as_mesh – If True, creates a mesh cube. If False, creates a native USD cube

  • name – Name of the object.

  • parent – Optional parent prim path. The cube will be created as a child of this prim.

Example

>>> import omni.replicator.core as rep
>>> rng = rep.rng.ReplicatorRNG()
>>> cube = rep.functional.create.cube(
...     position=rng.generator.uniform((0,0,0), (100, 100, 100)),
...     semantics={"class": "cube"},
... )
omni.replicator.core.functional.create.disk(
position: float | Tuple[float] = None,
scale: float | Tuple[float] = None,
rotation: float | Tuple[float] = None,
look_at: str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: Tuple[float] = None,
pivot: Tuple[float, float, float] | List[Tuple[float, float, float]] | Vec3d = None,
relative_to: str | Path | Prim = None,
semantics: Dict[str, List | str] | List[Tuple[str, str]] = None,
visible: bool = True,
name: str = None,
parent: str | Path | Prim = None,
) Prim#

Create a Disk

Parameters:
  • position – XYZ coordinates in world space. If a single value is provided, all axes will be set to that value.

  • scale – Scaling factors for XYZ axes. If a single value is provided, all axes will be set to that value.

  • rotation – Euler angles in degrees in XYZ order. If a single value is provided, all axes will be set to that value.

  • look_at – Look-at target, specified either as a ReplicatorItem, a prim path, or world coordinates. If multiple prims are set, the target point will be the mean of their positions.

  • look_at_up_axis – Look-at up axis of the created prim.

  • pivot – Pivot point of the created prim normalized in the range [-1, 1] for each axis.

  • relative_to – If provided, position will be relative to this prim instead of world space.

  • semantics – Dictionary specifying semantic type and values. Legacy lists of tuples are also accepted but will be converted to dictionaries.

  • visible – If False, the prim will be invisible. This is often useful when creating prims to use as bounds with other randomizers.

  • name – Name of the object.

  • parent – Optional parent prim path. The disk will be created as a child of this prim.

Example

>>> import omni.replicator.core as rep
>>> rng = rep.rng.ReplicatorRNG()
>>> disk = rep.functional.create.disk(
...     position=rng.generator.uniform((0,0,0), (100, 100, 100)),
...     semantics={"class": "disk"},
... )
omni.replicator.core.functional.create.torus(
position: float | Tuple[float] = None,
scale: float | Tuple[float] = None,
rotation: float | Tuple[float] = None,
look_at: str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: Tuple[float] = None,
pivot: Tuple[float, float, float] | List[Tuple[float, float, float]] | Vec3d = None,
relative_to: str | Path | Prim = None,
semantics: Dict[str, List | str] | List[Tuple[str, str]] = None,
visible: bool = True,
name: str = None,
parent: str | Path | Prim = None,
) Prim#

Create a Torus

Parameters:
  • position – XYZ coordinates in world space. If a single value is provided, all axes will be set to that value.

  • scale – Scaling factors for XYZ axes. If a single value is provided, all axes will be set to that value.

  • rotation – Euler angles in degrees in XYZ order. If a single value is provided, all axes will be set to that value.

  • look_at – Look-at target, specified either as a ReplicatorItem, a prim path, or world coordinates. If multiple prims are set, the target point will be the mean of their positions.

  • look_at_up_axis – Look-at up axis of the created prim.

  • pivot – Pivot point of the created prim normalized in the range [-1, 1] for each axis.

  • relative_to – If provided, position will be relative to this prim instead of world space.

  • semantics – Dictionary specifying semantic type and values. Legacy lists of tuples are also accepted but will be converted to dictionaries.

  • visible – If False, the prim will be invisible. This is often useful when creating prims to use as bounds with other randomizers.

  • name – Name of the object.

  • parent – Optional parent prim path. The torus will be created as a child of this prim.

Example

>>> import omni.replicator.core as rep
>>> rng = rep.rng.ReplicatorRNG()
>>> torus = rep.functional.create.torus(
...     position=rng.generator.uniform((0,0,0), (100, 100, 100)),
...     semantics={"class": "torus"},
... )
omni.replicator.core.functional.create.cylinder(
position: float | Tuple[float] = None,
scale: float | Tuple[float] = None,
rotation: float | Tuple[float] = None,
look_at: str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: Tuple[float] = None,
pivot: Tuple[float, float, float] | List[Tuple[float, float, float]] | Vec3d = None,
relative_to: str | Path | Prim = None,
semantics: Dict[str, List | str] | List[Tuple[str, str]] = None,
as_mesh: bool = True,
visible: bool = True,
name: str = None,
parent: str | Path | Prim = None,
) Prim#

Create a Cylinder

Parameters:
  • position – XYZ coordinates in world space. If a single value is provided, all axes will be set to that value.

  • scale – Scaling factors for XYZ axes. If a single value is provided, all axes will be set to that value.

  • rotation – Euler angles in degrees in XYZ order. If a single value is provided, all axes will be set to that value.

  • look_at – Look-at target, specified either as a ReplicatorItem, a prim path, or world coordinates. If multiple prims are set, the target point will be the mean of their positions.

  • look_at_up_axis – Look-at up axis of the created prim.

  • pivot – Pivot point of the created prim normalized in the range [-1, 1] for each axis.

  • relative_to – If provided, position will be relative to this prim instead of world space.

  • semantics – Dictionary specifying semantic type and values. Legacy lists of tuples are also accepted but will be converted to dictionaries.

  • as_mesh – If True, creates a mesh cylinder. If False, creates a native USD cylinder.

  • visible – If False, the prim will be invisible. This is often useful when creating prims to use as bounds with other randomizers.

  • name – Name of the object.

  • parent – Optional parent prim path. The cylinder will be created as a child of this prim.

Example

>>> import omni.replicator.core as rep
>>> rng = rep.rng.ReplicatorRNG()
>>> cylinder = rep.functional.create.cylinder(
...     position=rng.generator.uniform((0,0,0), (100, 100, 100)),
...     semantics={"class": "cylinder"},
... )
omni.replicator.core.functional.create.cone(
position: float | Tuple[float] = None,
scale: float | Tuple[float] = None,
rotation: float | Tuple[float] = None,
look_at: str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: Tuple[float] = None,
pivot: Tuple[float, float, float] | List[Tuple[float, float, float]] | Vec3d = None,
relative_to: str | Path | Prim = None,
semantics: Dict[str, List | str] | List[Tuple[str, str]] = None,
visible: bool = True,
as_mesh: bool = True,
name: str = None,
parent: str | Path | Prim = None,
) Prim#

Create a Cone

Parameters:
  • position – XYZ coordinates in world space. If a single value is provided, all axes will be set to that value.

  • scale – Scaling factors for XYZ axes. If a single value is provided, all axes will be set to that value.

  • rotation – Euler angles in degrees in XYZ order. If a single value is provided, all axes will be set to that value.

  • look_at – Look-at target, specified either as a ReplicatorItem, a prim path, or world coordinates. If multiple prims are set, the target point will be the mean of their positions.

  • look_at_up_axis – Look-at up axis of the created prim.

  • pivot – Pivot point of the created prim normalized in the range [-1, 1] for each axis.

  • relative_to – If provided, position will be relative to this prim instead of world space.

  • semantics – Dictionary specifying semantic type and values. Legacy lists of tuples are also accepted but will be converted to dictionaries.

  • visible – If False, the prim will be invisible. This is often useful when creating prims to use as bounds with other randomizers.

  • as_mesh – If True, creates a mesh cone. If False, creates a native USD cone.

  • name – Name of the object.

  • parent – Optional parent prim path. The cone will be created as a child of this prim.

Example

>>> import omni.replicator.core as rep
>>> rng = rep.rng.ReplicatorRNG()
>>> cone = rep.functional.create.cone(
...     position=rng.generator.uniform((0,0,0), (100, 100, 100)),
...     semantics={"class": "cone"},
... )
omni.replicator.core.functional.create.sphere_light(
position: float | Tuple[float] = None,
scale: float | Tuple[float] = None,
rotation: float | Tuple[float] = None,
look_at: str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: Tuple[float] = None,
pivot: Tuple[float, float, float] | List[Tuple[float, float, float]] | Vec3d = None,
relative_to: str | Path | Prim = None,
semantics: Dict[str, List | str] | List[Tuple[str, str]] = None,
visible: bool = True,
color: Tuple[float, float, float] = (1.0, 1.0, 1.0),
intensity: float = 30000.0,
exposure: float = None,
color_temperature: float = 6500,
enable_color_temperature: bool = False,
diffuse: float = 1.0,
specular: float = 1.0,
shaping_cone_angle: float = 180.0,
shaping_focus_tint: float = (1.0, 1.0, 1.0),
radius: float = 1.0,
name: str = None,
parent: str | Path | Prim = None,
) Prim#

Create a sphere light

Parameters:
  • position – XYZ coordinates in world space. If a single value is provided, all axes will be set to that value.

  • scale – Scaling factors for XYZ axes. If a single value is provided, all axes will be set to that value.

  • rotation – Euler angles in degrees in XYZ order. If a single value is provided, all axes will be set to that value.

  • look_at – Look-at target, specified either as a ReplicatorItem, a prim path, or world coordinates. If multiple prims are set, the target point will be the mean of their positions.

  • look_at_up_axis – Look-at up axis of the created prim.

  • pivot – Pivot point of the created prim normalized in the range [-1, 1] for each axis.

  • relative_to – If provided, position will be relative to this prim instead of world space.

  • semantics – Dictionary specifying semantic type and values. Legacy lists of tuples are also accepted but will be converted to dictionaries.

  • visible – If False, the prim will be invisible. This is often useful when creating prims to use as bounds with other randomizers.

  • color – Color of the light.

  • intensity – Intensity of the light.

  • exposure – Exposure of the light.

  • color_temperature – Color temperature of the light.

  • enable_color_temperature – If True, the light will use a color temperature.

  • diffuse – Diffuse of the light.

  • specular – Specular of the light.

  • shaping_cone_angle – Shaping cone angle of the light.

  • shaping_focus_tint – Shaping focus tint of the light.

  • radius – Radius of the light.

  • name – Name of the object.

  • parent – Optional parent prim path. The xform will be created as a child of this prim.

Example

>>> import omni.replicator.core as rep
>>> rng = rep.rng.ReplicatorRNG()
>>> sphere_light = rep.functional.create.sphere_light(
...     position=rng.generator.uniform((0,0,0), (100, 100, 100)),
... )
omni.replicator.core.functional.create.dome_light(
color: Tuple[float] = (1.0, 1.0, 1.0),
texture: str = None,
texture_format: str = 'latlong',
intensity: float = 1000.0,
diffuse: float = 1.0,
specular: float = 1.0,
color_temperature: float = 6500,
enable_color_temperature: bool = False,
shaping_cone_angle: float = 180.0,
position: float | Tuple[float] = None,
scale: float | Tuple[float] = None,
rotation: float | Tuple[float] = None,
look_at: str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: Tuple[float] = None,
name: str = None,
parent: str | Path | Prim = None,
) Prim#

Create a Dome Light

Parameters:
  • color – Color of the light.

  • texture – Path to the texture file for the dome light.

  • texture_format – Format of the texture. Default is “latlong”.

  • intensity – Intensity of the light.

  • diffuse – Diffuse component of the light.

  • specular – Specular component of the light.

  • color_temperature – Color temperature of the light.

  • enable_color_temperature – If True, the light will use a color temperature.

  • shaping_cone_angle – Shaping cone angle of the light.

  • position – XYZ coordinates in world space. If a single value is provided, all axes will be set to that value.

  • scale – Scaling factors for XYZ axes. If a single value is provided, all axes will be set to that value.

  • rotation – Euler angles in degrees in XYZ order. If a single value is provided, all axes will be set to that value.

  • look_at – Look-at target, specified either as a ReplicatorItem, a prim path, or world coordinates. If multiple prims are set, the target point will be the mean of their positions.

  • look_at_up_axis – Look-at up axis of the created prim.

  • name – Name of the object.

  • parent – Optional parent prim path. The dome light will be created as a child of this prim.

Example

>>> import omni.replicator.core as rep
>>> rng = rep.rng.ReplicatorRNG()
>>> dome_light = rep.functional.create.dome_light(
...     intensity=rng.generator.uniform(1000.0, 2000.0),
...     color=(0.8, 0.8, 1.0),
... )
omni.replicator.core.functional.create.material(
mdl: str,
bind_prims: Prim | None = None,
name: str = None,
parent: str | Path | Prim = None,
**kwargs,
)#

Create a material

Parameters:
  • mdl – Path to the material definition.

  • bind_prims – List of prims to bind the material to.

  • name – Name of the material.

  • parent – Optional parent prim path. The material will be created as a child of this prim.

Example

>>> import omni.replicator.core as rep
>>> rng = rep.rng.ReplicatorRNG()
>>> material = rep.functional.create.material(
...     mdl="OmniPBR.mdl",
...     diffuse_color_constant=rng.generator.uniform((0.1, 0.1, 1.0), (0.8, 0.8, 1.0)),
... )
omni.replicator.core.functional.create.omni_lidar(
position: float | Tuple[float] = None,
rotation: float | Tuple[float] = None,
name: str | None = None,
parent: str | Path | Prim = None,
**kwargs,
) List[Prim | usdrt.Usd.Prim]#

Create a LiDAR sensor.

Parameters:
  • position – XYZ coordinates in world space. If a single value is provided, all axes will be set to that value.

  • rotation – Euler angles in degrees in XYZ order. If a single value is provided, all axes will be set to that value.

  • name – Name for the LiDAR sensor

  • parent – Parent prim path to create LiDAR under

  • **kwargs – Additional attributes to be added to the LiDAR sensor

Example

>>> import omni.replicator.core as rep
>>> # Create LiDAR sensor
>>> lidar = rep.functional.create.omni_lidar(
...     position=(100, 100, 100),
...     rotation=(45, 45, 0),
... )
omni.replicator.core.functional.create.omni_radar(
position: float | Tuple[float] = None,
rotation: float | Tuple[float] = None,
name: str | None = None,
parent: str | Path | Prim = None,
**kwargs,
) List[Prim | usdrt.Usd.Prim]#

Create a Radar sensor.

Parameters:
  • position – XYZ coordinates in world space. If a single value is provided, all axes will be set to that value.

  • rotation – Euler angles in degrees in XYZ order. If a single value is provided, all axes will be set to that value.

  • name – Name for the Radar sensor

  • parent – Parent prim path to create Radar under

  • **kwargs – Additional attributes to be added to the Radar sensor

Example

>>> import omni.replicator.core as rep
>>> # Create Radar sensor
>>> radar = rep.functional.create.omni_radar(
...     position=(100, 100, 100),
...     rotation=(45, 45, 0),
... )

Create Batch#

omni.replicator.core.functional.create_batch.scope(
count: int = 1,
name: str | None = None,
parent: str | Path | Prim = None,
) List[Prim]#

Creates a scope prim for organizing scene hierarchy.

Parameters:
  • count – Number of scopes to create

  • name – Name for the scope prim

  • parent – Parent prim path to create scope under

Returns:

List of created scope prims

Return type:

List[pxr.Usd.Prim]

Example

>>> import omni.replicator.core.functional as F
>>> scope = F.create_batch.scope(name="MyScope", parent="/World")
omni.replicator.core.functional.create_batch.clone(
path: str | Path | usdrt.Sdf.Path,
position: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
scale: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
rotation: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
look_at: str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: Tuple[float] = None,
pivot: Tuple[float, float, float] | List[Tuple[float, float, float]] | Vec3d = None,
relative_to: str | Path | Prim = None,
semantics: Dict[str, List | str] | List[Tuple[str, str]] = None,
visible: bool = True,
count: int = 1,
name: str | None = None,
parent: str | Path | Prim = None,
) List[Prim]#

Creates a clone of a source prim.

Parameters:
  • source – Source prim to clone

  • position – XYZ coordinates in world space. Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • scale – Scaling factors for XYZ axes. Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • rotation – Euler angles in degrees (XYZ order). Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • look_at – Target to point transform at (prim path, coordinates, or list of targets)

  • look_at_up_axis – Up axis vector for look_at orientation

  • pivot – Pivot point specified as a tuple of (x, y, z) normalized to the range [-1, 1] where 0 is the center of the prim

  • relative_to – Reference prim for relative positioning. If provided, position will be relative to this prim

  • semantics – Dictionary specifying semantic type and values. Legacy lists of tuples are also accepted but will be converted to dictionaries.

  • visible – Whether transform should be visible

  • count – Number of transforms to create

  • name – Name for the transform prim

  • parent – Parent prim path to create transform under

Returns:

List of created transform prims

Return type:

List[pxr.Usd.Prim]

Example

>>> import omni.replicator.core.functional as F
>>> clone = F.create_batch.clone(source="/World/Sphere", position=(1, 2, 3))
omni.replicator.core.functional.create_batch.xform(
position: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
scale: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
rotation: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
look_at: str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: Tuple[float] = None,
pivot: Tuple[float, float, float] | List[Tuple[float, float, float]] | Vec3d = None,
relative_to: str | Path | Prim = None,
semantics: Dict[str, List | str] | List[Tuple[str, str]] = None,
visible: bool = True,
count: int = 1,
name: str | None = None,
parent: str | Path | Prim = None,
material: Prim | usdrt.Usd.Prim | List[Prim | usdrt.Usd.Prim] = None,
) List[Prim]#

Creates a transform prim that can be used to group and transform other prims.

Parameters:
  • position – XYZ coordinates in world space. Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • scale – Scale factors for XYZ axes. Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • rotation – Euler angles in degrees (XYZ order). Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • look_at – Target to point transform at (prim path, coordinates, or list of targets)

  • look_at_up_axis – Up axis vector for look_at orientation

  • pivot – Pivot point specified as a tuple of (x, y, z) normalized to the range [-1, 1] where 0 is the center of the prim

  • relative_to – Reference prim for relative positioning. If provided, position will be relative to this prim

  • semantics – Dictionary specifying semantic type and values. Legacy lists of tuples are also accepted but will be converted to dictionaries.

  • visible – Whether transform should be visible

  • count – Number of transforms to create

  • name – Name for the transform prim

  • parent – Parent prim path to create transform under

Returns:

List of created transform prims

Return type:

List[pxr.Usd.Prim]

Example

>>> import omni.replicator.core.functional as F
>>> xform = F.create_batch.xform(
...     position=(1, 2, 3),
...     rotation=(0, 90, 0),
...     scale=2.0
... )
omni.replicator.core.functional.create_batch.camera(
position: float | Tuple[float] = None,
scale: float | Tuple[float] = None,
rotation: float | Tuple[float] = None,
look_at: str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: Tuple[float] = None,
relative_to: str | Path | Prim = None,
focal_length: float = 24.0,
focus_distance: float = 400.0,
f_stop: float = 0.0,
horizontal_aperture: float = 20.955,
horizontal_aperture_offset: float = 0.0,
vertical_aperture_offset: float = 0.0,
clipping_range: Tuple[float, float] = (1.0, 1000000.0),
projection_type: str = 'pinhole',
fisheye_nominal_width: float = 1936.0,
fisheye_nominal_height: float = 1216.0,
fisheye_optical_centre_x: float = 970.94244,
fisheye_optical_centre_y: float = 600.37482,
fisheye_max_fov: float = 200.0,
fisheye_polynomial_a: float = 0.0,
fisheye_polynomial_b: float = 0.00245,
fisheye_polynomial_c: float = 0.0,
fisheye_polynomial_d: float = 0.0,
fisheye_polynomial_e: float = 0.0,
fisheye_polynomial_f: float = 0.0,
fisheye_p0: float = -0.00037,
fisheye_p1: float = -0.00074,
fisheye_s0: float = -0.00058,
fisheye_s1: float = -0.00022,
fisheye_s2: float = 0.00019,
fisheye_s3: float = -0.0002,
cross_camera_reference_name: str | None = None,
count: int = 1,
name: str | None = None,
parent: str | Path | Prim = None,
) Prim#

Create a Camera

Parameters:
  • position – XYZ coordinates in world space. If a single value is provided, all axes will be set to that value.

  • scale – Scaling factors for XYZ axes. If a single value is provided, all axes will be set to that value.

  • rotation – Euler angles in degrees in XYZ order. If a single value is provided, all axes will be set to that value.

  • look_at – Look-at target, specified either as a ReplicatorItem, a prim path, or world coordinates. If multiple prims are set, the target point will be the mean of their positions.

  • look_at_up_axis – Look-at up axis of the created prim.

  • relative_to – Reference prim for relative positioning. If provided, position will be relative to this prim

  • pivot – Pivot point specified as a tuple of (x, y, z) normalized to the range [-1, 1] where 0 is the center of the prim

  • focal_length – Focal length of the camera.

  • focus_distance – Distance to the focus plane.

  • f_stop – F-stop of the camera.

  • horizontal_aperture – Horizontal aperture of the camera.

  • horizontal_aperture_offset – Horizontal aperture offset of the camera.

  • vertical_aperture_offset – Vertical aperture offset of the camera.

  • clipping_range – Clipping range of the camera.

  • projection_type – Camera projection model. Select from [“pinhole”, “fisheye_polynomial”, “fisheyeSpherical”, “fisheyeKannalaBrandtK3”, “fisheyeRadTanThinPrism”, “omniDirectionalStereo”].

  • fisheye_nominal_width – Nominal width of fisheye lens model.

  • fisheye_nominal_height – Nominal height of fisheye lens model.

  • fisheye_optical_centre_x – Optical centre x of the fisheye camera.

  • fisheye_optical_centre_y – Optical centre y of the fisheye camera.

  • fisheye_max_fov – Maximum field of view of the fisheye camera.

  • fisheye_polynomial_a – Polynomial coefficient a of the fisheye camera.

  • fisheye_polynomial_b – Polynomial coefficient b of the fisheye camera.

  • fisheye_polynomial_c – Polynomial coefficient c of the fisheye camera.

  • fisheye_polynomial_d – Polynomial coefficient d of the fisheye camera.

  • fisheye_polynomial_e – Polynomial coefficient e of the fisheye camera.

  • fisheye_polynomial_f – Polynomial coefficient f of the fisheye camera.

  • fisheye_p0 – Polynomial coefficient p0 of the fisheye camera.

  • fisheye_p1 – Polynomial coefficient p1 of the fisheye camera.

  • fisheye_s0 – Polynomial coefficient s0 of the fisheye camera.

  • fisheye_s1 – Polynomial coefficient s1 of the fisheye camera.

  • fisheye_s2 – Polynomial coefficient s2 of the fisheye camera.

  • fisheye_s3 – Polynomial coefficient s3 of the fisheye camera.

  • cross_camera_reference_name – Name of the cross camera reference.

  • count – Number of cameras to create.

  • name – Name of the object.

  • parent – Optional parent prim path. The xform will be created as a child of this prim.

Example

>>> import omni.replicator.core as rep
>>> camera = rep.create.camera(
...     position=rep.distribution.uniform((0,0,0), (100, 100, 100)),
... )
omni.replicator.core.functional.create_batch.reference(
usd_path: str | List[str] = None,
prim_path: str | List[str] = None,
position: float | Tuple[float] = None,
scale: float | Tuple[float] = None,
rotation: float | Tuple[float] = None,
look_at: str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: Tuple[float] = None,
pivot: Tuple[float, float, float] | List[Tuple[float, float, float]] | Vec3d = None,
relative_to: str | Path | Prim = None,
semantics: Dict[str, List | str] | List[Tuple[str, str]] = None,
visible: bool = True,
count: int = 1,
name: str | None = None,
parent: str | Path | Prim = None,
) List[Prim]#

Create a Xform

Parameters:
  • usd_path – USD path of the prim to reference.

  • prim_path – Prim path of the prim to reference.

  • position – XYZ coordinates in world space. If a single value is provided, all axes will be set to that value.

  • scale – Scaling factors for XYZ axes. If a single value is provided, all axes will be set to that value.

  • rotation – Euler angles in degrees in XYZ order. If a single value is provided, all axes will be set to that value.

  • look_at – Look-at target, specified either as a ReplicatorItem, a prim path, or world coordinates. If multiple prims are set, the target point will be the mean of their positions.

  • look_at_up_axis – Look-at up axis of the created prim.

  • pivot – Pivot point specified as a tuple of (x, y, z) normalized to the range [-1, 1] where 0 is the center of the prim

  • relative_to – Reference prim for relative positioning. If provided, position will be relative to this prim

  • semantics – List of semantic type-label pairs.

  • visible – If False, the prim will be invisible. This is often useful when creating prims to use as bounds with other randomizers.

  • count – Number of objects to create.

  • name – Name of the object.

  • parent – Optional parent prim path. The xform will be created as a child of this prim.

Example

>>> import omni.replicator.core as rep
>>> xform = rep.create.xform(
...     position=rep.distribution.uniform((0,0,0), (100, 100, 100)),
...     semantics={"class": "thing"},
... )
omni.replicator.core.functional.create_batch.plane(
position: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
scale: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
rotation: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
look_at: str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: Tuple[float] = None,
pivot: Tuple[float, float, float] | List[Tuple[float, float, float]] | Vec3d = None,
relative_to: str | Path | Prim = None,
semantics: Dict[str, List | str] | List[Tuple[str, str]] = None,
visible: bool = True,
count: int = 1,
name: str | None = None,
parent: str | Path | Prim = None,
material: Prim | usdrt.Usd.Prim | List[Prim | usdrt.Usd.Prim] = None,
) List[Prim]#

Creates a plane mesh prim.

Parameters:
  • position – XYZ coordinates in world space. Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • scale – Scale factors for XYZ axes. Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • rotation – Euler angles in degrees (XYZ order). Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • look_at – Target to point plane at (prim path, coordinates, or list of targets)

  • look_at_up_axis – Up axis vector for look_at orientation

  • pivot – Pivot point specified as a tuple of (x, y, z) normalized to the range [-1, 1] where 0 is the center of the prim

  • relative_to – Reference prim for relative positioning. If provided, position will be relative to this prim

  • semantics – Dictionary specifying semantic type and values. Legacy lists of tuples are also accepted but will be converted to dictionaries.

  • visible – Whether plane should be visible

  • count – Number of planes to create

  • name – Name for the plane prim

  • parent – Parent prim path to create plane under

Returns:

List of created plane prims

Return type:

List[pxr.Usd.Prim]

Example

>>> import omni.replicator.core.functional as F
>>> plane = F.create_batch.plane(
...     position=(1, 2, 3),
...     scale=(2, 2, 1),
...     rotation=(90, 0, 0)
... )
omni.replicator.core.functional.create_batch.sphere(
position: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
scale: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
rotation: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
look_at: str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: Tuple[float] = None,
pivot: Tuple[float, float, float] | List[Tuple[float, float, float]] | Vec3d = None,
relative_to: str | Path | Prim = None,
semantics: Dict[str, List | str] | List[Tuple[str, str]] = None,
visible: bool = True,
as_mesh: bool = True,
count: int = 1,
name: str | None = None,
parent: str | Path | Prim = None,
material: Prim | usdrt.Usd.Prim | List[Prim | usdrt.Usd.Prim] = None,
) List[Prim]#

Creates a sphere prim, either as a mesh or native USD sphere.

Parameters:
  • position – XYZ coordinates in world space. Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • scale – Scale factors for XYZ axes. Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • rotation – Euler angles in degrees (XYZ order). Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • look_at – Target to point sphere at (prim path, coordinates, or list of targets)

  • look_at_up_axis – Up axis vector for look_at orientation

  • pivot – Pivot point specified as a tuple of (x, y, z) normalized to the range [-1, 1] where 0 is the center of the prim

  • relative_to – Reference prim for relative positioning. If provided, position will be relative to this prim

  • semantics – Dictionary specifying semantic type and values. Legacy lists of tuples are also accepted but will be converted to dictionaries.

  • visible – Whether sphere should be visible

  • as_mesh – If True, creates a mesh sphere. If False, creates a native USD sphere

  • count – Number of spheres to create

  • name – Name for the sphere prim

  • parent – Parent prim path to create sphere under

Returns:

List of created sphere prims

Return type:

List[pxr.Usd.Prim]

Example

>>> import omni.replicator.core.functional as F
>>> sphere = F.create_batch.sphere(
...     position=(0, 1, 0),
...     scale=0.5,
...     as_mesh=True
... )
omni.replicator.core.functional.create_batch.cube(
position: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
scale: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
rotation: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
look_at: str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: Tuple[float] = None,
pivot: Tuple[float, float, float] | List[Tuple[float, float, float]] | Vec3d = None,
relative_to: str | Path | Prim = None,
semantics: Dict[str, List | str] | List[Tuple[str, str]] = None,
visible: bool = True,
as_mesh: bool = True,
count: int = 1,
name: str | None = None,
parent: str | Path | Prim = None,
material: Prim | usdrt.Usd.Prim | List[Prim | usdrt.Usd.Prim] = None,
) List[Prim]#

Creates a cube prim, either as a mesh or native USD cube.

Parameters:
  • position – XYZ coordinates in world space. Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • scale – Scale factors for XYZ axes. Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • rotation – Euler angles in degrees (XYZ order). Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • look_at – Target to point cube at (prim path, coordinates, or list of targets)

  • look_at_up_axis – Up axis vector for look_at orientation

  • pivot – Pivot point specified as a tuple of (x, y, z) normalized to the range [-1, 1] where 0 is the center of the prim

  • relative_to – Reference prim for relative positioning. If provided, position will be relative to this prim

  • semantics – Dictionary specifying semantic type and values. Legacy lists of tuples are also accepted but will be converted to dictionaries.

  • visible – Whether cube should be visible

  • as_mesh – If True, creates a mesh cube. If False, creates a native USD cube

  • count – Number of cubes to create

  • name – Name for the cube prim

  • parent – Parent prim path to create cube under

Returns:

List of created cube prims

Return type:

List[pxr.Usd.Prim]

Example

>>> import omni.replicator.core.functional as F
>>> cube = F.create_batch.cube(
...     position=(0, 1, 0),
...     scale=0.5,
...     as_mesh=True
... )
omni.replicator.core.functional.create_batch.disk(
position: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
scale: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
rotation: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
look_at: str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: Tuple[float] = None,
pivot: Tuple[float, float, float] | List[Tuple[float, float, float]] | Vec3d = None,
relative_to: str | Path | Prim = None,
semantics: Dict[str, List | str] | List[Tuple[str, str]] = None,
visible: bool = True,
count: int = 1,
name: str | None = None,
parent: str | Path | Prim = None,
material: Prim | usdrt.Usd.Prim | List[Prim | usdrt.Usd.Prim] = None,
) List[Prim]#

Creates a disk mesh prim.

Parameters:
  • position – XYZ coordinates in world space. Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • scale – Scale factors for XYZ axes. Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • rotation – Euler angles in degrees (XYZ order). Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • look_at – Target to point disk at (prim path, coordinates, or list of targets)

  • look_at_up_axis – Up axis vector for look_at orientation

  • pivot – Pivot point specified as a tuple of (x, y, z) normalized to the range [-1, 1] where 0 is the center of the prim

  • relative_to – Reference prim for relative positioning. If provided, position will be relative to this prim

  • semantics – Dictionary specifying semantic type and values. Legacy lists of tuples are also accepted but will be converted to dictionaries.

  • visible – Whether disk should be visible

  • count – Number of disks to create

  • name – Name for the disk prim

  • parent – Parent prim path to create disk under

Returns:

List of created disk prims

Return type:

List[pxr.Usd.Prim]

Example

>>> import omni.replicator.core.functional as F
>>> disk = F.create_batch.disk(
...     position=(0, 1, 0),
...     scale=0.5,
... )
omni.replicator.core.functional.create_batch.torus(
position: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
scale: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
rotation: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
look_at: str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: Tuple[float] = None,
pivot: Tuple[float, float, float] | List[Tuple[float, float, float]] | Vec3d = None,
relative_to: str | Path | Prim = None,
semantics: Dict[str, List | str] | List[Tuple[str, str]] = None,
visible: bool = True,
count: int = 1,
name: str | None = None,
parent: str | Path | Prim = None,
material: Prim | usdrt.Usd.Prim | List[Prim | usdrt.Usd.Prim] = None,
) List[Prim]#

Creates a torus mesh prim.

Parameters:
  • position – XYZ coordinates in world space. Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • scale – Scale factors for XYZ axes. Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • rotation – Euler angles in degrees (XYZ order). Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • look_at – Target to point torus at (prim path, coordinates, or list of targets)

  • look_at_up_axis – Up axis vector for look_at orientation

  • pivot – Pivot point specified as a tuple of (x, y, z) normalized to the range [-1, 1] where 0 is the center of the prim

  • relative_to – Reference prim for relative positioning. If provided, position will be relative to this prim

  • semantics – Dictionary specifying semantic type and values. Legacy lists of tuples are also accepted but will be converted to dictionaries.

  • visible – Whether torus should be visible

  • count – Number of toruses to create

  • name – Name for the torus prim

  • parent – Parent prim path to create torus under

Returns:

List of created torus prims

Return type:

List[pxr.Usd.Prim]

Example

>>> import omni.replicator.core.functional as F
>>> torus = F.create_batch.torus(
...     position=(0, 1, 0),
...     scale=0.5,
... )
omni.replicator.core.functional.create_batch.cylinder(
position: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
scale: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
rotation: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
look_at: str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: Tuple[float] = None,
pivot: Tuple[float, float, float] | List[Tuple[float, float, float]] | Vec3d = None,
relative_to: str | Path | Prim = None,
semantics: Dict[str, List | str] | List[Tuple[str, str]] = None,
as_mesh: bool = True,
visible: bool = True,
count: int = 1,
name: str | None = None,
parent: str | Path | Prim = None,
material: Prim | usdrt.Usd.Prim | List[Prim | usdrt.Usd.Prim] = None,
) List[Prim]#

Creates a cylinder prim, either as a mesh or native USD cylinder.

Parameters:
  • position – XYZ coordinates in world space. Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • scale – Scale factors for XYZ axes. Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • rotation – Euler angles in degrees (XYZ order). Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • look_at – Target to point cylinder at (prim path, coordinates, or list of targets)

  • look_at_up_axis – Up axis vector for look_at orientation

  • pivot – Pivot point specified as a tuple of (x, y, z) normalized to the range [-1, 1] where 0 is the center of the prim

  • relative_to – Reference prim for relative positioning. If provided, position will be relative to this prim

  • semantics – Dictionary specifying semantic type and values. Legacy lists of tuples are also accepted but will be converted to dictionaries.

  • as_mesh – If True, creates a mesh cylinder. If False, creates a native USD cylinder

  • visible – Whether cylinder should be visible

  • count – Number of cylinders to create

  • name – Name for the cylinder prim

  • parent – Parent prim path to create cylinder under

Returns:

List of created cylinder prims

Return type:

List[pxr.Usd.Prim]

Example

>>> import omni.replicator.core.functional as F
>>> cylinder = F.create_batch.cylinder(
...     position=(0, 0, 0),
...     scale=(0.5, 0.5, 2.0),
...     rotation=(0, 0, 90)
... )
omni.replicator.core.functional.create_batch.cone(
position: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
scale: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
rotation: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
look_at: str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: Tuple[float] = None,
pivot: Tuple[float, float, float] | List[Tuple[float, float, float]] | Vec3d = None,
relative_to: str | Path | Prim = None,
semantics: Dict[str, List | str] | List[Tuple[str, str]] = None,
visible: bool = True,
as_mesh: bool = True,
count: int = 1,
name: str | None = None,
parent: str | Path | Prim = None,
material: Prim | usdrt.Usd.Prim | List[Prim | usdrt.Usd.Prim] = None,
) List[Prim]#

Creates a cone prim, either as a mesh or native USD cone.

Parameters:
  • position – XYZ coordinates in world space. Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • scale – Scale factors for XYZ axes. Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • rotation – Euler angles in degrees (XYZ order). Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • look_at – Target to point cone at (prim path, coordinates, or list of targets)

  • look_at_up_axis – Up axis vector for look_at orientation

  • pivot – Pivot point specified as a tuple of (x, y, z) normalized to the range [-1, 1] where 0 is the center of the prim

  • relative_to – Reference prim for relative positioning. If provided, position will be relative to this prim

  • semantics – Dictionary specifying semantic type and values. Legacy lists of tuples are also accepted but will be converted to dictionaries.

  • visible – Whether cone should be visible

  • as_mesh – If True, creates a mesh cone. If False, creates a native USD cone

  • count – Number of cones to create

  • name – Name for the cone prim

  • parent – Parent prim path to create cone under

Returns:

List of created cone prims

Return type:

List[pxr.Usd.Prim]

Example

>>> import omni.replicator.core.functional as F
>>> cone = F.create_batch.cone(
...     position=(0, 1, 0),
...     scale=(1, 1, 2),
...     rotation=(180, 0, 0)
... )
omni.replicator.core.functional.create_batch.sphere_light(
position: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
scale: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
rotation: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
look_at: str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: Tuple[float] = None,
pivot: Tuple[float, float, float] | List[Tuple[float, float, float]] | Vec3d = None,
relative_to: str | Path | Prim = None,
semantics: Dict[str, List | str] | List[Tuple[str, str]] = None,
visible: bool = True,
color: Tuple[float, float, float] = (1.0, 1.0, 1.0),
intensity: float = 30000.0,
exposure: float = None,
color_temperature: float = 6500,
enable_color_temperature: bool = False,
diffuse: float = 1.0,
specular: float = 1.0,
shaping_cone_angle: float = 180.0,
shaping_cone_softness: float = 0.0,
shaping_focus_tint: float = (1.0, 1.0, 1.0),
radius: float = 1.0,
count: int = 1,
name: str | None = None,
parent: str | Path | Prim = None,
) List[Prim]#

Creates a sphere light prim with configurable lighting properties.

Parameters:
  • position – XYZ coordinates in world space. Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • scale – Scale factors for XYZ axes. Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • rotation – Euler angles in degrees (XYZ order). Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • look_at – Target to point light at (prim path, coordinates, or list of targets)

  • look_at_up_axis – Up axis vector for look_at orientation

  • pivot – Pivot point specified as a tuple of (x, y, z) normalized to the range [-1, 1] where 0 is the center of the prim

  • relative_to – Reference prim for relative positioning. If provided, position will be relative to this prim

  • semantics – Dictionary specifying semantic type and values. Legacy lists of tuples are also accepted but will be converted to dictionaries.

  • visible – Whether light should be visible

  • color – RGB color of the light (0-1 range)

  • intensity – Light intensity in lumens

  • exposure – Light exposure value

  • color_temperature – Color temperature in Kelvin

  • enable_color_temperature – Whether to use color temperature

  • diffuse – Diffuse contribution multiplier

  • specular – Specular contribution multiplier

  • shaping_cone_angle – Angle of the light cone in degrees

  • shaping_cone_softness – Softness of the light cone

  • shaping_focus_tint – RGB tint color for focused area

  • radius – Radius of the sphere light

  • count – Number of lights to create

  • name – Name for the light prim

  • parent – Parent prim path to create light under

Returns:

List of created sphere light prims

Return type:

List[pxr.Usd.Prim]

Example

>>> import omni.replicator.core.functional as F
>>> light = F.create_batch.sphere_light(
...     position=(0, 2, 0),
...     color=(1, 0.8, 0.6),
...     intensity=50000,
...     radius=0.5
... )
omni.replicator.core.functional.create_batch.disk_light(
position: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
scale: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
rotation: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
look_at: str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: Tuple[float] = None,
pivot: Tuple[float, float, float] | List[Tuple[float, float, float]] | Vec3d = None,
relative_to: str | Path | Prim = None,
semantics: Dict[str, List | str] | List[Tuple[str, str]] = None,
visible: bool = True,
color: Tuple[float, float, float] = (1.0, 1.0, 1.0),
intensity: float = 30000.0,
exposure: float = None,
color_temperature: float = 6500,
enable_color_temperature: bool = False,
diffuse: float = 1.0,
specular: float = 1.0,
shaping_cone_angle: float = 180.0,
shaping_cone_softness: float = 0.0,
shaping_focus_tint: float = (1.0, 1.0, 1.0),
radius: float = 1.0,
count: int = 1,
name: str | None = None,
parent: str | Path | Prim = None,
) List[Prim]#

Creates a disk light prim with configurable lighting properties.

Parameters:
  • position – XYZ coordinates in world space. Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • scale – Scale factors for XYZ axes. Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • rotation – Euler angles in degrees (XYZ order). Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • look_at – Target to point light at (prim path, coordinates, or list of targets)

  • look_at_up_axis – Up axis vector for look_at orientation

  • pivot – Pivot point specified as a tuple of (x, y, z) normalized to the range [-1, 1] where 0 is the center of the prim

  • relative_to – Reference prim for relative positioning. If provided, position will be relative to this prim

  • semantics – Dictionary specifying semantic type and values. Legacy lists of tuples are also accepted but will be converted to dictionaries.

  • visible – Whether light should be visible

  • color – RGB color of the light (0-1 range)

  • intensity – Light intensity in lumens

  • exposure – Light exposure value

  • color_temperature – Color temperature in Kelvin

  • enable_color_temperature – Whether to use color temperature

  • diffuse – Diffuse contribution multiplier

  • specular – Specular contribution multiplier

  • shaping_cone_angle – Angle of the light cone in degrees

  • shaping_cone_softness – Softness of the light cone

  • shaping_focus_tint – RGB tint color for focused area

  • radius – Radius of the disk light

  • count – Number of lights to create

  • name – Name for the light prim

  • parent – Parent prim path to create light under

Returns:

List of created disk light prims

Return type:

List[pxr.Usd.Prim]

Example

>>> import omni.replicator.core.functional as F
>>> light = F.create_batch.disk_light(
...     position=(0, 2, 0),
...     color=(1, 0.8, 0.6),
...     intensity=50000,
...     radius=0.5
... )
omni.replicator.core.functional.create_batch.rect_light(
position: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
scale: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
rotation: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
look_at: str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: Tuple[float] = None,
pivot: Tuple[float, float, float] | List[Tuple[float, float, float]] | Vec3d = None,
relative_to: str | Path | Prim = None,
semantics: Dict[str, List | str] | List[Tuple[str, str]] = None,
visible: bool = True,
color: Tuple[float, float, float] = (1.0, 1.0, 1.0),
intensity: float = 30000.0,
exposure: float = None,
color_temperature: float = 6500,
enable_color_temperature: bool = False,
diffuse: float = 1.0,
specular: float = 1.0,
shaping_cone_angle: float = 180.0,
shaping_cone_softness: float = 0.0,
shaping_focus_tint: float = (1.0, 1.0, 1.0),
height: float = 1.0,
width: float = 1.0,
count: int = 1,
name: str | None = None,
parent: str | Path | Prim = None,
) List[Prim]#

Creates a rectangle light prim with configurable lighting properties.

Parameters:
  • position – XYZ coordinates in world space. Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • scale – Scale factors for XYZ axes. Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • rotation – Euler angles in degrees (XYZ order). Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • look_at – Target to point light at (prim path, coordinates, or list of targets)

  • look_at_up_axis – Up axis vector for look_at orientation

  • pivot – Pivot point specified as a tuple of (x, y, z) normalized to the range [-1, 1] where 0 is the center of the prim

  • relative_to – Reference prim for relative positioning. If provided, position will be relative to this prim

  • semantics – Dictionary specifying semantic type and values. Legacy lists of tuples are also accepted but will be converted to dictionaries.

  • visible – Whether light should be visible

  • color – RGB color of the light (0-1 range)

  • intensity – Light intensity in lumens

  • exposure – Light exposure value

  • color_temperature – Color temperature in Kelvin

  • enable_color_temperature – Whether to use color temperature

  • diffuse – Diffuse contribution multiplier

  • specular – Specular contribution multiplier

  • shaping_cone_angle – Angle of the light cone in degrees

  • shaping_cone_softness – Softness of the light cone

  • shaping_focus_tint – RGB tint color for focused area

  • height – Height of the rectangle light

  • width – Width of the rectangle light

  • count – Number of lights to create

  • name – Name for the light prim

  • parent – Parent prim path to create light under

Returns:

List of created rectangle light prims

Return type:

List[pxr.Usd.Prim]

Example

>>> import omni.replicator.core.functional as F
>>> light = F.create_batch.rect_light(
...     position=(0, 2, 0),
...     color=(1, 0.8, 0.6),
...     intensity=50000,
...     height=0.5,
...     width=0.5
... )
omni.replicator.core.functional.create_batch.cylinder_light(
position: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
scale: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
rotation: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
look_at: str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: Tuple[float] = None,
pivot: Tuple[float, float, float] | List[Tuple[float, float, float]] | Vec3d = None,
relative_to: str | Path | Prim = None,
semantics: Dict[str, List | str] | List[Tuple[str, str]] = None,
visible: bool = True,
color: Tuple[float, float, float] = (1.0, 1.0, 1.0),
intensity: float = 30000.0,
exposure: float = None,
color_temperature: float = 6500,
enable_color_temperature: bool = False,
diffuse: float = 1.0,
specular: float = 1.0,
shaping_cone_angle: float = 180.0,
shaping_cone_softness: float = 0.0,
shaping_focus_tint: float = (1.0, 1.0, 1.0),
radius: float = 1.0,
length: float = 1.0,
count: int = 1,
name: str | None = None,
parent: str | Path | Prim = None,
) List[Prim]#

Creates a cylinder light prim with configurable lighting properties.

Parameters:
  • position – XYZ coordinates in world space. Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • scale – Scale factors for XYZ axes. Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • rotation – Euler angles in degrees (XYZ order). Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • look_at – Target to point light at (prim path, coordinates, or list of targets)

  • look_at_up_axis – Up axis vector for look_at orientation

  • pivot – Pivot point specified as a tuple of (x, y, z) normalized to the range [-1, 1] where 0 is the center of the prim

  • relative_to – Reference prim for relative positioning. If provided, position will be relative to this prim

  • semantics – Dictionary specifying semantic type and values. Legacy lists of tuples are also accepted but will be converted to dictionaries.

  • visible – Whether light should be visible

  • color – RGB color of the light (0-1 range)

  • intensity – Light intensity in lumens

  • exposure – Light exposure value

  • color_temperature – Color temperature in Kelvin

  • enable_color_temperature – Whether to use color temperature

  • diffuse – Diffuse contribution multiplier

  • specular – Specular contribution multiplier

  • shaping_cone_angle – Angle of the light cone in degrees

  • shaping_focus_tint – RGB tint color for focused area

  • shaping_cone_softness – Softness of the light cone

  • radius – Radius of the cylinder light

  • length – Length of the cylinder light

  • count – Number of lights to create

  • name – Name for the light prim

  • parent – Parent prim path to create light under

Returns:

List of created cylinder light prims

Return type:

List[pxr.Usd.Prim]

Example

>>> import omni.replicator.core.functional as F
>>> light = F.create_batch.cylinder_light(
...     position=(0, 2, 0),
...     color=(1, 0.8, 0.6),
...     intensity=50000,
...     radius=0.5,
...     length=0.5
... )
omni.replicator.core.functional.create_batch.distant_light(
position: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
scale: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
rotation: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
look_at: str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: Tuple[float] = None,
pivot: Tuple[float, float, float] | List[Tuple[float, float, float]] | Vec3d = None,
relative_to: str | Path | Prim = None,
semantics: Dict[str, List | str] | List[Tuple[str, str]] = None,
visible: bool = True,
color: Tuple[float, float, float] = (1.0, 1.0, 1.0),
intensity: float = 30000.0,
exposure: float = None,
color_temperature: float = 6500,
enable_color_temperature: bool = False,
diffuse: float = 1.0,
specular: float = 1.0,
shaping_cone_angle: float = 180.0,
shaping_cone_softness: float = 0.0,
shaping_focus_tint: float = (1.0, 1.0, 1.0),
angle: float = 1.0,
count: int = 1,
name: str | None = None,
parent: str | Path | Prim = None,
) List[Prim]#

Creates a distant light prim with configurable lighting properties.

Parameters:
  • position – XYZ coordinates in world space. Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • scale – Scale factors for XYZ axes. Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • rotation – Euler angles in degrees (XYZ order). Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • look_at – Target to point light at (prim path, coordinates, or list of targets)

  • look_at_up_axis – Up axis vector for look_at orientation

  • pivot – Pivot point specified as a tuple of (x, y, z) normalized to the range [-1, 1] where 0 is the center of the prim

  • relative_to – Reference prim for relative positioning. If provided, position will be relative to this prim

  • semantics – Dictionary specifying semantic type and values. Legacy lists of tuples are also accepted but will be converted to dictionaries.

  • visible – Whether light should be visible

  • color – RGB color of the light (0-1 range)

  • intensity – Light intensity in lumens

  • exposure – Light exposure value

  • color_temperature – Color temperature in Kelvin

  • enable_color_temperature – Whether to use color temperature

  • diffuse – Diffuse contribution multiplier

  • specular – Specular contribution multiplier

  • shaping_cone_angle – Angle of the light cone in degrees

  • shaping_cone_softness – Softness of the light cone

  • shaping_focus_tint – RGB tint color for focused area

  • angle – Angle of the light cone in degrees. For example, the sun has an angle of 0.53 degrees as seen from the earth. A higher angle results in softer shadow edges.

  • count – Number of lights to create

  • name – Name for the light prim

  • parent – Parent prim path to create light under

Returns:

List of created distant light prims

Return type:

List[pxr.Usd.Prim]

Example

>>> import omni.replicator.core.functional as F
>>> light = F.create_batch.distant_light(
...     position=(0, 2, 0),
...     color=(1, 0.8, 0.6),
...     intensity=50000,
...     angle=1.0
... )
omni.replicator.core.functional.create_batch.dome_light(
position: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
scale: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
rotation: float | Tuple[float, float, float] | List[Tuple[float, float, float]] = None,
look_at: str | Path | usdrt.Sdf.Path | Tuple[float, float, float] | List[str | Path | usdrt.Sdf.Path] = None,
look_at_up_axis: Tuple[float] = None,
pivot: Tuple[float, float, float] | List[Tuple[float, float, float]] | Vec3d = None,
color: Tuple[float] = (1.0, 1.0, 1.0),
texture: str = None,
texture_format: str = 'latlong',
intensity: float = 1000.0,
exposure: float = 1.0,
diffuse: float = 1.0,
specular: float = 1.0,
color_temperature: float = 6500,
enable_color_temperature: bool = False,
shaping_cone_angle: float = 180.0,
shaping_cone_softness: float = 0.0,
shaping_focus_tint: float = (1.0, 1.0, 1.0),
count: int = 1,
name: str | None = None,
parent: str | Path | Prim = None,
**kwargs,
) List[Prim]#

Creates a dome light prim for environment/sky lighting.

Parameters:
  • position – XYZ coordinates in world space. Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • scale – Scale factors for XYZ axes. Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • rotation – Euler angles in degrees (XYZ order). Can be single value (applies to all axes), tuple (applies to XYZ), or list of tuples (one per prim)

  • look_at – Target to point light at (prim path, coordinates, or list of targets)

  • look_at_up_axis – Up axis vector for look_at orientation

  • pivot – Pivot point specified as a tuple of (x, y, z) normalized to the range [-1, 1] where 0 is the center of the prim

  • color – RGB color of the light (0-1 range)

  • texture – Path to environment texture map

  • texture_format – Format of the texture map (‘latlong’ or ‘mirroredBall’)

  • intensity – Light intensity in lumens

  • exposure – Exposure multiplier

  • diffuse – Diffuse contribution multiplier

  • specular – Specular contribution multiplier

  • color_temperature – Color temperature in Kelvin

  • enable_color_temperature – Whether to use color temperature

  • shaping_cone_angle – Angle of the light cone in degrees

  • shaping_cone_softness – Softness of the light cone

  • shaping_focus_tint – Focus tint color

  • count – Number of lights to create

  • name – Name for the light prim

  • parent – Parent prim path to create light under

  • **kwargs – Additional light parameters to set

Returns:

List of created dome light prims

Return type:

List[pxr.Usd.Prim]

Example

>>> import omni.replicator.core.functional as F
>>> light = F.create_batch.dome_light(
...     texture="/path/to/hdri.exr",
...     intensity=2000,
...     rotation=(0, 45, 0)
... )
omni.replicator.core.functional.create_batch.material(
mdl: str,
bind_prims: list | None = None,
count: int = 1,
name: str | None = None,
parent: str | Path | Prim = None,
**kwargs,
)#

Creates a material prim with MDL shader and binds it to target prims.

Parameters:
  • mdl – Path to MDL material file

  • bind_prims – List of prims to bind material to

  • count – Number of material prims to create

  • name – Name for the material prim

  • parent – Parent prim path to create material under

  • **kwargs – Additional material parameters to set

Returns:

List of created material prims

Return type:

List[pxr.Usd.Prim]

Example

>>> import omni.replicator.core.functional as F
>>> material = F.create_batch.material(
...     mdl="OmniPBR.mdl",
...     bind_prims=[sphere_prim],
...     diffuse_color=(1, 0, 0)
... )
omni.replicator.core.functional.create_batch.omni_lidar(
position: float | Tuple[float] = None,
rotation: float | Tuple[float] = None,
count: int = 1,
name: str | None = None,
parent: str | Path | Prim = None,
**kwargs,
) List[Prim | usdrt.Usd.Prim]#

Create a LiDAR sensor.

Parameters:
  • position – XYZ coordinates in world space. If a single value is provided, all axes will be set to that value.

  • rotation – Euler angles in degrees in XYZ order. If a single value is provided, all axes will be set to that value.

  • count – Number of LiDAR sensors to create

  • name – Name for the LiDAR sensor

  • parent – Parent prim path to create LiDAR under

  • **kwargs – Additional attributes to be added to the LiDAR sensor

Example

>>> import omni.replicator.core as rep
>>> # Create LiDAR sensor
>>> lidar = rep.functional.create_batch.omni_lidar(
...     position=(100, 100, 100),
...     rotation=(45, 45, 0),
... )
omni.replicator.core.functional.create_batch.omni_radar(
position: float | Tuple[float] = None,
rotation: float | Tuple[float] = None,
count: int = 1,
name: str | None = None,
parent: str | Path | Prim = None,
**kwargs,
) List[Prim | usdrt.Usd.Prim]#

Create a Radar sensor.

Parameters:
  • position – XYZ coordinates in world space. If a single value is provided, all axes will be set to that value.

  • rotation – Euler angles in degrees in XYZ order. If a single value is provided, all axes will be set to that value.

  • count – Number of Radar sensors to create

  • name – Name for the Radar sensor

  • parent – Parent prim path to create Radar under

  • **kwargs – Additional attributes to be added to the Radar sensor

Example

>>> import omni.replicator.core as rep
>>> # Create Radar sensor
>>> radar = rep.functional.create_batch.omni_radar(
...     position=(100, 100, 100),
...     rotation=(45, 45, 0),
... )

I/O#

Modify#

omni.replicator.core.functional.modify.pose(
prims: Prim | usdrt.Usd.Prim | List[Prim | usdrt.Usd.Prim],
position_value=None,
rotation_value=None,
rotation_order: str | None = None,
scale_value=None,
relative_to: str | Path | usdrt.Sdf.Path | Prim | usdrt.Usd.Prim = None,
look_at_value: Prim | usdrt.Usd.Prim | List[Prim | usdrt.Usd.Prim | Tuple[float, float, float] | Vec3d] | Tuple[float, float, float] | Vec3d = None,
look_at_up_axis: Tuple[float, float, float] | List[float] | Vec3d = (0, 1, 0),
pivot: Tuple[float, float, float] | List[Tuple[float, float, float]] | Vec3d = None,
)#

Modify the pose of prims by setting position, rotation, scale and look-at parameters.

Parameters:
  • prims – Single prim or list of prims to modify

  • position_value – World space position(s) as (x,y,z) tuples

  • rotation_value – Rotation value(s) as Euler angles, quaternions or Gf.Rotation

  • rotation_order – Rotation order for Euler angles. If None, the default rotation order specified by the /app/primCreation/DefaultRotationOrder setting will be used.

  • scale_value – Scale value(s) as single float or (x,y,z) tuples

  • relative_to – Reference prim to apply transforms relative to

  • look_at_value – Target(s) to orient prims towards (mutually exclusive with rotation_value)

  • look_at_up_axis – Up vector for look-at calculations

  • pivot – Local pivot point(s) for transforms, normalized to [-1,1] range

Raises:

ValueError – If invalid inputs are provided or operations fail

omni.replicator.core.functional.modify.position(
prims: Prim | usdrt.Usd.Prim | List[Prim | usdrt.Usd.Prim],
value: Tuple[float, float, float] | List[Tuple[float, float, float]] | Vec3d,
relative_to: str | Path | usdrt.Sdf.Path | Prim | usdrt.Usd.Prim = None,
pivot: Tuple[float, float, float] | List[Tuple[float, float, float]] | Vec3d = None,
)#
omni.replicator.core.functional.modify.look_at(
prims: Prim | usdrt.Usd.Prim | List[Prim | usdrt.Usd.Prim],
value: Tuple[float, float, float] | List[Tuple[float, float, float]] | Vec3d,
look_at_up_axis: Tuple[float, float, float] | List[float] | Vec3d = (0, 1, 0),
)#

Modify the look_at of USD prims.

Parameters:
  • prims – Single prim or list of prims to look_at.

  • value – Look_at target(s) specified as either: - USD prim - Point in space as (x,y,z)

  • look_at_up_axis – Up vector for look_at calculations. Defaults to (0,1,0).

omni.replicator.core.functional.modify.rotation(
prims: Prim | usdrt.Usd.Prim | List[Prim | usdrt.Usd.Prim],
value: Tuple[float, float, float] | List[Tuple[float, float, float]] | Vec3d,
value_rotation_order: str = 'XYZ',
relative_to: str | Path | usdrt.Sdf.Path | Prim | usdrt.Usd.Prim = None,
pivot: Tuple[float, float, float] | List[Tuple[float, float, float]] | Vec3d = None,
)#

Modify the rotation of USD prims.

Target rotation will follow existing prim rotation operation when present. Otherwise, a “rotateXYZ” operation will be applied.

Parameters:
  • prims – Single prim or list of prims to rotate.

  • value – Rotation value(s) specified as either: - Euler angles in degrees. Rotation order can be specified using the value_rotation_order parameter. - Quaternion (x,y,z,w) - pxr.Gf.Rotation object.

  • value_rotation_order – Rotation operation of the provided value. Defaults to “XYZ”.

  • relative_to – Reference to apply rotation relative to. Can be: - Path string - USD prim - pxr.Sdf.Path

  • pivot – Local pivot point(s) for rotation, normalized to [-1,1] range. Origin is at center of prim’s bounding box.

Raises:

ValueError – If both value and look_at are specified, or if invalid rotation values or look_at targets are provided.

omni.replicator.core.functional.modify.scale(
prims: Prim | usdrt.Usd.Prim | List[Prim | usdrt.Usd.Prim],
value: Tuple[float, float, float] | List[Tuple[float, float, float]] | Vec3d,
relative_to: str | Path | usdrt.Sdf.Path | Prim | usdrt.Usd.Prim = None,
)#

Modify the scale of USD prims.

Parameters:
  • prims – Single prim or list of prims to scale.

  • value – Scale value(s) specified as either: - Tuple of (x,y,z) scale factors - List of (x,y,z) scale factors - pxr.Gf.Vec3d object

  • relative_to – Reference to apply scale relative to. Can be: - Path string - USD prim - pxr.Sdf.Path

omni.replicator.core.functional.modify.attribute(
prims: Prim | usdrt.Usd.Prim | List[Prim | usdrt.Usd.Prim],
attribute_name: str,
value: Any,
)#

Modify an attribute of a prim.

Parameters:
  • prims – The prims to modify

  • attribute_name – The name of the attribute to modify

  • value – The value to set the attribute to

omni.replicator.core.functional.modify.semantics(
prims: Prim | usdrt.Usd.Prim | List[Prim | usdrt.Usd.Prim],
value: List[Tuple[str, str]] | Dict[str, str | List[str]] | List[Dict[str, str | List[str]]] | None = None,
mode: str = 'add',
) None#

Modify semantics of one or more prims.

Modify the semantics of one or more prims. Semantics use the OpenUSD SemanticsLabelsAPI schema (https://openusd.org/dev/api/usd_semantics_overview.html). If a prim used the older SemanticsAPI schema, it will be automatically converted to the new SemanticsLabelsAPI schema.

Parameters:
  • prims – The prims to modify

  • value – Dictionary or List of dictionaries representing semantic type and values

  • mode – The mode to use for modifying semantics. Can be “add”, “replace”, or “clear”. - “add”: Add new semantics. If a semantic type already exists, it will be extended. - “replace”: Replace existing semantics. If a semantic type already exists, it will be replaced with the new value. - “clear”: Clear all existing semantics before applying new values.

omni.replicator.core.functional.modify.visibility(
prims: Prim | usdrt.Usd.Prim | List[Prim | usdrt.Usd.Prim],
value: bool | List[bool],
) None#

Sets the visibility attribute for one or more USD prims.

Parameters:
  • prims – A single prim or a list of prims (pxr.Usd.Prim or usdrt.Usd.Prim) whose visibility will be set.

  • value – A boolean or list of booleans indicating visibility for each prim. True sets visibility to “inherited” (visible), False sets to “invisible”.

Raises:

ValueError – If any value in value is not a boolean.

Physics#

omni.replicator.core.functional.physics.create_physics_scene(path: str = None, **kwargs) None#

Creates a new prim and applies the UsdPhysics.Scene schema to it.

If a physics scene at path already exists, no new scene is created, but kwarg attibutes will be set as

specified. Unless specified, default values are as defined in the schema.

Parameters:
  • path – Path to physics scene prim. If None, the default path /PhysicsScene is used.

  • **kwargs

    Allows setting schema attribute belonging to UsdPhysics.Scene or PhysxSchema.PhysxSceneAPI. The <schema>: prefix may be omitted when specifying the kwarg.

    • broadphaseType

      Broad phase algorithm used in the simulation. Select from ["GPU", "MBP", "SAP"]. Defaults to “MBP”.

    • collisionSystem

      Collision detection system. Select from [PCM, SAT].

    • enableCCD

      Enables a second broad phase check after integration that makes it possible to prevent objects from tunneling through each other.

    • enableGpuDynamics

      Enables the GPU Dynamics pipeline. Required for GPU only features like deformables. Defaults to False.

    • invertCollisionGroupFilter

      Boolean attribute indicating whether inverted collision group filtering should be used. By default two collisions, that do have a collisionGroup set, collide with each other. Adding a collisionGroup into a collisionGroup filtering will mean that the collision between those groups will be disabled. This boolean attribute does invert the default behavior. Hence two collisions with defined collisionGroups will not collide with each other by default and one does enable the collisions between the groups through the “CollisionGroup” filtering.

    • gravityDirection

      Gravity direction vector in simulation world space. Will be normalized before use. A zero vector is a request to use the negative upAxis. Unitless.

    • gravityMagnitude

      Gravity acceleration magnitude in simulation world space. A negative value is a request to use a value equivalent to earth gravity regardless of the metersPerUnit scaling used by this scene. Units: stage units / second / second.

    • maxPositionIterationCount

      Maximum position iteration count for all actors (rigid bodies, cloth, particles etc). Note that this setting will override solver iteration settings of individual actors that have requested more iterations. Range: [1, 255]

    • maxVelocityIterationCount

      Maximum velocity iteration count for all actors (rigid bodies, cloth, particles etc). Note that this setting will override solver iteration settings of individual actors that have requested more iterations. Range: [0, 255]

    • minPositionIterationCount

      Minimum position iteration count for all actors (rigid bodies, cloth, particles etc). Range: [1, 255]

    • minVelocityIterationCount

      Minimum velocity iteration count for all actors (rigid bodies, cloth, particles etc). Range: [0, 255]

    • reportKinematicKinematicPairs

      Boolean attribute indicating whether kinematic vs kinematic pairs generate contact reports.

    • reportKinematicStaticPairs

      Boolean attribute indicating whether kinematic vs static pairs generate contact reports.

    • solverType

      Solver used for the simulation. Select from [PGS, TGS].

    • timestepsPerSecond

      Simulation scene steps defined as number of steps per second.

omni.replicator.core.functional.physics.simulate(
time: float,
step_dt: float,
physics_scene: str | None = None,
) None#

Simulate physics for specified time without rendering.

Parameters:
  • time – The length of time in seconds for which to simulate physics

  • step_dt – The time in seconds for each physics step.

  • physics_scene (optional) – The physics scene to simulate. If None, physics is simulated globally. Defaults to None.

Notes

  • If the omni.physics.fabric extension is not enabled or if it is set to “USD” simulation mode, disabling

    physics prim sleeping with the /physics/disableSleeping flag is recommended to avoid prims from freezing in place.

omni.replicator.core.functional.physics.apply_rigid_body(
prims: Prim | usdrt.Usd.Prim | List[Prim | usdrt.Usd.Prim],
physics_scene: str | List[str] = None,
overwrite_rigid_body: bool = True,
with_collider: bool = True,
approximation: str = None,
**kwargs,
) None#

Applies the UsdPhysics.RigidBodyAPI and PhysxSchema.PhysxRigidBodyAPI schemas to the specified prims.

Unless specified, default values are defined in their respective schema.

Parameters:
  • prims – The prims to apply a rigid body to.

  • physics_scene – If provided, the assign the rigid body to physics scene at specified path. If None, the rigid body is assigned to the default physics scene. Identical to setting simulationOwner kwarg. If simulationOwner kwargs specified, physics_scene attribute is ignored.

  • overwrite_rigid_body – If True, apply rigid body to the specified prim and remove any rigid body already applied to a descendent prim. If False, rigid body is only be applied to the input prim if no descendent is already specified as a rigid body. This is because PhysX does not allow nested rigid body hierarchies.

  • with_collider – If True, apply a collider to the rigid body.

  • approximation – The mesh’s collision approximation. If None, defaults to convexHull. Ignored if with_collider is False.

  • **kwargs

    Allows setting schema attribute belonging to PhysxSchema.PhysxRigidBodyAPI or UsdPhysics.RigidBodyAPI. The <schema>: prefix may be omitted when specifying the kwarg.

    • rigidBodyEnabled

      Determines if the rigid body is enabled.

    • kinematicEnabled

      Determines whether the body is kinematic or not. A kinematic body is a body that is moved through animated poses or through user defined poses. The simulation derives velocities for the kinematic body based on the external motion. When a continuous motion is not desired, this kinematic flag should be set to false.

    • simulationOwner

      Single PhysicsScene that will simulate this body. By default this is the first PhysicsScene found in the stage using UsdStage.Traverse().

    • startsAsleep

      Determines if the body is asleep when the simulation starts.

    • velocity

      Linear velocity in the same space as the node’s xform. Units: stage units / second

    • angularVelocity

      Angular velocity in the same space as the node’s xform. Units: degrees / second

    • angularDamping

      Angular damping coefficient. Range: [0, inf) Units: dimensionless

    • cfmScale

      Constraint-force-mixing Scale. Range: [0, 1] Units: dimensionless

    • contactSlopCoefficient

      Tolerance on the angular influence of a contact that can help improve the behavior of rolling approximate collision shapes. Specifically, the angular component of a normal constraint in a contact is zeroed if normal.cross(offset) falls below this tolerance. The tolerance is scaled such that the behavior improvement persists through a range of angular velocities of a rolling shape. Range: [0, inf) Units: stage units

    • disableGravity

      Disable gravity for the rigid body

    • enableCCD

      Enable swept integration for the rigid body.

    • enableGyroscopicForces

      Enables computation of gyroscopic forces on the rigid body.

    • enableSpeculativeCcd

      Register a rigid body to dynamically adjust contact offset based on velocity. This can be used to achieve a CCD effect.

    • linearDamping

      Linear damping coefficient. Range: [0, inf) Units: dimensionless

    • lockedPosAxis

      Collection of flags providing a mechanism to lock motion along/around a specific axis (1 << 0, 1 << 1, 1 << 2).

    • lockedRotAxis

      Collection of flags providing a mechanism to lock motion along/around a specific axis (1 << 0, 1 << 1, 1 << 2).

    • maxAngularVelocity

      Maximum allowable angular velocity for rigid body. Range: [0, inf) Units: degrees / seconds

    • maxContactImpulse

      Sets a limit on the impulse that may be applied at a contact. The maximum impulse at a contact between two dynamic or kinematic bodies will be the minimum of the two limit values. For a collision between a static and a dynamic body, the impulse is limited by the value for the dynamic body. Range: [0, inf) Units: force * seconds = mass * stage units / seconds

    • maxDepenetrationVelocity

      The maximum depenetration velocity permitted to be introduced by the solver. Range: [0, inf) Units: stage units / seconds

    • maxLinearVelocity

      Maximum allowable linear velocity for the rigid body. (stage_units / seconds) Range: [0, inf) Units: stage units / seconds

    • retainAccelerations

      Mass-normalized kinetic energy threshold below which a rigid body may go to sleep. Range: [0, inf) Units: stage units * stage units / seconds / seconds

    • solveContact

      Process the contacts of this rigid body in the dynamics solver.

    • solverPositionIterationCount

      Solver position iteration counts for the body. Range [1, 255]

    • solverVelocityIterationCount

      Solver velocity iteration counts for the body. Range [0, 255]

    • stabilizationThreshold

      Mass-normalized kinetic energy threshold below which a rigid body may participate in stabilization. Range: [0, inf) Units: stage units * stage units / seconds / seconds

omni.replicator.core.functional.physics.apply_collider(
prims: Prim | usdrt.Usd.Prim | List[Prim | usdrt.Usd.Prim],
physics_scene: str | List[str] = None,
**kwargs,
)#

Apply the UsdPhysics.CollisionAPI, UsdPhysics.MeshCollisionAPI and PhysxSchema.PhysxCollisionAPI schemas to the specified prim.

Unless specified, default values are defined in their respective schema. PhysxSchema.PhysxCollisionAPI kwargs attributes and descriptions correspond to omni.usd.schema.physx-106.2.1.

Notes

approximation defaults to triangleMesh. However, triangleMesh is not compatible with dynamic bodies.

Parameters:
  • prims – The prim to apply a collider to.

  • physics_scene – If provided, the assign the rigid body to physics scene at specified path. If None, the rigid body is assigned to the default physics scene.

  • **kwargs

    Allows setting schema attribute belonging to UsdPhysics.CollisionAPI, UsdPhysics.MeshCollisionAPI or PhysxSchema.PhysxCollisionAPI. The <schema>: prefix may be omitted when specifying the kwarg.

    • collisionEnabled

      Determines if the PhysicsCollisionAPI is enabled.

    • simulationOwner

      Single PhysicsScene that will simulate this collider. By default this object belongs to the first PhysicsScene. Note that if a RigidBodyAPI in the hierarchy above has a different simulationOwner then it has a precedence over this relationship.

    • approximation

      Determines the mesh’s collision approximation:

      • none

        The mesh geometry is used directly as a collider without any approximation.

      • convexDecomposition

        A convex mesh decomposition is performed. This results in a set of convex mesh colliders.

      • convexHull

        A convex hull of the mesh is generated and used as the collider.

      • boundingSphere

        A bounding sphere is computed around the mesh and used as a collider.

      • boundingCube

        An optimally fitting box collider is computed around the mesh.

      • meshSimplification

        A mesh simplification step is performed, resulting in a simplified triangle mesh collider.

      Allowed Tokens: [“none”, “convexDecomposition”, “convexHull”, “boundingSphere”, “boundingCube”, “meshSimplification”]

    • contactOffset

      Contact offset of a collision shape. Default value -inf means default is picked by the simulation based on the shape extent. Range: [maximum(0, restOffset), inf) Units: stage units

    • minTorsionalPatchRadius

      Defines the minimum radius of the contact patch used to apply torsional friction. Range: [0, inf) Units: stage units

    • restOffset

      Rest offset of a collision shape. Default value -inf means that the simulation sets a suitable value. For rigid bodies, this value is zero. Range: [0, contactOffset] Units: stage units

    • torsionalPatchRadius

      Defines the radius of the contact patch used to apply torsional friction. Range: [0, inf) Units: stage units

omni.replicator.core.functional.physics.remove_rigid_body(
prims: Prim | usdrt.Usd.Prim | List[Prim | usdrt.Usd.Prim],
) None#

Remove a rigid body schema from the specified prim.

Removes the pxr.PhysxSchema.PhysxRigidBodyAPI and pxr.UsdPhysics.RigidBodyAPI schemas from the specified prim, if they are applied.

Parameters:

prims – The prims to remove the rigid body schema from.

omni.replicator.core.functional.physics.remove_collider(
prims: Prim | usdrt.Usd.Prim | List[Prim | usdrt.Usd.Prim],
) None#

Remove a collider schema from the specified prims.

Parameters:

prims – The prims to remove the collider from.

omni.replicator.core.functional.physics.modify_attribute(
prims: Prim | usdrt.Usd.Prim | List[Prim | usdrt.Usd.Prim],
attribute_name: str,
value: Any,
) None#

Apply physics attribute of specified prim.

Parameters:
  • prim – The prim whose attribute will be modified.

  • attribute_name – Attribute name.

  • value – Attribute value to set.

omni.replicator.core.functional.physics.reset() None#

Reset the physics simulation.

omni.replicator.core.functional.physics.put_to_sleep(
prims: Prim | usdrt.Usd.Prim | List[Prim | usdrt.Usd.Prim],
) None#

Put the specified prims to sleep.

omni.replicator.core.functional.physics.wake_up(
prims: Prim | usdrt.Usd.Prim | List[Prim | usdrt.Usd.Prim],
) None#

Wake up the specified prims.

omni.replicator.core.functional.physics.create_camera_collision_prims(
camera_prim: Path | Prim | usdrt.Usd.Prim | usdrt.Sdf.Path,
camera_coll_radius: float = 0.02,
camera_coll_view_dist: float = 0.4,
) None#

Create camera collision prims for the specified camera prim.

Creates two collision primitives - a sphere around the camera position and a cone extending in front of the camera view direction. The sphere prevents objects from getting too close to the camera while the cone keeps the camera’s view path clear of obstacles.

The sphere radius and cone length can be customized via the camera_coll_radius and camera_coll_view_dist parameters respectively. The cone has a fixed angle that provides reasonable coverage of the camera’s view frustum.

The collision primitives are created as invisible meshes parented under the camera.

Parameters:
  • camera_prim – The camera prim to create collision prims for.

  • camera_coll_radius – The radius in meters around the camera that must be free of collisions.

  • camera_coll_view_dist – The distance in meters in front of the camera that must be free of collisions.

Randomizer#

omni.replicator.core.functional.randomizer.scatter_2d(
prims: Prim | usdrt.Usd.Prim | List[Prim | usdrt.Usd.Prim],
surface_prims: Prim | usdrt.Usd.Prim | List[Prim | usdrt.Usd.Prim],
no_collision_prims: Prim | usdrt.Usd.Prim | List[Prim | usdrt.Usd.Prim] = None,
extents: Tuple[Tuple[float, float, float], Tuple[float, float, float]] = None,
offset: float = 0.0,
check_for_collisions: bool = False,
rng: Generator = None,
) None#

Scatter the prims in 2D space.

Parameters:
  • prims – The prims to scatter.

  • surface_prims – The surface prims to sample points from.

  • no_collision_prims – Existing prim(s) to prevent collisions with - if any prims are passed they will be checked for collisions which may slow down compute, regardless if check_for_collisions is True or False.

  • extents – The 3D extents of the sampling volume.

  • offset – The distance the prims should be offset along the normal of the surface of the mesh.

  • check_for_collisions – Whether the scatter operation should ensure that objects are not intersecting

  • rng – The random number generator to use. If None, a new generator will be created using np.random.default_rng().

Example

>>> import omni.replicator.core.functional as F
>>> import omni.replicator.core as rep
>>> rng = rep.rng.ReplicatorRNG()
>>> surface_prim = F.create.plane(name="surface_prim", position=(0, 0, 0), scale=(10, 1, 10))
>>> prims = F.create_batch.cube(count=10, position=(0, 0, 0), scale=(1, 1, 1))
>>> F.randomizer.scatter_2d(prims, surface_prim, rng=rng)
omni.replicator.core.functional.randomizer.scatter_3d(
prims: Prim | usdrt.Usd.Prim | List[Prim | usdrt.Usd.Prim],
volume_prims: Prim | usdrt.Usd.Prim | List[Prim | usdrt.Usd.Prim] = None,
no_collision_prims: Prim | usdrt.Usd.Prim | List[Prim | usdrt.Usd.Prim] = None,
volume_excl_prims: Prim | usdrt.Usd.Prim | List[Prim | usdrt.Usd.Prim] = None,
extents: Tuple[Tuple[float, float, float], Tuple[float, float, float]] = None,
check_for_collisions: bool = False,
prevent_vol_overlap: bool = True,
viz_sampled_voxels: bool = False,
resolution_scaling: float = 1.0,
input_voxel_size: float = 0.0,
rng: Generator = None,
) None#

Scatter the prims in 3D space.

Parameters:
  • prims – The prims to scatter.

  • volume_prims – The volume prims to sample points from.

  • no_collision_prims – Existing prim(s) to prevent collisions with - if any prims are passed they will be checked for collisions using rejection sampling. This may slow down compute, regardless if check_for_collisions is True/False.

  • volume_excl_prims – Prim(s) from which to exclude from sampling. Must have watertight meshes. Similar effect to no_coll_prims, but more efficient and less accurate. Rather than performing rejection sampling based on collision with the provided volume (as no_coll_prims does), this prunes off the voxelized sampling space enclosed by volume_excl_prims so the rejection rate is 0 because it never tires to sample in the excluded space. However, some objects may get sampled very close to the edge of a mesh in volume_excl_prims, where the sampled root point is outside volume_excl_prims but parts of the mesh extend to overlap the space. To get the best of both worlds, you can pass the same volume prim to both no_coll_prims and to volume_excl_prims, providing a high accuracy and a low rejection rate.

  • extents – The extents of the sampling volume.

  • check_for_collisions – Whether the scatter operation should ensure that sampled objects are not intersecting.

  • prevent_vol_overlap – If True, prevents double sampling even when multiple enclosing volumes overlap, so that the entire enclosed volume is sampled uniformly. If False, it allows overlapped sampling with higher density in overlapping areas.

  • viz_sampled_voxels – If True, creates semi-transparent green cubes in all voxels in the scene that the input prim positions are sampled from.

  • resolution_scaling – Amount the default voxel resolution used in sampling should be scaled. More complex meshes may require higher resolution. Default voxel resolution is 30 for the longest side of the mean sized volumePrim mesh provided. Higher values will ensure more fine-grained voxels, but will come at the cost of performance.

  • input_voxel_size – Voxel size used to compute the resolution. If this is provided, then resolution_scaling is ignored, otherwise (if it is 0 by default) resolution_scaling is used.

  • rng – The random number generator to use. If None, a new generator will be created using np.random.default_rng().

Example

>>> import omni.replicator.core.functional as F
>>> import omni.replicator.core as rep
>>> rng = rep.rng.ReplicatorRNG()
>>> volume_prim = F.create.torus(name="volume_prim", position=(0, 0, 0), scale=(10, 10, 10), visible=False)
>>> prims = F.create_batch.cube(count=500, position=(0, 0, 0), scale=(1, 1, 1))
>>> F.randomizer.scatter_3d(prims, volume_prim, rng=rng)

Backends#

Backend Registry#

omni.replicator.core.backends.registry.get(
name: str,
init_params: dict = None,
) BaseBackend#

Get backend from registry

Parameters:
  • name – Backend name

  • init_params – Dictionary of initialization parameters with which to initialize writer

Example
>>> import omni.replicator.core as rep
>>> class PassBackend(rep.backends.BaseBackend):
...     def __init__(self, param1):
...         pass
...     def write_blob(self, **kwargs):
...         pass
...     def read_blob(self, **kwargs):
...         pass
>>> rep.backends.register(PassBackend)
>>> backend = rep.backends.get("PassBackend", init_params={"param1": 1})
>>> backend.get_name()
'PassBackend'
omni.replicator.core.backends.registry.register(
backend: BaseBackend,
) None#

Register a backend.

Parameters:

backend – Backend to register, must be derived from BaseBackend

Example

>>> import omni.replicator.core as rep
>>> class PassBackend(rep.backends.BaseBackend):
...     def __init__(self, **kwargs):
...         pass
...     def write_blob(self, **kwargs):
...         pass
...     def read_blob(self, **kwargs):
...         pass
>>> rep.backends.register(PassBackend)
omni.replicator.core.backends.registry.unregister(
backend: str | BaseBackend,
) None#

Unregister a backend.

Parameters:

name – Name of backend to unregister

Example

>>> import omni.replicator.core as rep
>>> class PassBackend(rep.backends.BaseBackend):
...     def __init__(self, **kwargs):
...         pass
...     def write_blob(self, **kwargs):
...         pass
...     def read_blob(self, **kwargs):
...         pass
>>> rep.backends.register(PassBackend)
>>> rep.backends.unregister("PassBackend")
class omni.replicator.core.backends.BackendRegistry#

Registry of backends

Backends define how to read/write blobs of bytes data.

classmethod register_backend(
backend: BaseBackend,
) None#

Register a backend.

Parameters:

backend – Backend to register, must be derived from BaseBackend. The backend is registered under its class name.

Example

>>> import omni.replicator.core as rep
>>> class PassBackend(rep.backends.BaseBackend):
...     def __init__(self, **kwargs):
...         pass
...     def write_blob(self, **kwargs):
...         pass
...     def read_blob(self, **kwargs):
...         pass
>>> rep.backends.BackendRegistry.register_backend(PassBackend)
classmethod unregister_backend(
backend: BaseBackend,
) None#

Unregister a backend.

Parameters:

name – Name of backend to unregister

Example

>>> import omni.replicator.core as rep
>>> class PassBackend(rep.backends.BaseBackend):
...     def __init__(self, **kwargs):
...         pass
...     def write_blob(self, **kwargs):
...         pass
...     def read_blob(self, **kwargs):
...         pass
>>> rep.backends.BackendRegistry.register_backend(PassBackend)
>>> rep.backends.BackendRegistry.unregister_backend("PassBackend")
classmethod get_registered_backends() List#

Returns a list of registered backends.

Returns:

List of the names of registered backends.

Example

>>> import omni.replicator.core as rep
>>> registered_backends = rep.backends.BackendRegistry.get_registered_backends()
classmethod get_backend(
name: str,
init_params: dict = None,
) BaseBackend#

Get backend from registry

Parameters:
  • name – Backend name

  • init_params – Dictionary of initialization parameters with which to initialize writer

Example
>>> import omni.replicator.core as rep
>>> class PassBackend(rep.backends.BaseBackend):
...     def __init__(self, param1):
...         pass
...     def write_blob(self, **kwargs):
...         pass
...     def read_blob(self, **kwargs):
...         pass
>>> rep.backends.BackendRegistry.register_backend(PassBackend)
>>> backend = rep.backends.BackendRegistry.get_backend("PassBackend")
>>> backend.initialize(param1=1)
>>> backend.get_name()
'PassBackend'

IO Queue#

omni.replicator.core.backends.io_queue.is_done_writing() bool#

If the queue is empty, return True

omni.replicator.core.backends.io_queue.wait_until_done() None#

Wait until data queue is fully processed

Blocks execution until is_done_writing() == True.

omni.replicator.core.backends.io_queue.set_max_queue_size(value: int) None#

Set maximum queue size

On systems with more available memory, increasing the queue size can reduce instances where I/O bottlenecks data generation.

class omni.replicator.core.backends.sequential.Sequential(*tasks: List[Callable])#

Setup a sequence of tasks. Used to defined a sequence tasks. Tasks may be defined as lambdas, functions or classes. Calling a Sequential instance returns a partial function that can be scheduled to run on background threads. This is often desirable to avoid I/O or post processing tasks from blocking the simulation thread.

Parameters:

*tasks – List of functions representing tasks to be executed in sequence. Tasks must have compatible inputs/outputs to be sequenced together.

Note: Calling a Sequential instance returns a Python partial function.

Example 1:
>>> import omni.replicator.core.functional as F
>>> import numpy as np
>>> from functools import partial
>>> from omni.replicator.core import backends
>>> # Define function and class to go into a task sequence
>>> def pad(x, pad_value, pad_length):
...     return f"{x:{pad_value}>{pad_length}}"
>>> class add_prefix:
...     def __init__(self, prefix):
...         self.prefix = prefix
...     def __call__(self, x):
...         return f"{self.prefix}{x}"
>>> sequence_path = Sequential(
...     lambda x: x * 2,
...     partial(pad, pad_value=0, pad_length=5),
...     add_prefix("frame_"),
...     lambda x, ext="png": f"{x}.{ext}",
... )
>>> # Test sequence
>>> sequence_path(1)()
'frame_00002.png'
>>> # Setup data task sequence
>>> sequence_data = Sequential(
...     lambda x, factor=2: x * factor,
...     lambda x, offset=10: x + offset,
... )
>>> # Test sequence
>>> seq_partial = sequence_data(np.ones(1))
>>> type(seq_partial)
<class 'functools.partial'>
>>> seq_partial()
array([12.])
>>> # Setup Backend
>>> backend_abs = backends.BackendDispatch(output_dir="_out")
>>> test_frame_num = 5
>>> test_data = np.ones((100, 100, 4))
>>> backend_abs.schedule(F.write_image, path=sequence_path(test_frame_num), data=sequence_data(test_data))

For more complex operations, sequenced tasks can accept and return tuples or dictionaries to further parameterize downstream tasks. Note that sequenced funtions should return and ingest the same arguments to be compatible with each other.

Example 2:
>>> import omni.replicator.core.functional as F
>>> import numpy as np
>>> from omni.replicator.core import backends
>>> # Define functions to go into a task sequence
>>> def add_empty_suffix(path, data):
...     import os   # import goes here as it will go out of scope on execution
...     if data.sum() == 0:
...         path_og, ext = os.path.splitext(path)
...         path = f"{path_og}_empty{ext}"
...     return path, data
>>> def empty_data_message(path, data):
...     if data.sum() == 0:
...         print(f"Writing empty image of size {data.shape} to {path}")
...     return {"path": path, "data": data}
>>> sequence_write_image = backends.Sequential(
...     add_empty_suffix,
...     empty_data_message,
...     F.write_image,
... )
>>> # Test sequence
>>> sequence_write_image("path/to/image.png", np.zeros((10, 10, 3)))()
Writing empty image of size (10, 10, 3) to path/to/image_empty.png
>>> # Setup Backend
>>> backend_abs = backends.BackendDispatch(output_dir="_out")
>>> test_path = "exr_data.exr"
>>> test_data = np.zeros((10, 10, 3), dtype=np.float32)
>>> backend_abs.schedule(sequence_write_image, path=test_path, data=test_data)
execute(
*args,
backend_instance=None,
**kwargs,
) Any#

Executes sequence of tasks with specified parameters

Parameters:
  • backend_instance – Optionally specify the backend to use. This parameter is automatically provided when called from a <backend>.schedule() call.

  • *args – Optional positional parameters.

  • **kwargs – Optional keyword parameters.

Default Backends#

class omni.replicator.core.backends.BaseBackend#

Backend abstract class

Backends define how to write and read data. Backends define a write_blob function that defines how to write bytes to a specified path and a read_blob function that defines how to read bytes from a path.

Note: While backends are most often used to write data, they can also be used to stream data or process data in some

other way.

abstract write_blob(path: str, data: bytes) None#
abstract read_blob(path: str) bytes#
classmethod get_name() str#

Get backend name

schedule(fn: Callable, *args, **kwargs) None#

Schedule a task to be executed asynchronously

Append a task to a data queue that will be executed by multithreaded workers at a later time. This is often desirable so as to avoid bottlenecking the simulation thread with I/O tasks.

Note: Because scheduled tasks are not executed immediately, special care must be given to manage the lifetime

of passed objects.

Parameters:
  • fn – Task function to be performed asynchronously.bind

  • *args – Positional arguments to parametrize task.

  • **kwargs – Keyword arguments to parametrize task.

static is_done_writing() bool#

Check if all scheduled tasks are complete

Returns:

True if data queue is empty, False otherwise.

static wait_until_done() None#

Wait until all scheduled tasks are complete

initialize(*args, **kwargs) None#

Initialize the backend

class omni.replicator.core.backends.DiskBackend(output_dir: str, overwrite: bool = True)#

Disk writing backend

Backend to write data to disk to a specified output directory.

Parameters:
  • output_dir – Root output directory. If specified as a relative path, output will be relative to the path specified by the setting /omni/replicator/backends/disk/root_dir. If no root directory is specified, the root_dir is specified as <home_dir>/omni.replicator_out.

  • overwrite – If True, overwrite existing folder of the same output path. If False, a suffix in the format of _000N is added to the output directory name, where N is the next available number. Defaults to True.

static read_blob(path) bytes#

Return blob of bytes

Parameters:

path – Path of file to read.

Returns:

Bytes data.

resolve_path(path: str) str#

Join path to output directory

Parameters:

path – Partial path to resolve with output_dir

Returns:

Full file path

static write_blob(path: str, data: bytes) None#

Write blob to disk (uninitialized backend) Write blob to disk at specified path with uninitialized backend.

Parameters:
  • path – Path to write data to. If specified as a relative path, output will be relative to the path specified by the setting /omni/replicator/backends/disk/root_dir. If no root directory is specified, the root_dir is specified as <home_dir>/omni.replicator_out.

  • data – Data to write to disk.

class omni.replicator.core.backends.S3Backend(
bucket: str,
key_prefix: str,
region: str = None,
endpoint_url: str = None,
overwrite: bool = False,
)#

Writer backend for saving generated data to an S3 bucket.

This backend requires that AWS credentials are set up in ~/.aws/credentials or the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables be defined. See https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html

Parameters:
  • key_prefix – Prefix path within S3 bucket. When calling write_blob or read_blob, key_prefix is joined to the path argument of either methods to produce the full Key denoting the file location in the bucket.

  • bucket – S3 bucket name. Bucket must follow naming rules: https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html

  • region – Optionally specify S3 Region name (eg. us-east-2)

  • endpoint_url – Optionally specify S3 endpoint URL (eg. s3.us-east-2.amazonaws.com)

  • overwrite – If True, overwrite existing key_prefix path. If False, a suffix in the format of _000N is added to the key_prefix name, where N is the next available number. Defaults to False.

write_blob(path: str, data: bytes) None#

Upload a file to the S3 bucket

Parameters:
  • path – Filepath to upload

  • data – Data to upload

Returns:

True if file was uploaded, else False

read_blob(path: str) bytes#

Read file data from S3 bucket

Parameters:

path – Path in bucket (S3 Key) to read data from.

Returns:

Buffer of data

class omni.replicator.core.backends.BackendGroup(
backends: List[BaseBackend],
)#

Group multiple backends Group multiple backends to write data to multiple end points simultaneously. For example, you may want to stream data to a robot and also write the data to local disk as a backup or to create an offline dataset.

Parameters:

backends – List of backends to group together.

schedule(fn: Callable, *args, **kwargs)#

Schedule a task to be executed asynchronously

Append a task to a data queue that will be executed by multithreaded workers at a later time. This is often desirable so as to avoid bottlenecking the simulation thread with I/O tasks.

Note: Because scheduled tasks are not executed immediately, special care must be given to manage the lifetime

of passed objects.

Parameters:
  • fn – Task function to be performed asynchronously.bind

  • *args – Positional arguments to parametrize task.

  • **kwargs – Keyword arguments to parametrize task.

read_blob(path: str) bytes#

Read data Read blob will try to read from the given path with each backend and return the first successful payload.

Parameters:

path – Data path to read from

write_blob(path: str, data: bytes) None#

Schedule a write data blob task Legacy function. Schedule to write data blob with each dispatcher backend.

Parameters:
  • path (str) – Path to write data to.

  • data – Data to write.

Replicator Utils#

omni.replicator.core.utils.compute_aabb(
bbox_cache: BBoxCache,
prim: str,
include_children: bool = True,
) array#

Compute an AABB for a given prim_path, a combined AABB is computed if include_children is True

Parameters:
  • bbox_cache (UsdGeom.BboxCache) – Existing Bounding box cache to use for computation

  • prim_path (UsdPrim) – prim to compute AABB for

  • include_children (bool, optional) – include children of specified prim in calculation. Defaults to True.

Returns:

Bounding box for this prim, [min x, min y, min z, max x, max y, max z]

Return type:

np.array

omni.replicator.core.utils.create_node(
node_type_id: str,
graph: omni.graph.core.Graph = None,
node_name=None,
input_prims=None,
**kwargs,
)#

Helper function to create a replicator node of type node_type_id

Parameters:
  • node_type_id – Node type ID

  • graph – Optionally specify the graph onto which to create node

  • kwargs – Node attributes can optionally be set by specifying them as kwargs

omni.replicator.core.utils.find_prims(
prim_paths: List[Path | str],
mode: str = 'instances',
) List[Prim]#

Find prims based on specified mode

Parameters:
  • prim_paths – List of paths to prims in the current stage

  • mode

    Choose from one of the following modes:[‘prims’, ‘prototypes’, ‘materials’, ‘meshes’, ‘instances’], defaults to “instances”.

    • prims - Returns the prims corresponding to the paths in prim_paths.

    • prototypes - Returns the prims corresponding to the paths in prim_paths and parses point instancers to retreive its prototypes.

    • meshes - Traverse through the prims in prim_paths and return all meshes and geomsubsets.

    • materials - Traverse through the prims in prim_paths and return all bound materials.

Raises:

ValueError – Invalid mode choice

Returns:

List of Usd prim objects

omni.replicator.core.utils.get_files_group(
folder_path: str,
file_suffixes: List[str] = None,
ignore_case: bool = True,
file_type: str = 'png',
) List[dict]#

Retrieve all the files in a folder and group them based on the suffixes.

Parameters:
  • folder_path – The folder where to search.

  • file_prefix – The prefix to filter the files by.

  • file_type – The texture file type.

Returns:

<filepath>,}).

Return type:

A list of tuples with each tuple of the format (<prefix>, {<suffix>

omni.replicator.core.utils.get_graph(graph_path: str = None, is_hidden: bool = False)#

Get or create the replicator graph

Retrieve a graph at specified path. If no graph exists, an execution (aka action) graph in the SIMULATION stage is created. If no graph_path is specified, use /Replicator/SDGPipeline.

Parameters:
  • graph_path – Path to which graph is created.

  • is_hidden – If True, hide created graph in Stage panel. Ignored if graph already exists.

omni.replicator.core.utils.get_node_targets(
node: omni.graph.core.Node,
attribute: str,
replicatorXform: bool = True,
) List[str]#

Get node targets from prims bundle - DEPRECATED

This function provided a convenient way to retrieve targets from a node attribute and is now deprecated. Use get_non_xform_prims for similar functionality.

Parameters:
  • node – Node from which to get targets

  • attribute – Attribute name

  • replicatorXform – If False and a target has the attribute replicatorXform, return its leaf children.

omni.replicator.core.utils.get_non_xform_prims(
prim_paths: List[Path | str],
usd_usdrt: bool = False,
) List[str]#

Return non-xform prim paths

For each prim_path specified, return its child prim if it has the replicatorXform attribute.

Parameters:
  • prim_paths – list of prim paths

  • usd_usdrt – If True, use UsdRT functions, otherwise use PXR functions.

omni.replicator.core.utils.get_prim_variant_values(
prim_path: str | Path,
variant_name: str,
) List[str]#
omni.replicator.core.utils.get_prims_from_paths(
prim_paths: Path | str,
) List[Prim]#

Convert prim paths to prim objects

Parameters:

prim_paths – list of prim paths

omni.replicator.core.utils.get_replicator_graph_exists() bool#
omni.replicator.core.utils.get_usd_files(
path: str,
recursive: bool = False,
path_filter: str = None,
) List[str]#

Retrieve a list of USD files at the provided path

Parameters:
  • path – Path or URL to search from.

  • recursive – If True, recusively search through sub-directories.

  • path_filter – Optional regex filter to refine the search.

omni.replicator.core.utils.read_prim_transform(prim_ref: Prim)#

Return the prim’s local to world transform for current time

Parameters:

prim_ref – Prim to compute transform for

omni.replicator.core.utils.send_og_event(event_name: str) None#

Send an OmniGraph event that can be received by the omni.graph.action.OnCustomEvent node.

Sends an empty payload to signal the omni.graph.action.OnCustomEvent node to activate

Parameters:

event_name – Name of the omnigraph event to send. The event name sent is always in the format omni.graph.action.{event_name}.

omni.replicator.core.utils.set_target_prims(
node: omni.graph.core.Node,
attribute: omni.graph.core.Attribute,
target_prims: List[ReplicatorItem | omni.graph.core.Node | str],
)#

Set node targets to attribute

This function provides a convenient way to set targets to a node attribute, and will be deprecated once multi-prim node attributes are supported.

Parameters:
  • node – Node to which to set targets

  • attribute – Attribute name

  • target_prims – Targets to attach to attribute

Settings#

omni.replicator.core.settings.carb_settings(
setting: str,
value: List | float | ReplicatorItem,
) ReplicatorItem#

Set a specific carb setting

Carb settings are settings controlling anything from render parameters to specific extension behaviours. Any of these can be controlled and randomized through Replicator. Because settings can be introduced and removed by extensions, an providing an exhaustive list of available settings is not possible. Below you will find a subset of settings that may be useful for SDG workflows:

Common Render Settings:

See https://docs.omniverse.nvidia.com/materials-and-rendering/latest/rtx-renderer_common.html

RealTime Render Settings:

See https://docs.omniverse.nvidia.com/materials-and-rendering/latest/rtx-renderer_rt.html

PathTracing Render Settings:

See https://docs.omniverse.nvidia.com/materials-and-rendering/latest/rtx-renderer_pt.html

PostProcess Render Settings:

See https://docs.omniverse.nvidia.com/materials-and-rendering/latest/rtx_post-processing.html

Replicator Settings:
  • /omni/replicator/captureMotionBlur (bool): Capture a motion blur effect. In RealTime render mode, this is equivalent to enabling /rtx/post/motionblur/enabled. In Pathtrace mode, a timestep is split into N subframes where N is equal to /rtx/pathtracing/totalSpp.

  • /omni/replicator/pathTracedMotionBlurSubSamples (float): Number of sub samples to render if in PathTracing render mode and motion blur is enabled.

  • /omni/replicator/totalRenderProductPixels (int): Number of total pixels created when calling rep.create.render_product. Used to calculate maxSamplePerLaunch inside orchestrator.py.

Parameters:
  • setting – Carb setting to modify.

  • value – Value to set the carb setting to.

Example

>>> import omni.replicator.core as rep
>>> # Randomize film grain post process effect
>>> tv_noise = rep.settings.carb_settings("/rtx/post/tvNoise/enabled", True)
>>> with rep.trigger.on_frame():
...     flicker = rep.settings.carb_settings(
...         "/rtx/post/tvNoise/enableGhostFlickering",
...         rep.distribution.choice([True, False]),
...     )
...     grain_size = rep.settings.carb_settings(
...         "/rtx/post/tvNoise/grainSize",
...         rep.distribution.uniform(1.5, 5.0),
...     )
omni.replicator.core.settings.set_render_pathtraced(
samples_per_pixel: int | ReplicatorItem = 64,
) None#

Setup PathTraced render mode

Parameters:

samples_per_pixel – Select the total number of samples to sample for each pixel per frame. Valid range [1, inf]

Example

>>> import omni.replicator.core as rep
>>> rep.settings.set_render_pathtraced(samples_per_pixel=512)
omni.replicator.core.settings.set_render_rtx_realtime(
antialiasing: str | ReplicatorItem = 'FXAA',
) None#

Setup RTX Realtime render mode

Parameters:

antialiasing – Antialiasing algorithm. Select from [Off, FXAA, DLSS, TAA, DLAA]. FXAA is recommended for non-sequential data generation as it does not accumulate samples across frames.

Example

>>> import omni.replicator.core as rep
>>> rep.settings.set_render_rtx_realtime(antialiasing="DLSS")
omni.replicator.core.settings.set_stage_meters_per_unit(meters_per_unit: float) None#

Set up the meters per unit for the stage.

Parameters:

meters_per_unit – Set the stage meters per unit value.

Example

>>> import omni.replicator.core as rep
>>> rep.settings.set_stage_meters_per_unit(1.0)
omni.replicator.core.settings.set_stage_up_axis(up_axis: str) None#

Set the up axis of the stage

Parameters:

up_axis – Specify stage up axis. Select from [Y, Z]

Example

>>> import omni.replicator.core as rep
>>> rep.settings.set_stage_up_axis("Z")