Q: Mel UI scripting (marking menus)

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 03 March 2003   #1
Q: Mel UI scripting (marking menus)

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
 
Old 03 March 2003   #2
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!

ah, and kill tempMM2 it on release.

Last edited by wrend : 03 March 2003 at 08:07 AM.
 
Old 03 March 2003   #3
Quote:
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!

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
 
Old 03 March 2003   #4
Quote:
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!

matthias
 
Old 03 March 2003   #5
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.
 
Old 03 March 2003   #6
Thanx man! It works perfectly!

matthias
 
Old 01 January 2006   #7
Thread automatically closed

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.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 03:52 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.