Community
Maya Programming
Welcome to Autodeskā€™s Maya Forums. Share your knowledge, ask questions, and explore popular Maya SDK topics.
cancel
Showing results forĀ 
ShowĀ Ā onlyĀ  | Search instead forĀ 
Did you mean:Ā 

Prevent vertex grouping on selection for Mel script

1 REPLY 1
SOLVED
Reply
Message 1 of 2
lukinu.u
165 Views, 1 Reply

Prevent vertex grouping on selection for Mel script

I'm building a script that need to act separately each selected vertex individually.
For this I'm using the following script :


string $sel[] = `ls -os`;
for($vtx in $sel)
{print $vtx};

The {print $vtx} is just temporary to see if it work but when I do it the vertices with successive index are grouped together. For example when I select vertex 20, 21 and 22, it will be labeled as "mesh.vtx[20:22]" and this group will be considered as one entry in the array.
This is very problematic because my script will just apply on the whole group instead of each vertex individually as it should.
So I wonder if there is a way to set up Maya to not group them like that on selection, or to let the script interpret the selection differently.

1 REPLY 1
Message 2 of 2
143110913
in reply to: lukinu.u

Add the flatten flag to your ls command. Like this:

 

string $sel[] = `ls -os -fl`;

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report