Add a light source with Python API

This code works for me for creating Sphere lights:

l = UsdLux.SphereLight.Define(world.stage, Sdf.Path(some_prim_path))
l.CreateExposureAttr(...)
l.CreateRadiusAttr(...)
l.AddTranslateOp()
XFormPrim(some_prim_path).set_local_pose(translation=...)

You could use UsdLux.DomeLight for dome lights.

1 Like