PDA

View Full Version : RMB context sensitive menus


yinako
03-12-2004, 05:35 AM
Can I add or change menu items on RMB context sentive menus?
E.g. can I add more commands to standard poly mask items when right click on poly objects.

dwalden74
03-12-2004, 06:29 AM
can I add more commands to standard poly mask items when right click on poly objects.

Yes you can. YouŽll have to edit the dagMenuProc.mel script in the /scripts/others folder (copy to your userScripts dir first though).

Maybe a better way of doing this, however, would be by using either custom marking menus or popupMenus. That way you donŽt have to mess around with the original Maya scripts.

-d

S. J. Tubbrit
06-22-2005, 10:55 AM
How might I go about doing this, can u please post an example of how to add at least 1 extra command, I ideally want to add some key modelling tools to my selection types, i.e. Edge - would have a subset menu with things like Edge Loop Select, Edge Loop Split, etc ?

Thanks

S. J. Tubbrit
06-22-2005, 01:32 PM
ok, think I'm going to be able to manipulate this script to my advantage

buildObjectMenuItemsNow.mel

any ideas, thoughts, code snippets on how I also may be able to make it context sensitive, so when I'm in each component mode, i.e. vertex, edge, face, object, etc I can access different menu's ?

Thanks

Buexe
06-22-2005, 03:29 PM
check the dagMenuProc.mel. There is a proc called createSelectMenuItems

By editing this you should be able to add the stuff you want.
b

Iconoklast
06-22-2005, 03:31 PM
I've done this and can upload it tonight with an explanation if you like..

Iconoklast
06-22-2005, 03:35 PM
Actually, one quick thing, if you intend to modify the RMB menu, do NOT edit the files in the alias/maya6.5/scripts/other (or startup) directory. What you'll want to do is copy the files you're going to modify and stick them in the local scripts directory in documents and settings folder.

yinako
06-22-2005, 03:36 PM
yes you do it, here is an example what I have changed to RMB My menu for object mode, vetex, edge, face mode when right click. you can change them by modifing createContextMenu.mel

yinako
06-22-2005, 03:44 PM
heres the one for face mode. if you want my createContextMenu here it is, you have to rename it to .mel also it use some other commands like those from Maya Open tool box.

Theres one thing I don't like these menu is they are not like Marking Menus, they get big and you have to select from a big list.

In Maya 6.5 you can hold shift right Click, If i remember correctly, on polygon components to get a true context sensitive marking menu, without this big list. I never figured out how to modify that one... anyone know how please let me know.

S. J. Tubbrit
06-22-2005, 03:53 PM
Oh, that's great, thanks a lot all! I'll give those a shot and see what I come up with.

Really, thanks again, much appeciated!

Iconoklast
06-22-2005, 04:28 PM
I personally suggest not to modify the RMB itself, but to modify the RMB when you have modifiers like ctrl/shift pressed. For example, my RMB is the same as the default. Ctrl+RMB brings up a selection based RMB (see attached), and my Shift+RMB brings up the context sensitive tool marking menu (a modified 6.5 bonus tools menu).

To modify the polygon selection menu for ctrl+rmb, you need to modify a script called polyConvertMM, in the Maya6.5/scripts/others directory. Compare my script with the default to see what has changed. It's basically just some if/else statements which say, if an edge is selected add the edge loop command to the SE radial position, if it's not an edge, but it's a face, add a face loop command to the same position, and so on.
Look into commands such as filterExpand, to figure out how to easily detect what is selected.

The shift+rmb menu is a little different. It's working off of the bonus tools shift+rmb marking menu, but I've modified it to fit my needs. What you need to do to modify it, is to modify the script contextToolsMM; which you can find in the bonusTools/scripts directory.
On that note though, the script requires a modified ModelEdMenu.mel (which can be found in the bonustools/scripts dir). This script tells maya what shift+rmb, what ctrl+rmb do, and what the regular RMB does. Or rather, which scripts they call to create those menus. I hope that makes sense..

Iconoklast
06-22-2005, 04:30 PM
Can only attach 3 files at a time, so here's my polyConvertMM.mel

S. J. Tubbrit
06-22-2005, 05:06 PM
Thanks Iconoklast,

I'll try the stuff out you suggested, much appreciated.

Regards

macaroniKazoo
06-22-2005, 10:00 PM
looks like I'm a little late to this thread, but I've wrote a script awhile back that lets you add custom commands to an object's right click menu. I'm not sure what you want to change in the menu, but this script allows you to add custom commands to objects on the fly.

its great for building character rigs - storing stuff like ik/fk switching in a wrist/hand control's right click menu makes for a really easy to use rig. anyway, if you're interested its called zooObjMenu and comes as part of zooTriggered (http://www.macaronikazoo.com/mel/download/zooTriggered.rar)

yinako
06-23-2005, 04:55 AM
Iconoklast: so that means this requires maya6.5? looks like no way to get that kind of menu on 6.0?

S. J. Tubbrit
06-23-2005, 05:47 AM
macaroniKazoo >

Hi,

That was the first thing I tried, working through Maya 6 (not 6.5), but it never saved any of the commands I set up through it, quitting Maya and coming back in, commands had disappeared, and also just clicking New Scene, would also wipe out the commands, not sure what I was doing wrong, also from what I gather it wasn't context sensitive, unless I'm wrong? :)

Iconoklast
06-23-2005, 06:49 AM
Iconoklast: so that means this requires maya6.5? looks like no way to get that kind of menu on 6.0?

No, you can do the same in 6.0 or 5.0 or 4.0. The shift+rmb marking menu you see in 6.5 has nothing to do with 6.5 itself, but just the bonus tools that were released when 6.5 was released. These bonus tools also work for 6.0 though, and the scripts work there aswell. Basically, just look at the ModelEdMenu.mel in the scripts/other or scripts/startup to see how it works and what it does.

macaroniKazoo
06-23-2005, 07:53 AM
SJ - it depends what you mean by context sensitive. which context are we talking about?

zooObjMenu works by adding attributes to an object, so that particular object stores the command. If you want to add a menu item for ALL objects of a particular kind, depending on whether you're in object mode or component mode or whatever, then yeah, you'll have to go hacking scripts as others have already explained.

I just wasn't sure from your post whether you wanted menu items on specific objects (which is what zooObjMenu does) or menu items for ALL objects of a certain type depending on the selection mode...

CGTalk Moderation
06-23-2005, 07:53 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.