I’m curious to know whether there is reasonably elegant solution to adding extra functions to the right click context menu in the hypershade panel
Screenshot of the menu i want to add too :
I had a look on the Internet but couldn’t see an immediate solution that didn’t involve modifying the script that creates that menu itself…which i am reluctant to do!
There’s no easy way as far as I can remember, I know we look for one but like a lot of Maya’s menus there all built on the fly by mel procs. We ended up hacking a few of the main mel files that build the Hypershade to add additional functionality.
hyperShadeBinPopupMenuUI.mel
hyperShadePanel.mel
We’ve got a mechanism in place that lets us take control of Maya’s own code, basically ensuring we evalDeferred at low priority their code, ensuring ours is sourced last. Not an elegant solution!
I hacked the basic viewport rmb mel proc a while ago, replacing it. It would display a custom menu if an attribute was found, and turned on, on the right clicked object.
It looks like this may be the file you need to edit…