A shared folder with AI prompts and code snippets
From workspace: Nvidia
Team: Omniverse
Total snippets: 4
4 snippets
# give parent extension the ability to tell us # to start helping and whether to run with or without UI _extension_instance = None def get_instance(): return _extension_instance class HelperExtension(omni.ext.IExt): def on_startup(self,...
Your extension can communicate with an instance of another loaded extension if they provide the proper mechanism. In this example, the controlling extension will set a flag in the helper extension to tell it to start its helping functionality, and whether it should run with or without a UI
import omni.docs.helper class ControllerExtension(omni.ext.IExt): def on_startup(self, ext_id): helper_inst = omni.docs.helper.get_instance() if helper_inst: # tell helper to run headless (no ui) ...
If you want to refer to assets included with your extension, you need to first get the file path to the extension. You can do this through ExtensionManager from the IApp interface. There are three ways to do this:
import omni.kit.app manager = omni.kit.app.get_app().get_extension_manager() # There could be multiple extensions with same name, but different version # Extension id is: [ext name]-[ext version]. # Many functions accept extension id. # You can...
You may want to quey how an extension is configured. ExtensionManager.get_extension_dict() will return a dictionary containing an extension’s configuration as key-value pairs.
import omni.kit.app manager = omni.kit.app.get_app().get_extension_manager() # There could be multiple extensions with same name, but different version # Extension id is: [ext name]-[ext version]. # Many functions accept extension id: ext_id =...