Hi! Using the kit_app_template as a starting point.
I built built my App, and my Extension which is supposed to add a Menu/Window entry with a name I desire. However - even though I made sure that the extension gets loaded by turning it on in the Extensions menu, but also by manually adding it as a dependency in my App .kit, however - the on_startup simply doesn’t fire when I launch my App, and the menu entry is not there. The only way I can start up my extension is by going into the extension windows and RE-ENABLING it.
Am I doing something wrong, did I misunderstand the Extension lifecycle methods, or something else?
Thank you,
Danilo
Could the reason be the order of extension loading?
Should perhaps my extension load after omni.kit.scripting or some of the omni.graph extensions?
Problem was presumably the order of extension startup.
Can be solved by using:
asyncio.ensure_future(self._deferred_startup())
async def _deferred_startup(self):
await omni.kit.app.get_app().next_update_async()
# startup logic here
Yes that is correct. Loading order really matters. I am glad you figured it out.
Thank you! I still wonder, what would be the best way to solve this? I assume adding the extensions as a dependency of my extension in the .toml?
-D
In general, when you make a custom extension, you’re always better to put it right at the end of the extension loading list not to interfere with other key core extensions. Yes, you can load your extension and then within your extension file you can load additional extensions.