Can the isaac sim/lab usd file modified by the gui be converted into python code

5.1.0

Operating System

Ubuntu 24.04

Topic Description

Detailed Description

Can modifying the rendering scene (interacting with the scene) through the gui method in isaac sim lab be synchronized to the code in real time, or can the usd file modified by the gui be converted into python code and how to achieve it? I need help!!!

There isn’t a built-in feature that converts GUI edits or a modified USD into Python code, or that syncs the viewport GUI to your script in real time. You can still get close with a few workflows.

1. Use the modified USD from Python (recommended)

After you edit the scene in the GUI:

  • Save the stage (File → Save / Save As) to a .usd or .usda file.
  • In your script, load that USD instead of building the scene from scratch.

In standalone Python you can open it via the Simulation Context / USD APIs; in Isaac Lab you’d typically reference or load that asset in your scene setup. The “source of truth” is then the saved USD; your Python code just loads and uses it.

Related: How to add usd file (saved locally) into isaac sim via Standalone python application.

2. Script the same operations as the GUI

If you need reproducible Python that does what you did in the GUI (e.g. for automation or version control), you have to script it yourself using the same APIs the GUI uses:

  • Omniverse USD / Kit: omni.usd, omni.kit.commands, and the USD stage APIs let you create prims, set transforms, add components, etc. — the same operations the UI performs.
  • Isaac Sim APIs: e.g. spawning prims, XFormPrim, rigid bodies, etc., in code.

So: do the setup once in the GUI to figure out what you want, then reimplement that setup in Python by calling these APIs. There’s no “Export as Python” button; the closest official discussion is:

3. “Real-time” sync

There’s no live “every GUI change becomes a line of Python” sync. You can, however:

  • Read the stage from Python while or after you edit in the GUI (e.g. traverse prims, read transforms). Your code can react to the current USD state.
  • Save the stage after a GUI session and load that file in a later run so your script always starts from the same edited scene.

So “sync” is: save USD → load in Python, or read the open stage from Python; not automatic generation of Python from GUI actions.

Summary

Goal Approach
Use my GUI-edited scene in code Save the stage, then load that USD path in your Python script or Lab scene.
Reproduce GUI setup as Python Use omni.usd / omni.kit.commands and Isaac Sim APIs to re-create the same prims and properties in a script.
Live sync GUI ↔ code Not built-in; use “save USD and load it” or “read current stage from Python” as above.

Hope that helps. If you describe your exact workflow (e.g. “I place objects in the viewport and want a script that loads that layout”), we can narrow down the exact APIs (e.g. load_stage, adding references in Lab, etc.).