Hi all,
Environment:
- Omniverse Kit SDK: 107.3+
- Windows 10/11
- Python-based UI extension (custom panels, asyncio, etc.)
Issue Summary:
When building UI panels asynchronously in Omniverse Kit 107.3 using the recommended pattern:
python
CopyEdit
asyncio.ensure_future(get_app().next_update_async(lambda: self._build_grid(parent_stack)))
Kit throws a TypeError in the core event dispatcher during startup:
python
CopyEdit
TypeError: observe_event(): incompatible function arguments.
The following argument types are supported:
1. (self: carb.eventdispatcher._eventdispatcher.IEventDispatcher, order: int = 0, event_name: str, on_event: Callable[[carb.eventdispatcher._eventdispatcher.Event], None], filter: handle = None, observer_name: str = '<python>') -> carb.eventdispatcher._eventdispatcher.ObserverGuard
Invoked with: ..., 50, 'update', <function ...>, observer_name=<function UISystemAdminPanel.__init__.<locals>.<lambda> at 0x...>
What’s Happening:
- Passing a
lambdatonext_update_asynccauses the Kit event system to set the lambda itself asobserver_name(should be a string). - This breaks the expected signature and raises a
TypeErrorin Kit’s internal event loop, killing the panel/UI async build.
What I Tried:
- Wrapping with a lambda (standard async UI pattern): crashes.
- Building grid synchronously: works, but causes UI thread blocking for large/complex panels.
- Using a named function instead of a lambda: solves the error!
Workaround / Solution:
Replace the lambda with a named function:
python
CopyEdit
def build_grid_callback():
self._build_grid(parent_stack)
asyncio.ensure_future(get_app().next_update_async(build_grid_callback))
This makes the observer name a real string (from the function’s __name__), and Kit’s event dispatcher works as expected.
Request:
- Please document this limitation/bug with
next_update_asyncand lambda usage in the Kit UI API docs. - If possible, update Kit so that lambdas (or any function objects) are converted to string names for
observer_name, or provide a more helpful error.
References / Example Stack:
- Extension loads fine with a named callback.
- Using lambda always triggers the error above, even with trivial callback logic.
Thanks for any additional insight or ETA for a Kit-side patch!
Chris Wirth
(Multi-Agent Pipeline Extension Dev)