[Maya] Modifying Hypershade right click context menu?

Hello!

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!

Any thoughts or suggestions would be welcome :slight_smile:

Cheers

~ Joe

Get the zooBox from: http://www.macaronikazoo.com/ and have a look see what you can do with Hamish’s code.

Best of luck with the site!!!

@ mattanimation : Cheers ill have a look at this and report back! :D:

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!

Mark

Ahha thanks Mark,

I thought that may have been the case, knowing the files i need to look at though is handy. Cheers for that.

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…

C:\Program Files\Autodesk*Maya2012**\scripts\others\buildHypergraphNodePopupMenuItems.mel