PDA

View Full Version : Q: Mel UI scripting (marking menus)


Octagon
03-01-2003, 09:33 PM
hi there, i just tried to "quickly" merge two marking menus i use that lie on different keys.
i wanted to put them on one hotkey. depending wheter is use the first or the middle mouse button either one of them should appear.

unfortunately when i defined a second popupMenu in my marking menu script
the second popupMenu would always obscure the first one.

i was under the impression the MM get created just as you push your mouse button, that's why i thought it would be easy to do a MM with one hotkey. but as it seems, both popupMenus are created at the same time with the second overwriting the first.

i hope someone has an idea as i;m running out of hotkeys here ;)

thx in advance,
matthias

wrend
03-02-2003, 06:25 AM
hey. just edit the script that the hokey to your MM runs. for your purposes, simply copy and paste the existing script, make tempMM's to tempMM2, or whatever, and get it to source that other MM you want on the other mouse. and edit the button, strangely! :surprised

ah, and kill tempMM2 it on release.

Octagon
03-02-2003, 11:21 AM
Originally posted by wrend
hey. just edit the script that the hokey to your MM runs. for your purposes, simply copy and paste the existing script, make tempMM's to tempMM2, or whatever, and get it to source that other MM you want on the other mouse. and edit the button, strangely! :surprised

ah, and kill tempMM2 it on release.

i'm afaird i didn't make myself clear in my initial post. sorry.

i want to have _two_ MMs working on the same hotkey (which you cannot do by default in mayas hotkey editor)
so i have to write a special MM script that features _two_ popupMenu mel commands (not a single popupMenu like any "normal" marking menu would have) with different mousebutton flags.

problem is the second definition of a pupupMenu overdraws the first popupMenu, as it seems.
if i use my middle mousebutton i can see my second menu but i when i use my first mousebutton to see the first popupMenu it's contents are empty (a little sqaure greyspace, an empty marking menu appears)

matthias

Octagon
03-02-2003, 11:28 AM
Originally posted by Octagon

[...]
contents are empty (a little sqaure greyspace, an empty marking menu appears)

matthias

just as a further note on this: i tried messing with the default parent control for the menuItems in the menu procedures of the two popupMenus (that procedures you call in the popupMenu -pmc flag).
i tried to explicitly assign the menuItems to their respecting menu instead of just using the common "setParent -m .." statement at the end of the proc. unfortunately I cannot assign a valid menu instead of .. (the parent control) . mel reports an error due to the variables not being defined, the variables being

// first popupMenu
string $menuA = `popupMenu bla bla tempMM`;


// second popupMenu
string $menuB = `popupMenu bla bla tempMM2`;

argh, i'm stuck. please help! :scream:

matthias

vaniljus
03-27-2003, 05:22 PM
It is not that hard to get it to work, have a look at this.

The Press Command:

if (`popupMenu -exists tempMM`) { deleteUI tempMM; }
popupMenu -button 1 -ctl false -alt false -sh false -allowOptionBoxes true -parent viewPanes -mm 1 tempMM;
source "menu_Polymarkinga";

if (`popupMenu -exists tempMM2`) { deleteUI tempMM2; }
popupMenu -button 2 -ctl false -alt false -sh false -allowOptionBoxes true -parent viewPanes -mm 1 tempMM2;
source "menu_Createmarking";

And the release command:

if (`popupMenu -exists tempMM`) { deleteUI tempMM; }
if (`popupMenu -exists tempMM2`) { deleteUI tempMM2; }

Note the -button 2 switch and the tempMM2 object.

Octagon
03-29-2003, 09:36 AM
Thanx man! It works perfectly! :bounce:

matthias

CGTalk Moderation
01-14-2006, 01:00 PM
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.