Rendering to image files using Python


I have set up a scene with physics enabled. I would like to start the timeline programmatically via a Python script running headlessly and render frames to image files.

I know how to do this using Isaac Sim. Is there also a way to achieve this using Kit only, without any Isaac Sim dependencies/extensions?


What I have achieved so far is this:

I run a simple python script like this:

kit --exec "" --no-window --enable [some extensions]

In the script I open an existing USD scene with physics driven objects:

ctx = get_context()
stage = ctx.get_stage()

I was also able to do some physics stepping like this, and retrieve an object’s position after each step:

for i in range(20):
    physx_interface.update_simulation(0.1, 0.0)
        True, True, True, True)
    train_world_xform = train_xform.ComputeLocalToWorldTransform(Usd.TimeCode.Default())
    train_xlat = train_world_xform.ExtractTranslation()

So here is another question: In this setup, is it possible to just start the timeline instead and use some callbacks to react on physics steps?

Thanks for any help

Hi Bruno,
You should be able to start a timeline like this:
(if async, add await

You can also add callbacks to physics events like

Generally, I suggest you to look into World, SimulationContext and PhysicsContext classes of Isaac SIM to have an idea on how to do these. In IS we wrap these concepts around a simpler to use API but they use PhysX and Kit APIs under the hood. If you take a look into the classes you will find most of these functionalities and calls.