Hi @Richard3D ,
Thanks for the suggestions. The issue was that I was using kit-app-template 108 and it wasn’t able to find the omni.replicator.core extension in that major version. Perhaps it’s not built yet?
I’m now using kit-app-template 107.3 and am able to load the omni.replicatore.core extension. This is my script based on Running Replicator Headlessly — Omniverse Extensions that I am able to execute within the Kit Base Editor application in the python editor which successfully outputs some frames:
# Enable required extensions import omni.kit.app app = omni.kit.app.get_app() ext_mgr = app.get_extension_manager() ext_mgr.set_extension_enabled_immediate("omni.replicator.core", True) import omni.replicator.core as rep import omni.usd # Create a new stage in kit.sh execution mode if omni.usd.get_context().get_stage() is None: omni.usd.get_context().new_stage() with rep.new_layer(): camera = rep.create.camera(position=(0, 0, 1000)) sphere_light = rep.create.light( light_type="Sphere", temperature=rep.distribution.normal(6500, 500), intensity=rep.distribution.normal(35000, 5000), position=rep.distribution.uniform((-300, -300, -300), (300, 300, 300)), scale=rep.distribution.uniform(50, 100), count=2 ) render_product = rep.create.render_product(camera, (1024, 1024)) torus = rep.create.torus(semantics=[('class', 'torus')] , position=(0, -200 , 100)) sphere = rep.create.sphere(semantics=[('class', 'sphere')], position=(0, 100, 100)) cube = rep.create.cube(semantics=[('class', 'cube')], position=(100, -200 , 100) ) with rep.trigger.on_frame(num_frames=10): with rep.create.group([torus, sphere, cube]): rep.modify.pose( position=rep.distribution.uniform((-100, -100, -100), (200, 200, 200)), scale=rep.distribution.uniform(0.1, 2)) # Initialize and attach writer writer = rep.WriterRegistry.get("BasicWriter") writer.initialize( output_dir="_output", rgb=True, bounding_box_2d_tight=True) writer.attach([render_product]) rep.orchestrator.run()
However, if I save that same script as a file and try running it via kit.sh like so:
rlei /home/rlei/dev/kit-107/_build/linux-x86_64/release $ ./kit.sh --no-window --exec my_script.py
The program exits without any frames being generated. I assume this is because rep.orchestrator.run is non-blocking – so after changing:
rep.orchestrator.run()
to
asyncio.run(rep.orchestrator.run_until_complete_async())
it seems to hang indefinitely and no frames are generated.
Any ideas?
Cheers,
Richard