Reputation: 294
I am trying to show a omniverse ui kit window from a method of class, it is not working, but it is showing when i use same statement outside the method and inside that class.
Code is below.
py_ext.py
import NodeStarter
class WirelessAppUtilities(omni.ext.IExt):
def __init__(self):
super().__init__()
self._console_window = None
self._hide_render_settings_task = None
def on_startup(self, ext_id):
self.__disable_context_menu()
self.__set_selection_mode()
self.__hide_main_menu()
self.__hide_windows()
NodeStarter.start_node()
def on_shutdown(self):
self._menu_bar = None
self._context_menu = None
def __hide_windows(self):
hidden_windows = ["main toolbar", "timeline toolbar", "render settings"]
......
node_start.py(Not working)
import omni.ui as ui
class StartUpImage:
def __init__(self, title: str) -> None:
self._panel_window = None
self._title = title
def show_window(self):
if self._panel_window is None:
self._panel_window = ui.Window(self._title, width=600, height=400)
self._panel_window.visible = True
def close_window(self):
if self._panel_window is not None:
self._panel_window.visible = False
class NodeStarter(object):
def start_node():
sui = StartUpImage(title="Starting App")
sui.show_window() **----> Not showing window here**
pass
node_start.py(Working)
import omni.ui as ui
class StartUpImage:
def __init__(self, title: str) -> None:
self._panel_window = None
self._title = title
def show_window(self):
if self._panel_window is None:
self._panel_window = ui.Window(self._title, width=600, height=400)
self._panel_window.visible = True
def close_window(self):
if self._panel_window is not None:
self._panel_window.visible = False
class NodeStarter(object):
sui = StartUpImage(title="Starting App")
sui.show_window() **----> showing window here**
def start_node():
pass
I want to show window from method of class, how can i achieve this?
Upvotes: 0
Views: 28