"""Does the threading violation clear if we just retry Scene.Define a few times? Never let an exception escape this script so stdout survives regardless of outcome.""" import asyncio import omni.usd from pxr import UsdPhysics import isaacsim.core.experimental.utils.app as app_utils omni.usd.get_context().open_stage("/home/dasha/robozon-sorter/scene/plow_cell_90_45_test.usd") print("opened, waiting...") await app_utils.update_app_async(steps=120) await asyncio.sleep(3.0) await app_utils.update_app_async(steps=60) stage = omni.usd.get_context().get_stage() print("stage settled, prim count:", len(list(stage.Traverse()))) for attempt in range(8): try: scene = UsdPhysics.Scene.Define(stage, "/World/PhysicsScene").GetPrim() print(f"attempt {attempt}: SUCCESS, prim valid={scene.IsValid()}") break except BaseException as exc: print(f"attempt {attempt}: FAILED, type={type(exc).__name__}") await app_utils.update_app_async(steps=60) await asyncio.sleep(1.0) else: print("all attempts failed") print("done")