CGTalk > Software > Autodesk Maya > Maya Programming
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 03-01-2003, 10:33 PM   #1
Octagon
All Is Full Of Mel
 
Octagon's Avatar
Matthias Zeller
Character TD
London, United Kingdom
 
Join Date: Nov 2002
Posts: 194
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-02-2003, 07:25 AM   #2
wrend
existitial phage
Campbell Strong
Upper Sturt, Australia
 
Join Date: Feb 2002
Posts: 548
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-02-2003 at 08:07 AM.
 
Old 03-02-2003, 12:21 PM   #3
Octagon
All Is Full Of Mel
 
Octagon's Avatar
Matthias Zeller
Character TD
London, United Kingdom
 
Join Date: Nov 2002
Posts: 194
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-02-2003, 12:28 PM   #4
Octagon
All Is Full Of Mel
 
Octagon's Avatar
Matthias Zeller
Character TD
London, United Kingdom
 
Join Date: Nov 2002
Posts: 194
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-27-2003, 06:22 PM   #5
vaniljus
Freelancer
 
vaniljus's Avatar
Jonas Salomonsson
Mel and RenderMonkey
Above.se
Malmö, Sweden
 
Join Date: Jul 2002
Posts: 99
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-29-2003, 10:36 AM   #6
Octagon
All Is Full Of Mel
 
Octagon's Avatar
Matthias Zeller
Character TD
London, United Kingdom
 
Join Date: Nov 2002
Posts: 194
Thanx man! It works perfectly!

matthias
 
Old 01-14-2006, 02:00 PM   #7
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 02:26 AM.


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