PDA

View Full Version : Control over the "filterExpand" command


Haider of Sweden
02-16-2008, 09:43 AM
I am running this MEL code:
$selUVs = `filterExpand -sm 35`;

When I run this code snippet while having multiple UVs selected is that it lists all the selected UV names ordered in their numbers.
I'd like to change the order so that I get either the last or the first selected UVs.

Is that possible? It doesnt necesarry have to bee that command. Its the result I am looking for.

meljunky
02-17-2008, 08:44 PM
May want to look into the command: scriptCtx

There is an example of the command at:
http://www.hierographics.com/content/downloads.html
The script called getWeightFromPoint.mel

Help docs looks like it has good detail on it.

-Brian
www.meljunky.com (http://www.meljunky.com)

ticket01
02-18-2008, 07:24 AM
Unfortunately there's no way with MEL (this has already been discussed several times) to get the selection order of a bunch of objects/components. You'll always get a sorted listed, but alphabetically not in the order of selection. This is a real nasty problem when using scriptCtx.

Using the API it's not a problem though.

meljunky
02-18-2008, 04:08 PM
In the script I mention...

Select the target verts, run the script, select the base vert.

The last vert is selected with nothing selected, so it does remember.

Wont work with multi level selection.

You mention the API, will be useful as a python function. Since python plugin is ...easier to write the C++ plugin for some things.

-Brian
www.meljunky.com (http://www.meljunky.com/)

Haider of Sweden
02-18-2008, 07:20 PM
Select the target verts, run the script, select the base vert.


Yep, it seems like this is the only way; You select one vert, run the script and do another selection and by that you separate the target.
No I understand why many of mayas tool has that workflow. Its simply because it cant store the selection order.
Unless you dont have a script running that listnenes for the selection order.
However, I dont think thats a good idea, is it? I mean, you run the script, do your things and get things done. Instead of doing things, running script and get things done. Its a matter of workflow...

ticket01
02-19-2008, 12:54 PM
You mention the API, will be useful as a python function. Since python plugin is ...easier to write the C++ plugin for some things.

That's right. But I always think of backwards compatibility and since a lot of people I know are still working with versions without Python support, I guess there should be a solution for this using the API. Maybe I'll come up with something in my spare time project (http://cms.ticket01.com/index.php/freeware) :)

CGTalk Moderation
02-19-2008, 12:54 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.