PDA

View Full Version : Fixing the component-mode-marking-menu-thingy-bug?


-wT-
08-29-2002, 06:10 PM
Now, show us your knowledge of MEL BigfatMELon! :wavey:

So, the problem is, like you all have propably noticed, when you change the selection type trough the RMB marking menu, the actual type of selection doesn't change (I.e. look at the status line, change from object mode to some component mode with the RMB marking menu... see? The "Select by object type" is still selected)
And this is pissing me off right now!
Like, you have to take that into account when making scripts, and if you want to change quickly from component mode to object, in 99% of the time I have to press F8 twice, which is starting to be annoying.

I've tried to locate a scriptfile which would include the marking menu with the appropriate commands, so I could somehow add something there to change the mode in the correct way, but it seems that it's somehow hard-coded, or done in some weird way.
The scriptfile named "dagMenuProc.mel" seems to contain something relative to the problem, but I can't understand it, or it may be a wrong script file.

So, if anyone knows what I'm talking about, please help!
Thank you very much!

-wT-
08-31-2002, 10:54 AM
I hope anything vital didn't get deleted from this thread... but anyways, I will continue to bump this up 'till someone of you say it's impossible to do.

So, bump! :bounce:

iC4
08-31-2002, 12:00 PM
I know the error too :rolleyes:

;)

boomji
08-31-2002, 02:50 PM
hey wt,
yezzz dude...this is a nagging thing.i got used to pressing the f8 key in the end.also i wish i could tun on multiple options (cvs,hulls...etc) in the right click menu.when i want cv's/ep's with hulls i have to f8, multiple selections wont work in the marking menu :(
of course i wish i could rotate the scale pivot as well bahhh.
done cribbing thanx for listening ;)
b

-wT-
08-31-2002, 05:35 PM
Holy pickmask markingmenu batman! I just fixed it! :eek:


Heh, I dunno why, but this time when I looked at the script (dagMenuProc.mel) again, it made much more sense, although I still can't say I 100% understand how the markingmenu is created in that script... but anyways.

First, before I explain what it fixes, what problems it adds, what I made and why I made it, I'm going to give you who don't give a *beep* of what I've done -ones the URL to download the file ;)
Here: http://device.dyndns.org/wt/dagMenuProc.zip
Just unzip it over the old one located in x:\AW\Maya4.0\scripts\others


So, because maybe some of you want to know how I did it, I'll tell you it.

First, the script dagMenuProc.mel seems to control the whole marking menu you get when you press the RMB over anything, like poly-meshes, lattices, particles, NURBS objects etc.

The procedures that interest us now, are the ones which come after the "createSelectMenuItems" procedure, and which start with "doMenu...".

There are five of the menus, each of it's own for NURBS, lattices, particles, springs and polygons.

When you press the RMB over i.e. a polygon mesh, and then select "Face", the procedure "doMenuComponentSelection" is run with the $item being the object's name, and $mask being the mask (In this example, "Face").

The part of the script that's being a jerk to us, is the if sentence. It examines if we're still in a object mode, and if we are, it then does the annoying decision that we want to remain in object mode even if the selection type get's turned to a component one.
Why this happens, is because of this line:
$selectCmd = "selectType -ocm -" + $mask + " true;";
Or actually, because of that underlined part of the line. The flag -ocm enables (Or disables, but as there's "true" in the end of the line, it enables) to have a component mode selection mask applied while in object mode, which is the core of the problem, isn't it?
Well, taking it out itself isn't yet enough, we need to add the line
selectMode -component;
somewhere, to actually get ourselves to the component mode.
By doing these two modifications, taking out the -ocm flag from the right line, and adding the extra line before it, we finally are able to go into component mode with the RMB markingmenu.
I did this to all of the other procedures aswell, so everything works like this for now.

But, this actually isn't a bug, and that's why you should propably keep the old file somewhere as a backup.
Why you ask? Well, it's very simple actually, just go on and try to select i.e. a polygon vertex AND some another mesh.
Oh you can't? :)
Well, tough luck, as that's why the -ocm flag was there for, without it (and with that extra line), we're always turned to component mode, and we can't ofcourse select an object while in it.
I'm not too sure if this is too vital for anyone of you, and atleast I'm willing to loose the ability to mix-select objects and components, if I can change the selection mode more easily.


So, that's about it. But knowing me, I've propably forgot to tell you 1000 things, and the text propably isn't too comfortable to read, sorry about that (Am too lazy to read it trough :rolleyes:)

Should I post this to highend? Am I even able to, or is it illegal? (I'm not 100% sure if the license text in the beginning of the script allows me to)

Enjoy! :thumbsup:

bigfatMELon
08-31-2002, 08:08 PM
Oops, I'm late to this thread. Congrats on solving this. I've got something similar to this edit at work. I only recently had to tackle this for others since I've always used the F9-12 keys instead of that menu. I also recently manged to fix the problem of maya starting with only 4 cameras, which is another hack of sorts.

It's perfectly legal for you to edit the included scripts and post them to highend. It happens all the time.

-jl

bigfatMELon
08-31-2002, 08:12 PM
ooops, one more thing... before you post this, it's a good practice to comment out a copy of the orginal code and then thoroughly document and indicate your changes so that other people can easily find and see what you've done and compare it with the original.

Just a good programming practice.

-jl

iC4
09-01-2002, 12:25 AM
congratulations and thx for the fix :beer:

victor
09-01-2002, 12:59 AM
Originally posted by -wT-
So, if anyone knows what I'm talking about, please help!

Just FYI, this isn't really a bug, as opposed to a seperate feature.

If you are in component-select mode, the MM works just as the F9, F10, etc. keys, but when you are in object-select mode, it only temporarily changes your selection type, allowing you to select multiple components of different types at the same time.

-wT-
09-01-2002, 09:25 AM
Ok BFM, I'll go and edit the script to have comments and descriptions of what I did, and go post it to highend3d.
And changing to different component modes with the F9-F12 keys isn't really an option for me, as I like to have all the keys I need directly under my hand, that's why that double-F8 trick got so annoying: Every key I needed was on the left side of the keyboard, and I needed to swing my hand to the other side of the keyboard just to do that one simple thing.
Actually, if someone doesn't know yet, "q" or "w" (Reflex, remember) pops up another marking menu with the ability to change from object- to component mode, which is what I use now

Thanks iC4- :beer:

And Victor, I did say in the long reply that it isn't a bug actually (Although I thought it was when I first wrote this thread), and noticed the exact same thing as you, but thanks anyways :thumbsup:

CGTalk Moderation
01-13-2006, 03: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.