mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
simplified deferred function
This commit is contained in:
parent
9e809b4aa3
commit
6b28501b4c
1 changed files with 7 additions and 10 deletions
|
|
@ -14,28 +14,25 @@ log = logging.getLogger(__name__)
|
|||
|
||||
def deferred():
|
||||
|
||||
|
||||
from scriptsmenu import launchformaya
|
||||
import scriptsmenu.scriptsmenu as menu
|
||||
import scriptsmenu.launchformaya as launchformaya
|
||||
import scriptsmenu.scriptsmenu as scriptsmenu
|
||||
|
||||
log.info("Attempting to install ...")
|
||||
|
||||
# load configuration of custom menu
|
||||
config_path = os.path.join(os.path.dirname(__file__), "menu.json")
|
||||
config = menu.load_configuration(config_path)
|
||||
config = scriptsmenu.load_configuration(config_path)
|
||||
|
||||
# get Maya menubar
|
||||
parent = launchformaya._maya_main_menubar()
|
||||
cb_menu = menu.ScriptsMenu(objectName=self._menu,
|
||||
title=self._menu.title(),
|
||||
parent=parent)
|
||||
# run the launcher for Maya menu
|
||||
cb_menu = launchformaya.main(title=self._menu.title(),
|
||||
objectName=self._menu)
|
||||
|
||||
# register modifiers
|
||||
modifiers = QtCore.Qt.ControlModifier | QtCore.Qt.ShiftModifier
|
||||
cb_menu.register_callback(modifiers, launchformaya.to_shelf)
|
||||
|
||||
# apply configuration
|
||||
menu.load_from_configuration(cb_menu, config)
|
||||
cb_menu.build_from_configuration(cb_menu, config)
|
||||
|
||||
|
||||
def uninstall():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue