A shared folder with AI prompts and code snippets
From workspace: Nvidia
Team: Omniverse
Total snippets: 3
3 snippets
# App/Create Custom Event import carb.events import omni.kit.app # Event is unique integer id. Create it from string by hashing, using helper function. # [ext name].[event name] is a recommended naming convention: MY_CUSTOM_EVENT =...
# App/Subscribe to Update Events import carb.events import omni.kit.app update_stream = omni.kit.app.get_app().get_update_event_stream() def on_update(e: carb.events.IEvent): print(f"Update: {e.payload['dt']}") sub =...
# App/Subscribe to Shutdown Events import carb.events import omni.kit.app # Stream where app sends shutdown events shutdown_stream = omni.kit.app.get_app().get_shutdown_event_stream() def on_event(e: carb.events.IEvent): if e.type ==...