Hi @Richard3D , some more context. It appears that the Measure extension’s _show_window menu
function is being called without the required parameters. I’ve confirmed this by going to the extension’s extension.py, and adding the following function:
def show_window_with_logging(self):
import traceback
import carb
carb.log_info("[DEBUG] Measure menu clicked (no args)")
stack = ''.join(traceback.format_stack())
carb.log_error("[DEBUG] Callstack:\n" + stack)
self._show_window(None, True)
And then substituting it inside the extension’s on_startup
call:
self._menu_entry = [
MenuItemDescription(
name=EXTENSION_NAME,
ticked=False,
ticked_fn=self._is_visible,
onclick_fn=self.show_window_with_logging
)
]
# self._menu_entry = [
# MenuItemDescription(
# name=EXTENSION_NAME,
# ticked=False,
# ticked_fn=self._is_visible,
# onclick_fn=self._show_window,
# )
# ]
The measure panel shows now, and the log outputs a partial callstack (1 level):
2025-04-09 10:25:43 [16,471ms] [Error] [omni.kit.tool.measure.extension] [DEBUG] Callstack:
File "d:/projects/omniverse/my-kit-project/_build/windows-x86_64/release/extscache/omni.kit.tool.measure-107.0.0+107.0.3/omni/kit/tool/measure/extension.py", line 74, in show_window_with_logging
stack = ''.join(traceback.format_stack())
Which may indicate that the call is coming from C++ directly, since no additional python callstack shows.
This is on Windows 11, latest.
So it seems there exists at least one call path in the SDK that will treat this menu item as a toggle and not pass in a bool value for whether it should be on or not. It could be related to Linux vs Windows, and how tool menus are handled in Windows, but just a guess.
Interestingly, the omni.kit.window.section tool, which also shows under the Tools menu, works properly but registers its window showing in a different manner:
def on_startup(self, ext_id):
self._ext_id = ext_id
# The ability to show up the window if the system requires it. We use it
# in QuickLayout.
self._window = None
ui.Workspace.set_show_window_fn(WINDOW_NAME, partial(self.show_window, None))
While the measure tool uses add_menu_items(self._menu_entry, name="Tools")
in on_startup
. I suspect that may be the reason for the differing behavior, but at this point I hope I’ve provided enough to help track down the bug, since I’m not familiar with the SDK.