From 8d69c751d8a41497859131d080ed40bc02d0de93 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 18 Aug 2021 13:40:46 +0200 Subject: [PATCH] use project settings only if menu is not passed --- openpype/hosts/maya/api/menu.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/openpype/hosts/maya/api/menu.py b/openpype/hosts/maya/api/menu.py index 0dced48868..888cd78be1 100644 --- a/openpype/hosts/maya/api/menu.py +++ b/openpype/hosts/maya/api/menu.py @@ -16,12 +16,10 @@ log = logging.getLogger(__name__) def _get_menu(menu_name=None): """Return the menu instance if it currently exists in Maya""" - - project_settings = get_project_settings(os.getenv("AVALON_PROJECT")) - _menu = project_settings["maya"]["scriptsmenu"]["name"] - if menu_name is None: - menu_name = _menu + project_settings = get_project_settings(os.getenv("AVALON_PROJECT")) + menu_name = project_settings["maya"]["scriptsmenu"]["name"] + widgets = dict(( w.objectName(), w) for w in QtWidgets.QApplication.allWidgets()) menu = widgets.get(menu_name)