Hello all,

I have another query about Maya menus. You can pin them to the shelf which
is great but what gets pinned is the callback which appears to be a memory
address. When Maya is closed and re-opened the callback no longer works.

I am invoking my commands like so:

def addMenuItem(parentMenu=None, labelName='', callback=None,
sub=False, tearable=False):
        if callback == None:
                newMenu = pm.menuItem(parent=parentMenu, label=labelName,
subMenu=sub, tearOff=tearable)
                return newMenu
        else:
                pm.menuItem(p=parentMenu, label=labelName, 
command=pm.Callback(callback))


Is there a better way to pin our menu items i.e. pin the script itself or
would that be based around the command being something other that
pm.Callback?

Cheers,

Ben

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAM2ybkW63EmZ6%3DY-GZaxCMKOVXinu5LeqBmjNod-497rv-gpCQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to