PYTHON API
Core Functions
- 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.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.get_global_seed()
Return global seed value
- Returns
(int)seed value
Create
- omni.replicator.core.create.group(items: List[Union[ReplicatorItem, str, Path]], semantics: List[Tuple[str, str]] = 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 – List of semantic type-label pairs.
Example
>>> import omni.replicator.core as rep >>> cones = [rep.create.cone() for _ in range(100)] >>> group = rep.create.group(cones, semantics=[("class", "cone")])
- omni.replicator.core.create.light(position: Union[ReplicatorItem, float, Tuple[float]] = None, scale: Union[ReplicatorItem, float, Tuple[float]] = None, rotation: Union[ReplicatorItem, float, Tuple[float]] = None, look_at: Union[ReplicatorItem, str, Path, usdrt.Sdf.Path, Tuple[float, float, float], List[Union[str, Path, usdrt.Sdf.Path]]] = None, look_at_up_axis: Union[ReplicatorItem, Tuple[float]] = None, light_type: str = 'Distant', color: Union[ReplicatorItem, Tuple[float, float, float]] = (1.0, 1.0, 1.0), intensity: Union[ReplicatorItem, float] = 1000.0, exposure: Union[ReplicatorItem, float] = None, temperature: Union[ReplicatorItem, float] = 6500, texture: Union[ReplicatorItem, str] = None, count: int = 1, name: str = None, parent: Union[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 RGB colorspace.
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")
- omni.replicator.core.create.render_product(camera: Union[ReplicatorItem, str, List[str], Path, List[Path]], resolution: Tuple[int, int], force_new: bool = False, name: Optional[Union[str, List[str]]] = None) Union[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.
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 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/RenderProduct_<name>’. 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 string of the same length as camera.
Example
>>> import omni.replicator.core as rep >>> render_product = rep.create.render_product(rep.create.camera(), resolution=(1024, 1024), name="MyRenderProduct")
- omni.replicator.core.create.register(fn: Callable[[...], Union[ReplicatorItem, Node]], override: bool = True, fn_name: Optional[str] = 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, specify the registration name. If not specified, the function name is used. fn_name must only contains alphanumeric letters (a-z), numbers (0-9) or underscores (_) and cannot start with a number or contain any spaces.
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)
Cameras
- omni.replicator.core.create.camera(position: Union[ReplicatorItem, float, Tuple[float]] = None, rotation: Union[ReplicatorItem, float, Tuple[float]] = None, look_at: Union[ReplicatorItem, str, Path, usdrt.Sdf.Path, Tuple[float, float, float], List[Union[str, Path, usdrt.Sdf.Path]]] = None, look_at_up_axis: Union[ReplicatorItem, Tuple[float]] = None, focal_length: Union[ReplicatorItem, float] = 24.0, focus_distance: Union[ReplicatorItem, float] = 400.0, f_stop: Union[ReplicatorItem, float] = 0.0, horizontal_aperture: Union[ReplicatorItem, float] = 20.955, horizontal_aperture_offset: Union[ReplicatorItem, float] = 0.0, vertical_aperture_offset: Union[ReplicatorItem, float] = 0.0, clipping_range: Union[ReplicatorItem, Tuple[float, float]] = (1.0, 1000000.0), projection_type: Union[ReplicatorItem, str] = 'pinhole', fisheye_nominal_width: Union[ReplicatorItem, float] = 1936.0, fisheye_nominal_height: Union[ReplicatorItem, float] = 1216.0, fisheye_optical_centre_x: Union[ReplicatorItem, float] = 970.94244, fisheye_optical_centre_y: Union[ReplicatorItem, float] = 600.37482, fisheye_max_fov: Union[ReplicatorItem, float] = 200.0, fisheye_polynomial_a: Union[ReplicatorItem, float] = 0.0, fisheye_polynomial_b: Union[ReplicatorItem, float] = 0.00245, fisheye_polynomial_c: Union[ReplicatorItem, float] = 0.0, fisheye_polynomial_d: Union[ReplicatorItem, float] = 0.0, fisheye_polynomial_e: Union[ReplicatorItem, float] = 0.0, fisheye_polynomial_f: Union[ReplicatorItem, float] = 0.0, fisheye_p0: Union[ReplicatorItem, float] = -0.00037, fisheye_p1: Union[ReplicatorItem, float] = -0.00074, fisheye_s0: Union[ReplicatorItem, float] = -0.00058, fisheye_s1: Union[ReplicatorItem, float] = -0.00022, fisheye_s2: Union[ReplicatorItem, float] = 0.00019, fisheye_s3: Union[ReplicatorItem, float] = -0.0002, count: int = 1, parent: Union[ReplicatorItem, str, Path, Prim] = None, name: str = 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, fisheye_polynomial, “fisheyeOrthographic”, “fisheyeEquidistant”, “fisheyeEquisolid”, “fisheyeSpherical”, “fisheyeKannalaBrandtK3”, “fisheyeRadTanThinPrism”].
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: Union[ReplicatorItem, float], position: Optional[Union[ReplicatorItem, float, Tuple[float]]] = None, rotation: Optional[Union[ReplicatorItem, float, Tuple[float]]] = None, look_at: Optional[Union[ReplicatorItem, str, Path, usdrt.Sdf.Path, Tuple[float, float, float], List[Union[str, Path, usdrt.Sdf.Path]]]] = None, look_at_up_axis: Optional[Union[ReplicatorItem, Tuple[float]]] = None, focal_length: Union[ReplicatorItem, float] = 24.0, focus_distance: Union[ReplicatorItem, float] = 400.0, f_stop: Union[ReplicatorItem, float] = 0.0, horizontal_aperture: Union[ReplicatorItem, float] = 20.955, horizontal_aperture_offset: Union[ReplicatorItem, float] = 0.0, vertical_aperture_offset: Union[ReplicatorItem, float] = 0.0, clipping_range: Union[ReplicatorItem, Tuple[float, float]] = (1.0, 1000000.0), projection_type: Union[ReplicatorItem, str] = 'pinhole', fisheye_nominal_width: Union[ReplicatorItem, float] = 1936.0, fisheye_nominal_height: Union[ReplicatorItem, float] = 1216.0, fisheye_optical_centre_x: Union[ReplicatorItem, float] = 970.94244, fisheye_optical_centre_y: Union[ReplicatorItem, float] = 600.37482, fisheye_max_fov: Union[ReplicatorItem, float] = 200.0, fisheye_polynomial_a: Union[ReplicatorItem, float] = 0.0, fisheye_polynomial_b: Union[ReplicatorItem, float] = 0.00245, fisheye_polynomial_c: Union[ReplicatorItem, float] = 0.0, fisheye_polynomial_d: Union[ReplicatorItem, float] = 0.0, fisheye_polynomial_e: Union[ReplicatorItem, float] = 0.0, fisheye_polynomial_f: Union[ReplicatorItem, float] = 0.0, fisheye_p0: Union[ReplicatorItem, float] = -0.00037, fisheye_p1: Union[ReplicatorItem, float] = -0.00074, fisheye_s0: Union[ReplicatorItem, float] = -0.00058, fisheye_s1: Union[ReplicatorItem, float] = -0.00022, fisheye_s2: Union[ReplicatorItem, float] = 0.00019, fisheye_s3: Union[ReplicatorItem, float] = -0.0002, count: int = 1, name: Optional[str] = None, parent: Optional[Union[ReplicatorItem, str, Path, Prim]] = None) ReplicatorItem
Create a stereo camera pair.
- Args:
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]. 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 component of fisheye polynomial (only valid for fisheye_polynomial projection type). fisheye_polynomial_b: Second component of fisheye polynomial (only valid for fisheye_polynomial projection type). fisheye_polynomial_c: Third component of fisheye polynomial (only valid for fisheye_polynomial projection type). fisheye_polynomial_d: Fourth component of fisheye polynomial (only valid for fisheye_polynomial projection type). fisheye_polynomial_e: Fifth component of fisheye polynomial (only valid for fisheye_polynomial projection type). count: Number of objects to create. name: Basename of the cameras. _L and _R will be appended for Left and Right, 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: 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: Union[ReplicatorItem, str, Path], semantics: List[Tuple[str, str]] = None, material: Union[ReplicatorItem, str, Path] = None, offset_scale: float = 0.01, input_prims: Union[ReplicatorItem, List[str]] = 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.
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: Union[ReplicatorItem, float, Tuple[float]] = None, scale: Union[ReplicatorItem, float, Tuple[float]] = None, pivot: Union[ReplicatorItem, Tuple[float]] = None, rotation: Union[ReplicatorItem, float, Tuple[float]] = None, look_at: Union[ReplicatorItem, str, Path, usdrt.Sdf.Path, Tuple[float, float, float], List[Union[str, Path, usdrt.Sdf.Path]]] = None, look_at_up_axis: Union[ReplicatorItem, Tuple[float]] = None, semantics: List[Tuple[str, str]] = None, material: Union[ReplicatorItem, Prim] = None, visible: bool = True, as_mesh: bool = True, count: int = 1, name: str = None, parent: Union[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 – List of semantic type-label pairs.
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: Union[ReplicatorItem, float, Tuple[float]] = None, scale: Union[ReplicatorItem, float, Tuple[float]] = None, pivot: Union[ReplicatorItem, Tuple[float]] = None, rotation: Union[ReplicatorItem, float, Tuple[float]] = None, look_at: Union[ReplicatorItem, str, Path, usdrt.Sdf.Path, Tuple[float, float, float], List[Union[str, Path, usdrt.Sdf.Path]]] = None, look_at_up_axis: Union[ReplicatorItem, Tuple[float]] = None, semantics: List[Tuple[str, str]] = None, material: Union[ReplicatorItem, Prim] = None, visible: bool = True, as_mesh: bool = True, count: int = 1, name: str = None, parent: Union[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 – List of semantic type-label pairs.
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: Union[ReplicatorItem, float, Tuple[float]] = None, scale: Union[ReplicatorItem, float, Tuple[float]] = None, pivot: Union[ReplicatorItem, Tuple[float]] = None, rotation: Union[ReplicatorItem, float, Tuple[float]] = None, look_at: Union[ReplicatorItem, str, Path, usdrt.Sdf.Path, Tuple[float, float, float], List[Union[str, Path, usdrt.Sdf.Path]]] = None, look_at_up_axis: Union[ReplicatorItem, Tuple[float]] = None, semantics: List[Tuple[str, str]] = None, material: Union[ReplicatorItem, Prim] = None, visible: bool = True, as_mesh: bool = True, count: int = 1, name: str = None, parent: Union[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 – List of semantic type-label pairs.
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: Union[ReplicatorItem, float, Tuple[float]] = None, scale: Union[ReplicatorItem, float, Tuple[float]] = None, pivot: Union[ReplicatorItem, Tuple[float]] = None, rotation: Union[ReplicatorItem, float, Tuple[float]] = None, look_at: Union[ReplicatorItem, str, Path, usdrt.Sdf.Path, Tuple[float, float, float], List[Union[str, Path, usdrt.Sdf.Path]]] = None, look_at_up_axis: Union[ReplicatorItem, Tuple[float]] = None, semantics: List[Tuple[str, str]] = None, material: Union[ReplicatorItem, Prim] = None, visible: bool = True, count: int = 1, name: str = None, parent: Union[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 – List of semantic type-label pairs.
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: Union[ReplicatorItem, float, Tuple[float]] = None, scale: Union[ReplicatorItem, float, Tuple[float]] = None, pivot: Union[ReplicatorItem, Tuple[float]] = None, rotation: Union[ReplicatorItem, float, Tuple[float]] = None, look_at: Union[ReplicatorItem, str, Path, usdrt.Sdf.Path, Tuple[float, float, float], List[Union[str, Path, usdrt.Sdf.Path]]] = None, look_at_up_axis: Union[ReplicatorItem, Tuple[float]] = None, semantics: List[Tuple[str, str]] = None, material: Union[ReplicatorItem, Prim] = None, visible: bool = True, count: int = 1, name: str = None, parent: Union[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 – List of semantic type-label pairs.
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: Union[ReplicatorItem, float, Tuple[float]] = None, scale: Union[ReplicatorItem, float, Tuple[float]] = None, pivot: Union[ReplicatorItem, Tuple[float]] = None, rotation: Union[ReplicatorItem, float, Tuple[float]] = None, look_at: Union[ReplicatorItem, str, Path, usdrt.Sdf.Path, Tuple[float, float, float], List[Union[str, Path, usdrt.Sdf.Path]]] = None, look_at_up_axis: Union[ReplicatorItem, Tuple[float]] = None, semantics: List[Tuple[str, str]] = None, material: Union[ReplicatorItem, Prim] = None, visible: bool = True, as_mesh: bool = True, count: int = 1, name: str = None, parent: Union[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 – List of semantic type-label pairs.
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: Union[ReplicatorItem, float, Tuple[float]] = None, scale: Union[ReplicatorItem, float, Tuple[float]] = None, pivot: Union[ReplicatorItem, Tuple[float]] = None, rotation: Union[ReplicatorItem, float, Tuple[float]] = None, look_at: Union[ReplicatorItem, str, Path, usdrt.Sdf.Path, Tuple[float, float, float], List[Union[str, Path, usdrt.Sdf.Path]]] = None, look_at_up_axis: Union[ReplicatorItem, Tuple[float]] = None, semantics: List[Tuple[str, str]] = None, material: Union[ReplicatorItem, Prim] = None, visible: bool = True, count: int = 1, name: str = None, parent: Union[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 – List of semantic type-label pairs.
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: Union[ReplicatorItem, float, Tuple[float]] = None, scale: Union[ReplicatorItem, float, Tuple[float]] = None, rotation: Union[ReplicatorItem, float, Tuple[float]] = None, look_at: Union[ReplicatorItem, str, Path, usdrt.Sdf.Path, Tuple[float, float, float], List[Union[str, Path, usdrt.Sdf.Path]]] = None, look_at_up_axis: Union[ReplicatorItem, Tuple[float]] = None, semantics: List[Tuple[str, str]] = None, visible: bool = True, count: int = 1, name: str = None, parent: Union[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 – 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")], ... )
USD
- omni.replicator.core.create.from_dir(dir_path: str, recursive: bool = False, path_filter: Optional[str] = None, semantics: Optional[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 – List of semantic type-label pairs.
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, semantics: List[Tuple[str, str]] = None, count: int = 1) ReplicatorItem
Reference a USD into the current USD stage.
- Parameters
usd – Path to a usd file (*.usd, *.usdc, *.usda)
semantics – List of semantic type-label pairs.
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: Union[List[Tuple[str, str]], Tuple[str, str]] = None, semantics_exclusion: Union[List[Tuple[str, str]], Tuple[str, str]] = None, cache_result: bool = True) 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
- omni.replicator.core.get.curve(path_pattern: str = None, path_pattern_exclusion: str = None, semantics: Union[List[Tuple[str, str]], Tuple[str, str]] = None, semantics_exclusion: Union[List[Tuple[str, str]], Tuple[str, str]] = None, cache_result: bool = True) 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
- omni.replicator.core.get.geomsubset(path_pattern: str = None, path_pattern_exclusion: str = None, semantics: Union[List[Tuple[str, str]], Tuple[str, str]] = None, semantics_exclusion: Union[List[Tuple[str, str]], Tuple[str, str]] = None, cache_result: bool = True) 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
- omni.replicator.core.get.graph(path_pattern: str = None, path_pattern_exclusion: str = None, semantics: Union[List[Tuple[str, str]], Tuple[str, str]] = None, semantics_exclusion: Union[List[Tuple[str, str]], Tuple[str, str]] = None, cache_result: bool = True) 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
- omni.replicator.core.get.light(path_pattern: str = None, path_pattern_exclusion: str = None, semantics: Union[List[Tuple[str, str]], Tuple[str, str]] = None, semantics_exclusion: Union[List[Tuple[str, str]], Tuple[str, str]] = None, cache_result: bool = True) 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
- omni.replicator.core.get.listener(path_pattern: str = None, path_pattern_exclusion: str = None, semantics: Union[List[Tuple[str, str]], Tuple[str, str]] = None, semantics_exclusion: Union[List[Tuple[str, str]], Tuple[str, str]] = None, cache_result: bool = True) 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
- omni.replicator.core.get.material(path_pattern: str = None, path_pattern_exclusion: str = None, semantics: Union[List[Tuple[str, str]], Tuple[str, str]] = None, semantics_exclusion: Union[List[Tuple[str, str]], Tuple[str, str]] = None, cache_result: bool = True) 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
- omni.replicator.core.get.mesh(path_pattern: str = None, path_pattern_exclusion: str = None, semantics: Union[List[Tuple[str, str]], Tuple[str, str]] = None, semantics_exclusion: Union[List[Tuple[str, str]], Tuple[str, str]] = None, cache_result: bool = True) 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
- omni.replicator.core.get.physics(path_pattern: str = None, path_pattern_exclusion: str = None, semantics: Union[List[Tuple[str, str]], Tuple[str, str]] = None, semantics_exclusion: Union[List[Tuple[str, str]], Tuple[str, str]] = None, cache_result: bool = True) 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
- omni.replicator.core.get.prim_at_path(path: Union[str, List[str], ReplicatorItem]) ReplicatorItem
Get the prim at the exact path
- Parameters
path – USD path to the desired prim. Defaults to None.
- omni.replicator.core.get.prims(path_pattern: str = None, path_match: str = None, path_pattern_exclusion: str = None, prim_types: Union[str, List[str]] = None, prim_types_exclusion: Union[str, List[str]] = None, semantics: Union[List[Tuple[str, str]], Tuple[str, str]] = None, semantics_exclusion: Union[List[Tuple[str, str]], Tuple[str, str]] = None, cache_result: bool = True, ignore_case: bool = True) 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
- omni.replicator.core.get.renderproduct(path_pattern: str = None, path_pattern_exclusion: str = None, semantics: Union[List[Tuple[str, str]], Tuple[str, str]] = None, semantics_exclusion: Union[List[Tuple[str, str]], Tuple[str, str]] = None, cache_result: bool = True) 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
- omni.replicator.core.get.rendervar(path_pattern: str = None, path_pattern_exclusion: str = None, semantics: Union[List[Tuple[str, str]], Tuple[str, str]] = None, semantics_exclusion: Union[List[Tuple[str, str]], Tuple[str, str]] = None, cache_result: bool = True) 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
- omni.replicator.core.get.scope(path_pattern: str = None, path_pattern_exclusion: str = None, semantics: Union[List[Tuple[str, str]], Tuple[str, str]] = None, semantics_exclusion: Union[List[Tuple[str, str]], Tuple[str, str]] = None, cache_result: bool = True) 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
- omni.replicator.core.get.shader(path_pattern: str = None, path_pattern_exclusion: str = None, semantics: Union[List[Tuple[str, str]], Tuple[str, str]] = None, semantics_exclusion: Union[List[Tuple[str, str]], Tuple[str, str]] = None, cache_result: bool = True) 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
- omni.replicator.core.get.shape(path_pattern: str = None, path_pattern_exclusion: str = None, semantics: Union[List[Tuple[str, str]], Tuple[str, str]] = None, semantics_exclusion: Union[List[Tuple[str, str]], Tuple[str, str]] = None, cache_result: bool = True) 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
- omni.replicator.core.get.skelanimation(path_pattern: str = None, path_pattern_exclusion: str = None, semantics: Union[List[Tuple[str, str]], Tuple[str, str]] = None, semantics_exclusion: Union[List[Tuple[str, str]], Tuple[str, str]] = None, cache_result: bool = True) 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
- omni.replicator.core.get.skeleton(path_pattern: str = None, path_pattern_exclusion: str = None, semantics: Union[List[Tuple[str, str]], Tuple[str, str]] = None, semantics_exclusion: Union[List[Tuple[str, str]], Tuple[str, str]] = None, cache_result: bool = True) 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
- omni.replicator.core.get.sound(path_pattern: str = None, path_pattern_exclusion: str = None, semantics: Union[List[Tuple[str, str]], Tuple[str, str]] = None, semantics_exclusion: Union[List[Tuple[str, str]], Tuple[str, str]] = None, cache_result: bool = True) 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
- omni.replicator.core.get.xform(path_pattern: str = None, path_pattern_exclusion: str = None, semantics: Union[List[Tuple[str, str]], Tuple[str, str]] = None, semantics_exclusion: Union[List[Tuple[str, str]], Tuple[str, str]] = None, cache_result: bool = True) 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
- omni.replicator.core.get.register(fn: Callable[[...], Union[ReplicatorItem, Node]], override: bool = True, fn_name: Optional[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
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, specify the registration name. If not specified, the function name is used. fn_name must only contains alphanumeric letters (a-z), numbers (0-9) or underscores (_) and cannot start with a number or contain any spaces.
Distribution
- omni.replicator.core.distribution.choice(choices: List[str], weights: List[float] = None, num_samples: Union[ReplicatorItem, int] = 1, seed: Optional[int] = -1, with_replacements: bool = True, name: Optional[str] = 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. IfFalse
, 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[Union[ReplicatorItem, Tuple[ReplicatorItem]]], name: Optional[str] = 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: Optional[int] = None, name: Optional[str] = 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: Optional[int] = None, name: Optional[str] = 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: Union[List, ReplicatorItem], ordered: Optional[bool] = True, seed: Optional[int] = -1, name: Optional[str] = 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: Optional[int] = None, name: Optional[str] = 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[[...], Union[ReplicatorItem, Node]], override: bool = True, fn_name: Optional[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 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, specify the registration name. If not specified, the function name is used. fn_name must only contains alphanumeric letters (a-z), numbers (0-9) or underscores (_) and cannot start with a number or contain any spaces.
Modify
- omni.replicator.core.modify.animation(values: Union[ReplicatorItem, List[str], List[Path], List[usdrt.Sdf.Path]], reset_timeline: bool = False, input_prims: Union[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: Union[Any, ReplicatorItem], attribute_type: str = None, input_prims: Union[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: Union[ReplicatorItem, List[str]] = None, input_prims: Union[ReplicatorItem, List[str]] = None) ReplicatorItem
Modify the material bound to 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.
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: Union[ReplicatorItem, float, Tuple[float]] = None, position_x: Union[ReplicatorItem, float] = None, position_y: Union[ReplicatorItem, float] = None, position_z: Union[ReplicatorItem, float] = None, rotation: Union[ReplicatorItem, float, Tuple[float]] = None, rotation_x: Union[ReplicatorItem, float] = None, rotation_y: Union[ReplicatorItem, float] = None, rotation_z: Union[ReplicatorItem, float] = None, rotation_order: str = 'XYZ', scale: Union[ReplicatorItem, float, Tuple[float]] = None, size: Union[ReplicatorItem, float, Tuple[float]] = None, pivot: Union[ReplicatorItem, Tuple[float]] = None, look_at: Union[ReplicatorItem, str, Path, usdrt.Sdf.Path, Tuple[float, float, float], List[Union[str, Path, usdrt.Sdf.Path]]] = None, look_at_up_axis: Union[str, Tuple[float, float, float]] = None, input_prims: Union[ReplicatorItem, List[str]] = None) ReplicatorItem
Modify the position, rotation, scale, and/or look-at target of the prims specified in input_prims.
NOTE: position and any of (position_x, position_y and position_z) cannot both be specified.
NOTE: position and (position_x or position_y or position_z) cannot both be specified.
NOTE: rotation and look_at cannot both be specified.
NOTE: size and scale cannot both be specified.
NOTE: 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.
- 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.
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: Union[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: Union[ReplicatorItem, Tuple[float, float, float], str], distance: Union[ReplicatorItem, float], azimuth: Union[ReplicatorItem, float], elevation: Union[ReplicatorItem, float], look_at_barycentre: bool = True, input_prims: Optional[Union[ReplicatorItem, List[str]]] = None) 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: Union[ReplicatorItem, List[str]] = None, rotation: Union[ReplicatorItem, List[str]] = None, scale: Union[ReplicatorItem, List[str]] = None, texture_group: Union[ReplicatorItem, List[str]] = None, diffuse: Union[ReplicatorItem, List[str]] = None, normal: Union[ReplicatorItem, List[str]] = None, roughness: Union[ReplicatorItem, List[str]] = None, metallic: Union[ReplicatorItem, List[str]] = None, input_prims: Union[ReplicatorItem, List[str]] = None) 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.
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: List[Tuple[str, str]] = None, input_prims: Union[ReplicatorItem, List[str]] = None, mode: str = 'add') ReplicatorItem
Add semantics to the target prims
- Parameters
semantics – TYPE,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: Union[List[str], ReplicatorItem], input_prims: Union[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: Union[ReplicatorItem, List[bool], bool] = None, input_prims: Union[ReplicatorItem, List[str]] = None) ReplicatorItem
Modify the visibility of prims
- Parameters
value – True, False. A list of [True, False] 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.
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[[...], Union[ReplicatorItem, Node]], override: bool = True, fn_name: Optional[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, specify the registration name. If not specified, the function name is used. fn_name must only contains alphanumeric letters (a-z), numbers (0-9) or underscores (_) and cannot start with a number or contain any spaces.
Time
- omni.replicator.core.modify.time(value: Union[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: Union[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: Union[ReplicatorItem, List[Tuple[float]]], per_sub_mesh: bool = False, seed: int = None, input_prims: Union[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: Union[ReplicatorItem, List[str]], size: Union[ReplicatorItem, int], weights: List[float] = None, mode: str = 'scene_instance', with_replacements=True, seed: int = None, use_cache: bool = True) 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 Instances are 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.
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.
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: Union[ReplicatorItem, List[str]], seed: int = None, input_prims=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.
input_prims – The prims to be modified. If using with syntax, this argument can be omitted.
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: Union[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: Union[ReplicatorItem, List[str]], no_coll_prims: Union[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: Union[ReplicatorItem, List[str]] = 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/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.
input_prims – The prims to be modified. If using with syntax, this argument can be omitted.
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: Union[ReplicatorItem, List[str]] = None, no_coll_prims: Union[ReplicatorItem, List[str]] = None, volume_excl_prims: Union[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, seed: int = None, input_prims: Union[ReplicatorItem, List[str]] = 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 zero 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.
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 >>> 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: Union[ReplicatorItem, List[str]], texture_scale: Union[ReplicatorItem, List[Tuple[float, float]]] = None, texture_rotate: Union[ReplicatorItem, List[int]] = None, per_sub_mesh: bool = False, project_uvw: bool = False, seed: int = None, input_prims: Union[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[[...], Union[ReplicatorItem, Node]], override: bool = True, fn_name: Optional[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.
fn_name – An optional arg that let user choose the function name when registering it in replicator.
override – If True, will override existing functions of the same name. If false, an error is raised.
fn_name – Optional, specify the registration name. If not specified, the function name is used. fn_name must only contains alphanumeric letters (a-z), numbers (0-9) or underscores (_) and cannot start with a number or contain any spaces.
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, input_prims: Union[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.
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: Union[ReplicatorItem, float] = 0.0, damping: Union[ReplicatorItem, float] = 0.0, input_prims: Union[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: Optional[float] = None, density: Optional[float] = None, center_of_mass: Optional[List] = None, diagonal_inertia: Optional[List] = None, principal_axes: Optional[List] = None, input_prims: Union[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: Union[ReplicatorItem, float] = None, dynamic_friction: Union[ReplicatorItem, float] = None, restitution: Union[ReplicatorItem, float] = None, input_prims: Union[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: Union[ReplicatorItem, Tuple[float, float, float]] = (0.0, 0.0, 0.0), angular_velocity: Union[ReplicatorItem, Tuple[float, float, float]] = (0.0, 0.0, 0.0), contact_offset: float = None, rest_offset: float = None, input_prims: Union[ReplicatorItem, List] = None) None
- Randomizes the velocity and angular velocity of the prims specified in input_prims. If they do not have
the RigidBody API 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.
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.scripts.annotators.get(name: str, init_params: Optional[dict] = None, render_product_idxs: Optional[List[int]] = None, device: Optional[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 th writer. Defaults to True.
- omni.replicator.core.scripts.annotators.get_augmentation(name: str) Augmentation
Get Augmentation from registry
- Parameters
name – Name of augmentation to retrieve from registry
- omni.replicator.core.scripts.annotators.get_registered_annotators() List[str]
Returns a list names of registered annotators.
- Returns
List of registered annotators.
- omni.replicator.core.scripts.annotators.register(name: str, annotator: Union[Annotator, str]) None
Register annotator
- Parameters
name – Name under which to register annotator
annotator – Annotator to be registered
- omni.replicator.core.scripts.annotators.register_augmentation(name: str, augmentation: Union[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.scripts.annotators.unregister_augmentation(name: str) None
Unregister a registered augmentation
- Parameters
name – Name of augmentation to unregister
- class omni.replicator.core.scripts.annotators.Annotator(name: str, init_params: Optional[dict] = None, render_product_idxs: Optional[List[int]] = None, device: Optional[str] = None, render_products: Optional[list] = None, template_name: Optional[str] = None, do_array_copy: bool = True)
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 – If set, attach annotator to 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 th writer. Defaults to True.
- __init__(name: str, init_params: Optional[dict] = None, render_product_idxs: Optional[List[int]] = None, device: Optional[str] = None, render_products: Optional[list] = None, template_name: Optional[str] = None, do_array_copy: bool = True) 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
- attach(render_products: Union[str, HydraTexture, List[Union[str, HydraTexture]]], render_product_idxs: Optional[List[int]] = None) None
Attach annotator to specified render products. Creates the OmniGraph nodes and connections.
- Parameters
render_products – List of render products to attach the annotator to.
render_product_idxs – Optionally specify the index of render products to attach to from the render product list provided
- detach(render_products: Optional[Union[str, HydraTexture, List[Union[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: Optional[str] = None, do_array_copy: bool = False) 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.
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")
- get_node() Node
Get annotator node
- augment(augmentation: Union[Augmentation, str, Callable, Kernel], data_out_shape: Optional[Tuple[int]] = None, name: Optional[str] = None, device: Optional[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[Union[Augmentation, str]], name: Optional[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.scripts.annotators.AnnotatorRegistry
Registry of annotators providing groundtruth data to writers.
- classmethod register_augmentation(name: str, augmentation: Union[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[Union[str, list, omni.syntheticdata.SyntheticData.NodeConnectionTemplate]], node_type_id: str, init_params: Optional[dict] = None, render_product_idxs: tuple = (0,), output_rendervars: Optional[List[Union[str, list]]] = None, output_data_type: Optional[Any] = None, output_is_2d: bool = False, output_channels: int = 1, is_gpu_enabled: bool = True, hidden: bool = False, documentation: Optional[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 toFalse
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
documentation – Optionally document annotator functionality, input parameters and output format.
- classmethod register_annotator_from_aov(aov: str, output_data_type: Optional[Any] = None, output_channels: int = 1) None
Register annotator from an Arbitrary Output Variable (AOV).
- Parameters
aov – AOV name
- classmethod detach(annotator: Union[str, Annotator], render_products: List[Union[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: Optional[dict] = None, render_product_idxs: Optional[List[int]] = None, device: Optional[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 th writer. Defaults to True.
- classmethod get_augmentation(name: str) Augmentation
Get Augmentation from registry
- Parameters
name – Augmentation name
Default Annotators
- omni.replicator.core.scripts.annotators.DEFAULT_ANNOTATORS = ['camera_params', 'rgb', 'normals', 'motion_vectors', 'cross_correspondence', 'occlusion', 'distance_to_image_plane', 'distance_to_camera', 'LdrColor', 'HdrColor', 'SmoothNormal', 'BumpNormal', 'AmbientOcclusion', 'Motion2d', 'DiffuseAlbedo', 'SpecularAlbedo', 'Roughness', 'DirectDiffuse', 'DirectSpecular', 'Reflections', 'IndirectDiffuse', 'DepthLinearized', 'EmissionAndForegroundMask', 'PtDirectIllumation', 'PtGlobalIllumination', 'PtReflections', 'PtRefractions', 'PtSelfIllumination', 'PtBackground', 'PtWorldNormal', 'PtWorldPos', 'PtZDepth', 'PtVolumes', 'PtDiffuseFilter', 'PtReflectionFilter', 'PtRefractionFilter', 'PtMultiMatte0', 'PtMultiMatte1', 'PtMultiMatte2', 'PtMultiMatte3', 'PtMultiMatte4', 'PtMultiMatte5', 'PtMultiMatte6', 'PtMultiMatte7', 'primPaths', 'SemanticOcclusionPostRender', 'bounding_box_2d_tight_fast', 'bounding_box_2d_tight', 'bounding_box_2d_loose_fast', 'bounding_box_2d_loose', 'bounding_box_3d_360', 'bounding_box_3d_fast', 'bounding_box_3d', 'semantic_segmentation', 'InstanceIdSegmentationPostRender', 'instance_id_segmentation_fast', 'instance_id_segmentation', 'InstanceSegmentationPostRender', 'instance_segmentation_fast', 'instance_segmentation', 'CameraParams', 'BackgroundRand', 'skeleton_prims', 'skeleton_data', 'pointcloud', 'DispatchSync', 'PostProcessDispatcher', 'PostProcessDispatcherUngated']
Built-in mutable sequence.
If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.
Annotator Exceptions
- exception omni.replicator.core.scripts.annotators.AnnotatorError(msg=None)
Bases:
Exception
Base exception for errors raised by annotator
- __init__(msg=None)
Annotator Utils
- class omni.replicator.core.scripts.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, node_params, annotator_params, target_device, **kwargs)
- classmethod get_common_params(annotator_id, node_params, annotator_params, target_device)
- classmethod clear(annotator_id=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.scripts.utils.annotator_utils.get_extra_data(params)
- omni.replicator.core.scripts.utils.annotator_utils.get_annotator_data(node: Node, annotator_params: tuple, from_inputs: bool = False, device: str = 'cpu', annotator_id: Optional[Tuple[str]] = None, do_copy: Optional[bool] = None)
- omni.replicator.core.scripts.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.scripts.utils.annotator_utils.check_should_run_script()
Augmentations
- class omni.replicator.core.scripts.annotators.Augmentation(node_type_id: str, data_out_shape: Optional[Tuple[int]] = None, documentation: Optional[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))
- __init__(node_type_id: str, data_out_shape: Optional[Tuple[int]] = None, documentation: Optional[str] = None, **kwargs)
- static from_node(node_type_id: str, attributes_mapping: Optional[Dict] = None, data_out_shape: Optional[Tuple[int]] = None, documentation: Optional[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: Union[Callable, Kernel], data_out_shape: Optional[Tuple[int]] = None, documentation: Optional[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.
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: Union[str, Annotator], name: Optional[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.
- omni.replicator.core.scripts.annotators.augment(source_annotator: Union[Annotator, str], augmentation: Union[str, Augmentation], data_out_shape: Optional[Tuple] = None, name: Optional[str] = None, device: Optional[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.scripts.annotators.augment_compose(source_annotator: Union[Annotator, str], augmentations: List[Union[Augmentation, str]], name: Optional[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.scripts.annotators.AnnotatorParams(template, data_type, num_elems, is_2d_array, is_gpu_enabled, hidden, documentation)
- data_type
Alias for field number 1
- documentation
Alias for field number 6
- hidden
Alias for field number 5
- is_2d_array
Alias for field number 3
- is_gpu_enabled
Alias for field number 4
- num_elems
Alias for field number 2
- template
Alias for field number 0
- exception omni.replicator.core.scripts.annotators.AnnotatorRegistryError(msg=None)
Base exception for errors raised by the annotator registry
- __init__(msg=None)
- exception omni.replicator.core.scripts.annotators.AnnotatorError(msg=None)
Base exception for errors raised by annotator
- __init__(msg=None)
- exception omni.replicator.core.scripts.annotators.AugmentationError(msg=None)
Base exception for errors raised by augmentation
- __init__(msg=None)
- class omni.replicator.core.scripts.annotators.Augmentation(node_type_id: str, data_out_shape: Optional[Tuple[int]] = None, documentation: Optional[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))
- __init__(node_type_id: str, data_out_shape: Optional[Tuple[int]] = None, documentation: Optional[str] = None, **kwargs)
- property documnetation: str
- static from_node(node_type_id: str, attributes_mapping: Optional[Dict] = None, data_out_shape: Optional[Tuple[int]] = None, documentation: Optional[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: Union[Callable, Kernel], data_out_shape: Optional[Tuple[int]] = None, documentation: Optional[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.
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: Union[str, Annotator], name: Optional[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.
- class omni.replicator.core.scripts.annotators.Annotator(name: str, init_params: Optional[dict] = None, render_product_idxs: Optional[List[int]] = None, device: Optional[str] = None, render_products: Optional[list] = None, template_name: Optional[str] = None, do_array_copy: bool = True)
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 – If set, attach annotator to 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 th writer. Defaults to True.
- __init__(name: str, init_params: Optional[dict] = None, render_product_idxs: Optional[List[int]] = None, device: Optional[str] = None, render_products: Optional[list] = None, template_name: Optional[str] = None, do_array_copy: bool = True) 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: Union[str, HydraTexture, List[Union[str, HydraTexture]]], render_product_idxs: Optional[List[int]] = None) None
Attach annotator to specified render products. Creates the OmniGraph nodes and connections.
- Parameters
render_products – List of render products to attach the annotator to.
render_product_idxs – Optionally specify the index of render products to attach to from the render product list provided
- detach(render_products: Optional[Union[str, HydraTexture, List[Union[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: Optional[str] = None, do_array_copy: bool = False) 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.
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() Node
Get annotator node
- augment(augmentation: Union[Augmentation, str, Callable, Kernel], data_out_shape: Optional[Tuple[int]] = None, name: Optional[str] = None, device: Optional[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[Union[Augmentation, str]], name: Optional[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.scripts.annotators.AnnotatorRegistry
Registry of annotators providing groundtruth data to writers.
- classmethod register_augmentation(name: str, augmentation: Union[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[Union[str, list, omni.syntheticdata.SyntheticData.NodeConnectionTemplate]], node_type_id: str, init_params: Optional[dict] = None, render_product_idxs: tuple = (0,), output_rendervars: Optional[List[Union[str, list]]] = None, output_data_type: Optional[Any] = None, output_is_2d: bool = False, output_channels: int = 1, is_gpu_enabled: bool = True, hidden: bool = False, documentation: Optional[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 toFalse
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
documentation – Optionally document annotator functionality, input parameters and output format.
- classmethod register_annotator_from_aov(aov: str, output_data_type: Optional[Any] = None, output_channels: int = 1) None
Register annotator from an Arbitrary Output Variable (AOV).
- Parameters
aov – AOV name
- classmethod detach(annotator: Union[str, Annotator], render_products: List[Union[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: Optional[dict] = None, render_product_idxs: Optional[List[int]] = None, device: Optional[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 th writer. Defaults to True.
- classmethod get_augmentation(name: str) Augmentation
Get Augmentation from registry
- Parameters
name – Augmentation name
- omni.replicator.core.scripts.annotators.get(name: str, init_params: Optional[dict] = None, render_product_idxs: Optional[List[int]] = None, device: Optional[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 th writer. Defaults to True.
- omni.replicator.core.scripts.annotators.get_augmentation(name: str) Augmentation
Get Augmentation from registry
- Parameters
name – Name of augmentation to retrieve from registry
- omni.replicator.core.scripts.annotators.augment(source_annotator: Union[Annotator, str], augmentation: Union[str, Augmentation], data_out_shape: Optional[Tuple] = None, name: Optional[str] = None, device: Optional[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.scripts.annotators.augment_compose(source_annotator: Union[Annotator, str], augmentations: List[Union[Augmentation, str]], name: Optional[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), ... ] ... )
- omni.replicator.core.scripts.annotators.get_registered_annotators() List[str]
Returns a list names of registered annotators.
- Returns
List of registered annotators.
- omni.replicator.core.scripts.annotators.register(name: str, annotator: Union[Annotator, str]) None
Register annotator
- Parameters
name – Name under which to register annotator
annotator – Annotator to be registered
- omni.replicator.core.scripts.annotators.register_augmentation(name: str, augmentation: Union[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))
Writers
- exception omni.replicator.core.scripts.writers.WriterRegistryError(msg=None)
Basic exception for errors raised by the writer registry
- __init__(msg=None)
- exception omni.replicator.core.scripts.writers.WriterError(msg=None)
Basic exception for errors raised by a writer
- __init__(msg=None)
- exception omni.replicator.core.scripts.writers.InvalidWriterError(writer_name, writer, msg=None)
Exception for writer registration errors
- __init__(writer_name, writer, msg=None)
- class omni.replicator.core.scripts.writers.NodeWriter(node_type_id: str, annotators: List[Union[str, Annotator]], **kwargs)
Node Writer class.
Node writers are writers implemented as OmniGraph nodes. These depend on annotators like python writers, but are implemented as nodes and can be written in C++.
- Parameters
node_type_id – The node’s type identifier (eg. ‘my.extension.OgnCustomNode’)
annotators – List of dependent annotators
- node_type_id
The node’s type identifier (eg. ‘my.extension.OgnCustomNode’)
- annotators
List of dependent annotators
- kwargs
Node Writer input attribute initialization
- initialize(**kwargs) None
- get_node()
Get writer node
- attach(render_products: Union[str, HydraTexture, List[Union[str, HydraTexture]]], **kwargs)
Attach node writer to render products
Attaches the node writer to the render products specified and creates and attaches annotator graphs. If a single annotator is attached, input connections will match the annotator’s output attribute names, in the form of inputs:<attribute_name>. For cases involving more than one annotators, the node writer input attributes will be in the form inputs:<annotator_name>_<attribute_name>.
- Parameters
render_products – Render Product HydraTexture object(s) or prim path(s) to which to attach the writer.
kwargs – Node Writer input attribute initialization
- on_final_frame()
Run after final frame is written.
- detach()
Detach writer
- class omni.replicator.core.scripts.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 = None
- version = '0.0.0'
- annotators = []
- metadata = None
- num_written = 0
- get_metadata()
Get writer metadata
- write_metadata()
- 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_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: Optional[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: Union[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 an 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: Union[str, HydraTexture, List[Union[str, HydraTexture]]], trigger: Union[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: Union[str, HydraTexture, List[Union[str, HydraTexture]]], trigger: Union[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() Node
Get writer node
- class omni.replicator.core.scripts.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: Optional[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[Union[str, Annotator]], category: Optional[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: Union[Writer, NodeWriter], render_products: Union[str, HydraTexture, List[Union[str, HydraTexture]]], init_params: Optional[Dict] = None, trigger: Union[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: Optional[Union[str, HydraTexture, List[Union[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: Optional[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: Optional[Dict] = None, render_products: Optional[List[Union[str, HydraTexture]]] = None, trigger: Union[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: Optional[Union[str, HydraTexture, List[Union[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: Union[str, HydraTexture, List[Union[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: Optional[Union[str, HydraTexture, List[Union[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: Optional[Union[str, HydraTexture, List[Union[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
- omni.replicator.core.scripts.writers.get(name: str, init_params: Optional[Dict] = None, render_products: Optional[List[Union[str, HydraTexture]]] = None, trigger: Union[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.scripts.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.scripts.writers.register_writer(writer: Writer, category: Optional[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.scripts.writers.register_node_writer(name: str, node_type_id: str, annotators: List, category: Optional[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
Default Writers
BasicWriter
- class omni.replicator.core.scripts.writers_default.BasicWriter(output_dir: str, s3_bucket: Optional[str] = None, s3_region: Optional[str] = None, s3_endpoint: Optional[str] = None, semantic_types: Optional[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, skeleton_data: bool = False, frame_padding: int = 4, semantic_filter_predicate: Optional[str] = None)
Basic writer capable of writing built-in annotator groundtruth.
- 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 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. IfFalse
, only prims with semantics will be captured. Defaults toFalse
.
- 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. IfFalse
, the output is saved as a uint32 PNG image. Defaults toTrue
.
- 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 toTrue
.
- 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 toTrue
.
- 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”
Example
>>> import omni.replicator.core as rep >>> camera = rep.create.camera() >>> render_product = rep.create.render_product(camera, (1024, 1024)) >>> writer = rep.WriterRegistry.get("BasicWriter") >>> import carb >>> 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()
- __init__(output_dir: str, s3_bucket: Optional[str] = None, s3_region: Optional[str] = None, s3_endpoint: Optional[str] = None, semantic_types: Optional[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, skeleton_data: bool = False, frame_padding: int = 4, semantic_filter_predicate: Optional[str] = None)
FPSWriter
KittiWriter
- class omni.replicator.core.scripts.writers_default.KittiWriter(output_dir: str, s3_bucket: Optional[str] = None, s3_region: Optional[str] = None, s3_endpoint: Optional[str] = None, semantic_types: Optional[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: Optional[List[tuple]] = None, mapping_path: Optional[str] = None, colorize_instance_segmentation: bool = False, semantic_filter_predicate: Optional[str] = None, use_kitti_dir_names: bool = False)
- Writer outputting data in the KITTI annotation format http://www.cvlibs.net/datasets/kitti/
Development work to provide full support is ongoing.
- Supported Annotations:
RGB Object Detection (partial 2D support, see notes) Depth Semantic Segmentation Instance Segmentation
Notes
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)
- __init__(output_dir: str, s3_bucket: Optional[str] = None, s3_region: Optional[str] = None, s3_endpoint: Optional[str] = None, semantic_types: Optional[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: Optional[List[tuple]] = None, mapping_path: Optional[str] = None, colorize_instance_segmentation: bool = False, semantic_filter_predicate: Optional[str] = None, use_kitti_dir_names: bool = False)
Create a KITTI Writer
- 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
becomescar
).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 – json path to the label to color mapping for KITTI
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`
- on_final_frame()
Run after final frame is written.
- write(data)
Write ground truth.
Writer Base class
- class omni.replicator.core.scripts.writers_default.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 = None
- version = '0.0.0'
- annotators = []
- metadata = None
- num_written = 0
- get_metadata()
Get writer metadata
- write_metadata()
- 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_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: Optional[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: Union[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 an 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: Union[str, HydraTexture, List[Union[str, HydraTexture]]], trigger: Union[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: Union[str, HydraTexture, List[Union[str, HydraTexture]]], trigger: Union[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() Node
Get writer node
Writer Utils
- omni.replicator.core.scripts.writers_default.tools.data_to_colour(data)
- omni.replicator.core.scripts.writers_default.tools.colorize_distance(distance_data, near=1e-05, far=100)
Convert distance in meters to grayscale image.
- omni.replicator.core.scripts.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.scripts.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.scripts.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
(np.array)
- omni.replicator.core.scripts.writers_default.tools.colorize_bbox_2d(image: ndarray, data: ndarray, xform: Optional[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
(np.array)
- omni.replicator.core.scripts.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
(np.array)
- omni.replicator.core.scripts.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. This is based on clock time.
- 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: Union[partial, Callable], max_execs: int = 0) ReplicatorItem
Execute when a specified condition is met.
Create a On Condition 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.
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 has_reached_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(has_reached_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[[...], Union[ReplicatorItem, Node]], override: bool = True, fn_name: Optional[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, specify the registration name. If not specified, the function name is used. fn_name must only contains alphanumeric letters (a-z), numbers (0-9) or underscores (_) and cannot start with a number or contain any spaces.
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: Optional[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: Optional[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) 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 – If rendering in RTX Real-Time render mode, specify the minimum number of subframes to render. This is often required when large scene changes occur to reduce rendering artifacts. If the render mode is set to Path Tracing, this argument is ignored. Values < 0 are ignored.
pause_timeline – If True, pause timeline after step. Defaults to True.
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: Optional[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: Optional[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) 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 – If rendering in RTX Real-Time render mode, specify the minimum number of subframes to render. This is often required when large scene changes occur to reduce rendering artifacts. If the render mode is set to Path Tracing, this argument is ignored. Values < 0 are ignored.
pause_timeline – If True, pause timeline after step. Defaults to True.
Orchestrator info
Other
- omni.replicator.core.orchestrator.registered_event_name(event_name)
Returns the internal name used for the given custom event name
- 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.
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, **kwargs)
Helper function to create a replicator node of type node_type_id
- Parameters
node_type_id – Node type ID
kwargs – Node attributes can optionally be set by specifying them as kwargs
- omni.replicator.core.utils.find_prims(prim_paths: List[Union[str, Path]], 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: Optional[List[str]] = None, ignore_case: bool = True, file_type: str = 'png') List[dict]
Retrive 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()
Get or create the replicator graph
- omni.replicator.core.utils.get_node_targets(node: 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[Union[str, Path]]) 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
- omni.replicator.core.utils.get_prim_variant_values(prim_path: Union[str, Path], variant_name: str) List[str]
- omni.replicator.core.utils.get_prims_from_paths(prim_paths: Union[Path, str]) List[Prim]
Convert prim paths to prim objects
- Parameters
prim_paths – list of prim paths
- omni.replicator.core.utils.get_usd_files(path: str, recursive: bool = False, path_filter: Optional[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: Node, attribute: Attribute, target_prims: List[Union[ReplicatorItem, 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: Union[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:
- RealTime Render Settings:
- Antialiasing/DLSS:
/rtx/post/aa/op
(int): Specify the antialiasing or DLSS strategy to use. Select from None (0), TAA (1), FXAA (2), DLSS (3) and DLAA (4)/rtx/post/scaling/staticRatio
(float): TAA static ratio/rtx/post/taa/samples
(int): TAA samples/rtx/post/taa/alpha
(float): TAA alpha/rtx/post/fxaa/qualitySubPix
(float): FXAA sub-pixel quality/rtx/post/fxaa/qualityEdgeThreshold
(float): FXAA edge threshold/rtx/post/fxaa/qualityEdgeThresholdMin
(float): FXAA edge threshold minimum/rtx/post/dlss/execMode
(int): DLSS mode. Select from: Performance (0): Higher performance than balanced mode. Balanced (1): Balanced for optimized performance and image quality. Quality (2): Higher image quality than balanced mode./rtx/post/aa/sharpness
(float): DLSS/DLAA sharpness. Higher values produce sharper results./rtx/post/aa/autoExposureMode
(int): DLSS/DLAA auto exposure mode. Select from “Force self-evaluated” (0), “PostProcess AutoExposure” (1) and “Fixed” (2)/rtx/post/aa/exposureMultiplier
(float): DLSS/DLAA factor with which to multiply the selected exposure mode. Requires autoExposureMode=1/rtx/post/aa/exposure
(float): DLSS/DLAA exposure level. Requires autoExposureMode=2
- Direct Lighting:
/rtx/newDenoiser/enabled
(bool): Enables the new experimental denoiser./rtx/shadows/enabled
(bool): When disabled, lights will not cast shadows./rtx/directLighting/sampledLighting/enabled
(bool): Mode which favors performance with many lights (10 or more), at the cost of image quality./rtx/directLighting/sampledLighting/autoEnable
(bool): Automatically enables Sampled Direct Lighting when the light count is greater than the Light Count Threshold./rtx/directLighting/sampledLighting/autoEnableLightCountThreshold
(int): Light count threshold above which Sampled Direct Lighting is automatically enabled./rtx/shadows/sampleCount
(int): Higher values increase the quality of shadows at the cost of performance./rtx/shadows/denoiser/quarterRes
(bool): Reduces the shadow denoiser resolution to gain performance at the cost of quality./rtx/directLighting/domeLight/enabled
(bool): Enables dome light contribution to diffuse BSDFs if Dome Light mode is IBL./rtx/directLighting/domeLight/enabledInReflections
(bool): Enables Dome Light sampling in reflections at the cost of performance./rtx/directLighting/domeLight/sampleCount
(int): Higher values increase dome light sampling quality at the cost of performance./rtx/directLighting/sampledLighting/samplesPerPixel
(int): Higher values increase the direct lighting quality at the cost of performance./rtx/directLighting/sampledLighting/clampSamplesPerPixelToNumberOfLights
(bool): When enabled, clamps the “Samples per Pixel” to the number of lights in the scene/rtx/directLighting/sampledLighting/maxRayIntensity
(float): Clamps the brightness of a sample, which helps reduce fireflies, but may result in some loss of energy./rtx/reflections/sampledLighting/clampSamplesPerPixelToNumberOfLights
(bool): When enabled, clamps the “Reflections: Light Samples per Pixel” to the number of lights in the scene/rtx/reflections/sampledLighting/samplesPerPixel
(int): Higher values increase the reflections quality at the cost of performance./rtx/reflections/sampledLighting/maxRayIntensity
(float): Clamps the brightness of a sample, which helps reduce fireflies, but may result in some loss of energy./rtx/lightspeed/ReLAX/fireflySuppressionType
(int): Choose the filter type (None 0, Median 1, RCRS 2). Clamps overly bright pixels to a maximum value./rtx/lightspeed/ReLAX/historyClampingEnabled
(bool): Reduces temporal lag./rtx/lightspeed/ReLAX/aTrousIterations
(int): Number of times the frame is denoised./rtx/directLighting/sampledLighting/ris/meshLights
(bool): Enables direct illumination sampling of geometry with emissive materials.
- Indirect Diffuse Lighting:
/rtx/indirectDiffuse/enabled
(bool): Enables indirect diffuse GI sampling./rtx/indirectDiffuse/fetchSampleCount
(int): Number of samples made for indirect diffuse GI. Higher number gives better GI quality, but worse performance./rtx/indirectDiffuse/maxBounces
(int): Number of bounces approximated with indirect diffuse GI./rtx/indirectDiffuse/scalingFactor
(float): Multiplier for the indirect diffuse GI contribution./rtx/indirectDiffuse/denoiser/method
(int): Select from NVRTD (0) or NRD:Reblur (1)/rtx/indirectDiffuse/denoiser/kernelRadius
(int): NVRTD controls the spread of local denoising area. Higher values results in smoother GI. Requires /rtx/indirectDiffuse/denoiser/method=0/rtx/indirectDiffuse/denoiser/iterations
(int): NVRTD number of denoising passes. Higher values results in smoother looking GI. Requires /rtx/indirectDiffuse/denoiser/method=0/rtx/indirectDiffuse/denoiser/temporal/maxHistory
(int): NVRTD Control of latency in GI updates. Higher values results in smoother looking GI. Requires /rtx/indirectDiffuse/denoiser/method=0/rtx/lightspeed/NRD_ReblurDiffuse/maxAccumulatedFrameNum
(int): NRD:Reblur maximum accumulated frame number. Requires /rtx/indirectDiffuse/denoiser/method=1/rtx/lightspeed/NRD_ReblurDiffuse/maxFastAccumulatedFrameNum
(int): NRD:Reblur maximum fast accumulated frame number. Requires /rtx/indirectDiffuse/denoiser/method=1/rtx/lightspeed/NRD_ReblurDiffuse/planeDistanceSensitivity
(float): NRD:Reblur plane distance sensitivity. Requires /rtx/indirectDiffuse/denoiser/method=1/rtx/lightspeed/NRD_ReblurDiffuse/blurRadius
(float): NRD:Reblur blur radius. Requires /rtx/indirectDiffuse/denoiser/method=1/rtx/ambientOcclusion/enabled
(bool): Enables ambient occlusion./rtx/ambientOcclusion/rayLength
(float): The radius around the intersection point which the ambient occlusion affects./rtx/ambientOcclusion/minSamples
(int): Minimum number of samples per frame for ambient occlusion sampling./rtx/ambientOcclusion/maxSamples
(int): Maximum number of samples per frame for ambient occlusion sampling./rtx/ambientOcclusion/denoiserMode
(int): Allows for increased AO denoising at the cost of more blurring. Select from None (0), Aggressive (1) and Simple (2)./rtx/sceneDb/ambientLightColor
(color3): Color of the global environment lighting./rtx/sceneDb/ambientLightIntensity
(float): Brightness of the global environment lighting.
- Reflections:
/rtx/reflections/maxRoughness
(float): Roughness threshold for approximated reflections. Higher values result in better quality, at the cost of performance./rtx/reflections/maxReflectionBounces
(int): Number of bounces for reflection rays./rtx/reflections/importantLightsOnly
(bool): Process important lights only.
- Translucency:
/rtx/translucency/maxRefractionBounces
(int): Number of bounces for refraction rays./rtx/translucency/reflectAtAllBounce
(bool): When enabled, reflection seen through refraction is rendered. When disabled, reflection is limited to first bounce only. More accurate, but worse performance/rtx/translucency/reflectionThroughputThreshold
(float): Threshold below which reflection paths due to fresnel are no longer traced. Lower values result in higher quality at the cost of performance./rtx/raytracing/fractionalCutoutOpacity
(bool): Enables fractional cutout opacity values resulting in a translucency-like effect similar to alpha-blending./rtx/translucency/virtualDepth
(bool): Improves DoF for translucent (refractive) objects, but can result in worse performance./rtx/translucency/virtualMotion
(bool): Enables motion vectors for translucent (refractive) objects, which can improve temporal rendering such as denoising, but can result in worse performance./rtx/translucency/worldEps
(float): Treshold below which image-based reprojection is used to compute refractions. Lower values result in higher quality at the cost performance./rtx/translucency/sampleRoughness
(bool): Enables sampling roughness, such as for simulating frosted glass, but can result in worse performance.
- Subsurface Scattering:
/rtx/raytracing/subsurface/maxSamplePerFrame
(int): Max samples per frame for the infinitely-thick geometry SSS approximation./rtx/raytracing/subsurface/fireflyFiltering/enabled
(bool): Enables firefly filtering for the subsurface scattering. The maximum filter intensity is determined by ‘/rtx/directLighting/sampledLighting/maxRayIntensity’./rtx/raytracing/subsurface/denoiser/enabled
(bool): Enables denoising for the subsurface scattering./rtx/directLighting/sampledLighting/irradiance/denoiser/enabled
(bool): Denoise the irradiance output from sampled lighting pass before it’s used, helps in complex lighting conditions or if there are large area lights which makes irradiance estimation difficult with low sampled lighting sample count./rtx/raytracing/subsurface/transmission/enabled
(bool): Enables transmission of light through the medium, but requires additional samples and denoising./rtx/raytracing/subsurface/transmission/bsdfSampleCount
(int): Transmission sample count per frame./rtx/raytracing/subsurface/transmission/perBsdfScatteringSampleCount
(int): Transmission samples count per BSDF Sample. Samples per pixel per frame = BSDF Sample Count * Samples Per BSDF Sample./rtx/raytracing/subsurface/transmission/screenSpaceFallbackThresholdScale
(float): Transmission threshold for screen-space fallback./rtx/raytracing/subsurface/transmission/halfResolutionBackfaceLighting
(bool): Enables rendering transmission in half-resolution to improve performance at the expense of quality./rtx/raytracing/subsurface/transmission/ReSTIR/enabled
(bool): Enables transmission sample guiding, which may help with complex lighting scenarios./rtx/raytracing/subsurface/transmission/denoiser/enabled
(bool): Enables transmission denoising.
- Caustics:
/rtx/raytracing/caustics/photonCountMultiplier
(int): Factor multiplied by 1024 to compute the total number of photons to generate from each light./rtx/raytracing/caustics/photonMaxBounces
(int): Maximum number of bounces to compute for each light/photon path./rtx/raytracing/caustics/positionPhi
(float): Position Phi/rtx/raytracing/caustics/normalPhi
(float): Normal Phi/rtx/raytracing/caustics/eawFilteringSteps
(int): Number of iterations for the denoiser applied to the results of the caustics tracing pass.
- Global Volumetric Effects:
/rtx/raytracing/inscattering/maxAccumulationFrames
(int): Number of frames samples accumulate over temporally. High values reduce noise, but increase lighting update times./rtx/raytracing/inscattering/depthSlices
(int): Number of layers in the voxel grid to be allocated. High values result in higher precision at the cost of memory and performance./rtx/raytracing/inscattering/pixelRatio
(int): Higher values result in higher fidelity volumetrics at the cost of performance and memory (depending on the # of depth slices)./rtx/raytracing/inscattering/sliceDistributionExponent
(float): Controls the number (and relative thickness) of the depth slices./rtx/raytracing/inscattering/inscatterUpsample
(int): Inscatter Upsample/rtx/raytracing/inscattering/blurSigma
(float): Sigma parameter for the Gaussian filter used to spatially blur the voxel grid. 1 = no blur, higher values blur further./rtx/raytracing/inscattering/ditheringScale
(float): The scale of the noise dithering. Used to reduce banding from quantization on smooth gradients./rtx/raytracing/inscattering/spatialJitterScale
(float): Spatial jitter scale. 1 = the entire voxel’s volume./rtx/raytracing/inscattering/temporalJitterScale
(float): Temporal jitter scale/rtx/raytracing/inscattering/enableFlowSampling
(bool): Enable flow sampling/rtx/raytracing/inscattering/minFlowLayer
(int): Minimum flow layer/rtx/raytracing/inscattering/maxFlowLayer
(int): Maximum flow layer/rtx/raytracing/inscattering/flowDensityScale
(float): Flow density scale/rtx/raytracing/inscattering/flowDensityOffset
(float): Flow density offset
- PathTracing Render Settings:
- Pathtracing:
/rtx/pathtracing/spp
(int): Total number of samples for each rendered pixel, per frame./rtx/pathtracing/totalSpp
(int): Maximum number of samples to accumulate per pixel. When this count is reached the rendering stops until a scene or setting change is detected, restarting the rendering process. Set to 0 to remove this limit./rtx/pathtracing/adaptiveSampling/enabled
(bool): When enabled, noise values are computed for each pixel, and upon threshold level eached, the pixel is no longer sampled/rtx/pathtracing/adaptiveSampling/targetError
(float): The noise value treshold after which the pixel would no longer be sampled./rtx/pathtracing/maxBounces
(int): Maximum number of ray bounces for any ray type. Higher values give more accurate results, but worse performance./rtx/pathtracing/maxSpecularAndTransmissionBounces
(int): Maximum number of ray bounces for specular and trasnimission./rtx/pathtracing/maxVolumeBounces
(int): Maximum number of ray bounces for SSS./rtx/pathtracing/ptfog/maxBounces
(int): Maximum number of bounces for volume scattering within a fog/sky volume./rtx/pathtracing/fractionalCutoutOpacity
(bool): If enabled, fractional cutout opacity values are treated as a measure of surface ‘presence’ resulting in a translucency effect similar to alpha-blending. Path-traced mode uses stochastic sampling based on these values to determine whether a surface hit is valid or should be skipped./rtx/resetPtAccumOnAnimTimeChange
(bool): If enabled, rendering is restarted every time the MDL animation time changes.
- Anti-Aliasing:
/rtx/pathtracing/aa/op
(int): Sampling pattern used for Anti-Aliasing. Select between Box (0), Triangle (1), Gaussian (2) and Uniform (3)./rtx/pathtracing/aa/filterRadius
(float): Sampling footprint radius, in pixels, when generating samples with the selected antialiasing sample pattern.
- Firefly Filtering:
/rtx/pathtracing/fireflyFilter/maxIntensityPerSample
(float): Clamps the maximium ray intensity for glossy bounces. Can help prevent fireflies, but may result in energy loss./rtx/pathtracing/fireflyFilter/maxIntensityPerSampleDiffuse
(float): Clamps the maximium ray intensity for diffuse bounces. Can help prevent fireflies, but may result in energy loss.
- Denoising:
/rtx/pathtracing/optixDenoiser/blendFactor
(float): A blend factor indicating how much to blend the denoised image with the original non-denoised image. 0 shows only the denoised image, 1.0 shows the image with no denoising applied./rtx/pathtracing/optixDenoiser/AOV
(bool): If enabled, the OptiX Denoiser will also denoise the AOVs.
- Non-Uniform Volumes:
/rtx/pathtracing/ptvol/transmittanceMethod
(int): Choose between Biased Ray Marching (0) or Ratio Tracking (1). Biased ray marching is the ideal option in all cases./rtx/pathtracing/ptvol/maxCollisionCount
(int): Maximum delta tracking steps between bounces. Increase to more than 32 for highly scattering volumes like clouds./rtx/pathtracing/ptvol/maxLightCollisionCount
(int): Maximum ratio tracking delta steps for shadow rays. Increase to more than 32 for highly scattering volumes like clouds./rtx/pathtracing/ptvol/maxBounces
(int): Maximum number of bounces in non-uniform volumes.
- Global Volumetric Effects
/rtx/pathtracing/ptvol/raySky
(bool): Enables an additional medium of Rayleigh-scattering particles to simulate a physically-based sky./rtx/pathtracing/ptvol/raySkyScale
(float): Scales the size of the Rayleigh sky./rtx/pathtracing/ptvol/raySkyDomelight
(bool): If a domelight is rendered for the sky color, the Rayleight Atmosphere is applied to the foreground while the background sky color is left unaffected.
- PostProcess Render Settings:
- Tonemapping:
/rtx/post/tonemap/maxWhiteLuminance
(float): Maximum HDR luminance value that will map to 1.0 post tonemap./rtx/post/tonemap/whiteScale
(float): Maximum white value that will map to 1.0 post tonemap./rtx/post/tonemap/enableSrgbToGamma
(bool): Available with Linear/Reinhard/Modified Reinhard/HejiHableAlu/HableUc2 Tone Mapping./rtx/post/tonemap/cm2Factor
(float): Use this factor to adjust for scene units being different from centimeters./rtx/post/tonemap/filmIso
(float): Simulates the effect on exposure of a camera’s ISO setting./rtx/post/tonemap/cameraShutter
(float): Simulates the effect on exposure of a camera’s shutter open time./rtx/post/tonemap/fNumber
(float): Simulates the effect on exposure of a camera’s f-stop aperture./rtx/post/tonemap/whitepoint
(color3): A color mapped to white on the output./rtx/post/tonemap/colorMode
(int): Tone Mapping Color Space selector. Select from sRGBLinear (0) or ACEScg (1)/rtx/post/tonemap/wrapValue
(float): Offset/rtx/post/tonemap/dither
(float): Removes banding artifacts in final images.
- Auto Exposure:
/rtx/post/histogram/filterType
(int): Select a method to filter the histogram. Options are Median (0) and Average (1)./rtx/post/histogram/tau
(float): How fast automatic exposure compensation adapts to changes in overall light intensity./rtx/post/histogram/whiteScale
(float): higher values result in darker images./rtx/post/histogram/useExposureClamping
(bool): Clamps the exposure to a range within a specified minimum and maximum Exposure Value./rtx/post/histogram/minEV
(float): Clamps the exposure to a range within a specified minimum and maximum Exposure Value./rtx/post/histogram/maxEV
(float): Clamps the exposure to a range within a specified minimum and maximum Exposure Value.
- Color Correction:
/rtx/post/colorcorr/saturation
(color3): Higher values increase color saturation while lowering desaturates./rtx/post/colorcorr/contrast
(color3): Higher values increase the contrast of darks/lights and colors./rtx/post/colorcorr/gamma
(color3): Gamma value in inverse gamma curve applied before output./rtx/post/colorcorr/gain
(color3): A factor applied to the color values./rtx/post/colorcorr/offset
(color3): An offset applied to the color values.
- Color Grading:
/rtx/post/colorgrad/blackpoint
(color3): Defines the Black Point value./rtx/post/colorgrad/whitepoint
(color3): Defines the White Point value./rtx/post/colorgrad/contrast
(color3): Higher values increase the contrast of darks/lights and colors./rtx/post/colorgrad/lift
(color3): Color is multiplied by (Lift - Gain) and later Lift is added back./rtx/post/colorgrad/gain
(color3): Color is multiplied by (Lift - Gain) and later Lift is added back./rtx/post/colorgrad/multiply
(color3): A factor applied to the color values./rtx/post/colorgrad/offset
(color3): Color offset: an offset applied to the color values./rtx/post/colorgrad/gamma
(color3): Gamma value in inverse gamma curve applied before output.
- Chromatic Aberration:
/rtx/post/chromaticAberration/strengthR
(float): The strength of the distortion applied on the Red channel./rtx/post/chromaticAberration/strengthG
(float): The strength of the distortion applied on the Green channel./rtx/post/chromaticAberration/strengthB
(float): The strength of the distortion applied on the Blue channel./rtx/post/chromaticAberration/modeR
(int): Selects between Radial (0) and Barrel (1) distortion for the Red channel./rtx/post/chromaticAberration/modeG
(int): Selects between Radial (0) and Barrel (1) distortion for the Green channel./rtx/post/chromaticAberration/modeB
(int): Selects between Radial (0) and Barrel (1) distortion for the Blue channel./rtx/post/chromaticAberration/enableLanczos
(bool): Use a Lanczos sampler when sampling the input image being distorted.
- Depth of Field:
/rtx/post/dof/enabled
(bool): camera parameters affecting Depth of Field are ignored./rtx/post/dof/subjectDistance
(float): Objects at this distance from the camera will be in focus./rtx/post/dof/focalLength
(float): The focal length of the lens (in mm). The focal length divided by the f-stop is the aperture diameter./rtx/post/dof/fNumber
(float): F-stop (aperture) of the lens. Lower f-stop numbers decrease the distance range from the Subject Distance where objects remain in focus./rtx/post/dof/anisotropy
(float): Anisotropy of the lens. A value of -0.5 simulates the depth of field of an anamorphic lens.
- Motion Blur (RealTime render mode):
/rtx/post/motionblur/maxBlurDiameterFraction
(float): The fraction of the largest screen dimension to use as the maximum motion blur diameter./rtx/post/motionblur/exposureFraction
(float): Exposure time fraction in frames (1.0 = one frame duration) to sample./rtx/post/motionblur/numSamples
(int): Number of samples to use in the filter. A higher number improves quality at the cost of performance.
- FFT Bloom:
/rtx/post/lensFlares/flareScale
(float): Overall intensity of the bloom effect./rtx/post/lensFlares/cutoffPoint
(double3): A cutoff color value to tune the radiance range for which Bloom will have any effect./rtx/post/lensFlares/cutoffFuzziness
(float): a smooth transition between 0 and the original values is used./rtx/post/lensFlares/alphaExposureScale
(float): Alpha channel intensity of the bloom effect./rtx/post/lensFlares/energyConstrainingBlend
(bool): Constrains the total light energy generated by bloom./rtx/post/lensFlares/physicalSettings
(bool): Choose between a Physical or Non-Physical bloom model./rtx/post/lensFlares/blades
(int): The number of physical blades of a simulated camera diaphragm causing the bloom effect./rtx/post/lensFlares/apertureRotation
(float): Rotation of the camera diaphragm./rtx/post/lensFlares/sensorDiagonal
(float): Diagonal of the simulated sensor./rtx/post/lensFlares/sensorAspectRatio
(float): results in the bloom effect stretching in one direction./rtx/post/lensFlares/fNumber
(float): Increases/Decreases the sharpness of the bloom effect./rtx/post/lensFlares/focalLength
(float): Focal length of the lens modeled to simulate the bloom effect./rtx/post/lensFlares/haloFlareRadius
(double3): Controls the size of each RGB component of the halo flare effect./rtx/post/lensFlares/haloFlareFalloff
(double3): Controls the falloff of each RGB component of the halo flare effect./rtx/post/lensFlares/haloFlareWeight
(float): Controls the intensity of the halo flare effect./rtx/post/lensFlares/anisoFlareFalloffY
(double3): Controls the falloff of each RGB component of the anistropic flare effect in the X direction./rtx/post/lensFlares/anisoFlareFalloffX
(double3): Controls the falloff of each RGB component of the anistropic flare effect in the Y direction./rtx/post/lensFlares/anisoFlareWeight
(float): Control the intensity of the anisotropic flare effect./rtx/post/lensFlares/isotropicFlareFalloff
(double3): Controls the falloff of each RGB component of the isotropic flare effect./rtx/post/lensFlares/isotropicFlareWeight
(float): Control the intensity of the isotropic flare effect.
- TV Noise Grain:
/rtx/post/tvNoise/grainSize
(float): The size of the film grains./rtx/post/tvNoise/enableScanlines
(bool): Emulates a Scanline Distortion typical of old televisions./rtx/post/tvNoise/scanlineSpread
(float): How wide the Scanline distortion will be./rtx/post/tvNoise/enableScrollBug
(bool): Emulates sliding typical on old televisions./rtx/post/tvNoise/enableVignetting
(bool): Blurred darkening around the screen edges./rtx/post/tvNoise/vignettingSize
(float): Controls the size of vignette region./rtx/post/tvNoise/vignettingStrength
(float): Controls the intensity of the vignette./rtx/post/tvNoise/enableVignettingFlickering
(bool): Enables a slight flicker effect on the vignette./rtx/post/tvNoise/enableGhostFlickering
(bool): Introduces a blurred flicker to help emulate an old television./rtx/post/tvNoise/enableWaveDistortion
(bool): Introduces a Random Wave Flicker to emulate an old television./rtx/post/tvNoise/enableVerticalLines
(bool): Introduces random vertical lines to emulate an old television./rtx/post/tvNoise/enableRandomSplotches
(bool): Introduces random splotches typical of old dirty television./rtx/post/tvNoise/enableFilmGrain
(bool): Enables a film grain effect to emulate the graininess in high speed (ISO) film./rtx/post/tvNoise/grainAmount
(float): The intensity of the film grain effect./rtx/post/tvNoise/colorAmount
(float): The amount of color offset each grain will be allowed to use./rtx/post/tvNoise/lumAmount
(float): The amount of offset in luminance each grain will be allowed to use./rtx/post/tvNoise/grainSize
(float): The size of the film grains.
- Reshade:
/rtx/reshade/presetFilePath
(string): The path to a preset.init file containing the Reshade preset to use./rtx/reshade/effectSearchDirPath
(string): The path to a directory containing the Reshade files that the preset can reference./rtx/reshade/textureSearchDirPath
(string): The path to a directory containing the Reshade texture files that the preset can reference.
- 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.
- 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: Union[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: Union[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")