PDA

View Full Version : toggle hide/select polys


rareseu
07-17-2008, 10:54 AM
Hy guys ! i'm kinda new to Maya and to Mel, so far i've worked with cinema4D and done programming for some years, anywayz i've made a script that isolates selected polys ( and keeps imageplanes visible) and a script that reveals everything, they work fine but my shelf is getting crowded so i wanna turn the two into a toggle button.
My initial ideea was like this :
- if something is selected when i click the button it it runs the isolate part of the script
- if nothing is selected when i click the button it runs teh reveal part of the script

the problem i'm having is figureing out when somthing is selected or not. I tried storeing
`ls -ls` in a variable but i don't know what to compare it to because neither null or void work :|

can anyone help please

misterdi
07-17-2008, 01:54 PM
Maybe you could try this :
string $selections[] = `ls -sl`;
if (size($selections))
{
print "something is selected";
}
else
{
print "nothing selected";
}

Cheers,

rareseu
07-17-2008, 02:21 PM
that's great ideea :D thanks

CGTalk Moderation
07-17-2008, 02:21 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.