Enable a Kit Extension

You may need to enable an extension from a script or from another extension. The ExtensionManager from the IApp interface allows you to query if an extension is enabled, enable it or disable it.

Immediate

You can immediately enable an extension using the _immediate function.

import omni.kit.app

manager = omni.kit.app.get_app().get_extension_manager()

# enable immediately
manager.set_extension_enabled_immediate("omni.kit.window.about", True)
print(manager.is_extension_enabled("omni.kit.window.about"))

Non-Immediate

There is also a non-immediate way to enable extensions which are executed on the next update (i.e. frame). Multiple extensions can be batch enabled this way.

import omni.kit.app

manager = omni.kit.app.get_app().get_extension_manager()

# multiple commands can be batched
manager.set_extension_enabled("omni.kit.window.about", True)
manager.set_extension_enabled("omni.kit.window.console", True)