Skip to content

menu

popup()

Pop-up the existing menu near the mouse cursor.

Source code in client/ayon_maya/api/menu.py
279
280
281
282
283
284
def popup():
    """Pop-up the existing menu near the mouse cursor."""
    menu = _get_menu()
    cursor = QtGui.QCursor()
    point = cursor.pos()
    menu.exec_(point)

update_menu_task_label()

Update the task label in AYON menu to current session

Source code in client/ayon_maya/api/menu.py
287
288
289
290
291
292
293
294
295
296
297
298
299
def update_menu_task_label():
    """Update the task label in AYON menu to current session"""

    if IS_HEADLESS:
        return

    object_name = "{}|currentContext".format(MENU_NAME)
    if not cmds.menuItem(object_name, query=True, exists=True):
        log.warning("Can't find menuItem: {}".format(object_name))
        return

    label = get_context_label()
    cmds.menuItem(object_name, edit=True, label=label)