The Ziva-VFX plugin breaks shelves in Maya

The Ziva-VFX plugin, when launched, will always delete and re-create the Ziva shelf.
This leads to a known issue in Maya (problem over 10 years old!):

Shelf buttons disappear upon restarting Maya

Solution from @monoteba -

But, in the case of the Ziva-VFX plugin, this method will not solve the problem.
First you need to fix the source of the problem.
To do this, we need to fix the script ( that creates the Ziva shelf.
Namely, fix the build_shelf() function

For example (in Windows):
C:\Program Files\Ziva\VFX\Ziva-VFX-Maya-Module\ZivaVFX-Maya-2_2\scripts\

Original version:

def build_shelf():
    """Build the Ziva shelf.
    root = _shelf_root()
    shelves = cmds.layout(root, q=True, ca=True)

    desc = _shelf_dict()

    if _SHELFNAME_ in shelves:
        cmds.deleteUI(root + '|' + _SHELFNAME_, layout=True)

    shelf = mel.eval('addNewShelfTab("{0}")'.format(_SHELFNAME_))
    lyt = cmds.layout(shelf, q=True, ca=True)
    if lyt:
        for item in lyt:
    _add_buttons(shelf, desc)

Revised version:

def build_shelf():
    """Creation/modification the Ziva shelf.
    root_shelf_layout = _shelf_root()
    all_shelves = cmds.layout(root_shelf_layout, query = True, childArray = True)
    current_shelf_tab_name = cmds.tabLayout(root_shelf_layout, query = True, selectTab = True)

    if _SHELFNAME_ in all_shelves:
        ziva_shelf_path = '{}|{}'.format(root_shelf_layout, _SHELFNAME_)
        ziva_shelf_childs = cmds.layout(ziva_shelf_path, query = True, childArray = True)
        if ziva_shelf_childs:
            for item in ziva_shelf_childs:
                cmds.deleteUI('{}|{}'.format(ziva_shelf_path, item))
        ziva_shelf_name = mel.eval('addNewShelfTab("{0}")'.format(_SHELFNAME_))
        ziva_shelf_path = '{}|{}'.format(root_shelf_layout, ziva_shelf_name)
    desc = _shelf_dict()
    _add_buttons(ziva_shelf_path, desc)
    cmds.tabLayout(root_shelf_layout, edit = True, selectTab = current_shelf_tab_name)

In addition, in the _ad_buttons(parent, desc) function, in the cmds.shelfButton() command, you can comment out or remove the noDefaultPopup(ndp)=True flag (Disable the default popup menus.).

Correct and save the script.
Launch Maya.
Execute the script
Restart Maya.

All shelves in Maya should now function correctly.

1 Like