Maya Training

Introduction to Hard Surface Modeling

Maya Training

Interiors and Furniture Vol 1 & 2 - Modeling & Cloth

Maya Training

Shading, Lighting and Rendering the Bedroom in MR

Maya Training

Robot volume one - Modeling with animation in mind

Maya Training

Spach-Alspaugh House the complete courseware

Maya Training

Burt The Cartoon Dinosaur Vol 01 - Modeling

New Maya Training

Robot Volume 02 - Hybrid Rigging
You are here > Home > SimplyMaya Community Forums
Loading

Welcome to Simply Maya

Please Sign in or Sign up for an account

Member Login

Lost your password?

Not a member yet? Sign Up!

Old 04-09-2006, 06:49 AM   #1
Falott
Registered User
 
Falott's Avatar
 
Join Date: Jan 2005
Location: vienna
Posts: 1,095
Thanks: 3
Thanked 20 Times in 18 Posts
Default Toggle Isolate Selected

// Toggle Isolate Selected
//

string $visPanel[]=`getPanel -vis`;
int $mode;
if (size($visPanel)>0)
{
for ($panel in $visPanel)
{
if (`match "^modelPanel" $panel`=="modelPanel")
{
$mode=`isolateSelect -q -state $panel`;
if ($mode>0)
isolateSelect -state 0 $panel;
else
isolateSelect -state 1 $panel;
}
}
print ("\nxray="+$mode+".");
} else
print ("\nNo model panels to modify.");

xray=0.editMenuUpdate MayaWindow|mainEditMenu;





there is something wrong with this script. it isolates the selection and toggles unselected back visible when executed again. but no matter which object is selected later on the script is affecting my first isolated object only.




the following script is taken from mayaīs embedded scripts and does isolate selected but does not bring it back to visibility.


{ string $currentPanel = `getPanel -withFocus`;
string $panelType = `getPanel -to $currentPanel`;
if ($panelType == "modelPanel") {
if (size(`ls -sl`) > 0)
{ enableIsolateSelect $currentPanel true; }
else
{ enableIsolateSelect $currentPanel false; } }}



anyone knows how to fix this?
__________________
everything starts and ends in the right place at the right time.
Falott is offline   Reply With Quote
Old 04-09-2006, 10:00 AM   #2
skywola
Registered User
 
skywola's Avatar
 
Join Date: Jan 2004
Location: Tempe, Arizona, USA
Posts: 224
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Not one hundred percent sure if this is what you are attempting, but I modified a bit and the results appear that they may be what you want . . .

string $visPanel[]=`getPanel -vis`;
int $mode;
if (size($visPanel)>0)
{
for ($panel in $visPanel)
{
if (`match "^modelPanel" $panel`=="modelPanel")
{
$mode=`isolateSelect -q -state $panel`;
if ($mode>0)
isolateSelect -state 0 $panel;
else
isolateSelect -state 1 $panel;
}
}
print ("\nxray="+$mode+".");
} else
print ("\nNo model panels to modify.");

// this is the line that was throwing the error:
//xray=0

editMenuUpdate MayaWindow|mainEditMenu;

Congrats on the coding, I have done a lot of MEL and I'm not so familiar with this . . . what the heck are you actually using
it to do?
__________________
"The Sage as an Astronomer: If you still see the stars as something above you, you lack the eye of knowledge." Friedrich Nietzsche
skywola is offline   Reply With Quote
Old 04-09-2006, 10:09 AM   #3
skywola
Registered User
 
skywola's Avatar
 
Join Date: Jan 2004
Location: Tempe, Arizona, USA
Posts: 224
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Are you by any chance attempting to toggle xray at the same time?

If so, I would just call the procedure within the procedure:

toggleXray;
__________________
"The Sage as an Astronomer: If you still see the stars as something above you, you lack the eye of knowledge." Friedrich Nietzsche
skywola is offline   Reply With Quote
Old 04-09-2006, 03:17 PM   #4
Falott
Registered User
 
Falott's Avatar
 
Join Date: Jan 2005
Location: vienna
Posts: 1,095
Thanks: 3
Thanked 20 Times in 18 Posts
Default

I still donīt know sh* about mel after all. thx for taking your time skywola. what I wanna do is to toggle Isolate Select but it just wont work. I donīt want to toggle xray. I once copied the first script from the topic Maya tips & tricks from this site. tried to find it again but itīs gone.. donīt quite know where the xRay line came from. did a lot of copy and paste to get this working.

tried your suggestion of code and found out that maya on my machine still has the a problem. now nothing is isolated - means everything gets hidden. by now I believe its something with my installation files.
__________________
everything starts and ends in the right place at the right time.

Last edited by Falott : 04-09-2006 at 03:19 PM.
Falott is offline   Reply With Quote
Old 05-09-2006, 07:14 AM   #5
skywola
Registered User
 
skywola's Avatar
 
Join Date: Jan 2004
Location: Tempe, Arizona, USA
Posts: 224
Thanks: 0
Thanked 0 Times in 0 Posts
Default

when I ran the code, the bottom part of the window said "isolate", then after re-running the code it appeared normal.

Didn't notice any changes in the window, I only had one object selected. What exactly is isolate select suppose to do?
__________________
"The Sage as an Astronomer: If you still see the stars as something above you, you lack the eye of knowledge." Friedrich Nietzsche
skywola is offline   Reply With Quote
Old 05-09-2006, 12:25 PM   #6
Falott
Registered User
 
Falott's Avatar
 
Join Date: Jan 2005
Location: vienna
Posts: 1,095
Thanks: 3
Thanked 20 Times in 18 Posts
Default

if you have say - 2957 objects in your scene and you need to work on one object but that is covered by lots of other objects - isolateSelect it.

selected item remains visible, everything else is hidden. (but not in terms of hide and unhide, cause you canīt unhide the invisible objects when isolateSelected is active.)

find this funtion in any viewport - Show - Isolate Select - View Selected.
__________________
everything starts and ends in the right place at the right time.
Falott is offline   Reply With Quote
Old 05-09-2006, 03:41 PM   #7
skywola
Registered User
 
skywola's Avatar
 
Join Date: Jan 2004
Location: Tempe, Arizona, USA
Posts: 224
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I *think* this is what you are trying to do . . .


string $visPanel[]=`getPanel -vis`;
int $mode;
if (size($visPanel)>0){
for ($panel in $visPanel){
if (`match "^modelPanel" $panel`=="modelPanel"){
$mode=`isolateSelect -q -state $panel`;
if ($mode>0){
isolateSelect -state 0 $panel;
isolateSelect -loadSelected $panel;
}
else{
isolateSelect -state 1 $panel;
isolateSelect -addSelected $panel;
}}}}

BTW . . I found the solution by looking up the example code in the MEL command referece, then dispite the fact that I did not know what the hell it was doing, I just played around with it in the script editor til I found the missing essential part that was not contained in the code you had listed . . . . The MEL command reference is a great place to look if you have a problem, because it gives you example code demonstrating how the command works . . . in this case however, their code did not work, but I was still able to extract what I needed from it to get some results . . .
__________________
"The Sage as an Astronomer: If you still see the stars as something above you, you lack the eye of knowledge." Friedrich Nietzsche
skywola is offline   Reply With Quote
Old 05-09-2006, 09:47 PM   #8
Falott
Registered User
 
Falott's Avatar
 
Join Date: Jan 2005
Location: vienna
Posts: 1,095
Thanks: 3
Thanked 20 Times in 18 Posts
Default

let me say you are my personal superhero!

my problem is I dont understand mel enough to fiddle around in a somewhat constructive way. I can fiddle around but it is so intuitive and mostly doesnīt work. Iīd very much like to say Iīve got too less time to learn mel but in fact I guess Iīm just a lazy guy.

thx again, itīs working now.
__________________
everything starts and ends in the right place at the right time.
Falott is offline   Reply With Quote

A little bit about who we are
Links you might find useful
Catch up with SimplyMaya
SimplyMaya specialises in Maya tutorials. We offer over 1,000 individual Maya training videos, ranging from basic Maya tutorials through to intermediate Maya tutorials. Our tutorials are created by instructors with industry experience and are designed to get you up and running in Maya quickly without making it seem like hard work.

Copyright © 1999-2015 SimplyMaya - vBulletinŪ Copyright © 2000-2015, Jelsoft Enterprises Ltd.