import omni.ext
from typing import Optional
_extension_instance = None
class LbenhorinHelloWorldExtension(omni.ext.IExt):
# ext_id is current extension id. It can be used with extension manager to query additional information, like where
# this extension is located on filesystem.
def on_startup(self, ext_id):
global _extension_instance
_extension_instance = self
print("[lbenhorin.hello.world] lbenhorin hello world startup")
pass
def on_shutdown(self):
global _extension_instance
_extension_instance = None
print("[lbenhorin.hello.world] lbenhorin hello world shutdown")
def get_instance() -> Optional[LbenhorinHelloWorldExtension]:
return _extension_instance
You can check this code, this extension is holding a reference to itself, which can be imported from other extensions (considering it is actually loaded)
If you refer to the Pylance warning - Then this is PATH issue, but when you will execute the code inside omniverse this should work.
I think that to get this error gone and have code completion then you will have to edit the .vscode/settings.json file with your extension.