Add a light source with Python API

Is there a way to manually add a light (e.g. a Domelight) to a world with the python API? I only found a way using the replicator class light = replicator.create.light(...)

This code works for me for creating Sphere lights:

l = UsdLux.SphereLight.Define(world.stage, Sdf.Path(some_prim_path))

You could use UsdLux.DomeLight for dome lights.

1 Like

@robin-vetsch , you can also refer this document for lights related things:Lights — Omniverse Create documentation

This code works for me in 2023.1:

import omni.isaac.core.utils.prims as prim_utils

light_1 = prim_utils.create_prim(
    position=np.array([1.0, 1.0, 1.0]),
        "inputs:radius": 0.01,
        "inputs:intensity": 5e3,
        "inputs:color": (1.0, 0.0, 1.0)

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.