Creating different outputs while simulating falling objects

I am creating a synthetic dataset for training object segmentation of cardboard boxes in a container. I followed the stand alone example in standalone_examples/replicator/scene_based_sdg/ and modified it to my needs. The code is attached. It works! You could place the extracted folder in standalone_examples and it should work after modifying line number 17 appropriately(it requires full path to the rep_scene.usd) which is part of the extracted files. A sample synthetic image is attached.

What I would like to understand is how to generate a different configuration for every frame. As of the now the code just calls simulate_falling_objects() one time so when I have

for i in range(num_frames):
    rep.orchestrator.step(delta_time=0.0, rt_subframes=rt_subframes)

It still generates the same scene for all render product outputs. I can see in other examples how rep.randomizer.registeris called for different functions and that is called during rep.trigger.on_frame() context execution. I am not sure how to do that for this case. The function simulate_falling_objects() that is in the example and my code is based upon does not return a ReplicatorItem or a Node so cannot be registered with rep.randomizer.register. I cannot call simulate_falling_objects() multiple times since the objects are already created once and cannot be created again. I do not want to delete the objects I create myself either since I do not understand when the scene is simulated and written to the disk completely.

Is there an example I could study where objects fall under gravity and new configurations are generated for each new frame and hence new data is generated.

test_case.tar.gz (10.7 KB)