Error in rep.randomizer.choice function

Whenever I try to use the rep.distribution.choice function (in this case use it to randomize dome lighting in each frame), about half of the frames are output with no dome light. Does anyone have any information on this bug and how to get around it?

Hi Michael. Do you have a quick code snippet as a repro I can try? If my guess if correct, we’re aware of this bug, but it would be helpful to confirm.


@michael.wood3 Here’s a workaround for domelights not being rendered in some frames. Add the following line to your script:

rep.settings.carb_settings("/omni/replicator/RTSubframes", 3)

Here’s my full script I tested to ensure it fixes the issue:

import omni.replicator.core as rep

with rep.new_layer():

    camera =, 500, 500), look_at=(0,0,0))
    render_product = rep.create.render_product(camera, (1024, 1024))
    # Add a test cube
    cube = rep.create.cube(semantics=[('class', 'cube')],  position=(0, 0, 0) )
    # Setting to work around domelight white background issue
    rep.settings.carb_settings("/omni/replicator/RTSubframes", 3)
    def dome_lights():
        lights = rep.create.light(
            rotation= (270,0,0),
        return lights.node


    with rep.trigger.on_frame(num_frames=10,interval=10):

    writer = rep.WriterRegistry.get("BasicWriter")
    writer.initialize( output_dir="_domelightstest", rgb=True,   bounding_box_2d_tight=True)

Hopefully this should resolve the issue!

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