Substance Painter
In this start to finish texturing project within Substance Painter we cover all the techniques you need to texture the robot character.
# 1 04-09-2006 , 05:49 AM
Falott's Avatar
Registered User
Join Date: Jan 2005
Location: vienna
Posts: 1,095

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.
# 2 04-09-2006 , 09:00 AM
skywola's Avatar
Registered User
Join Date: Jan 2004
Location: Tempe, Arizona, USA
Posts: 224
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
# 3 04-09-2006 , 09:09 AM
skywola's Avatar
Registered User
Join Date: Jan 2004
Location: Tempe, Arizona, USA
Posts: 224
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
# 4 04-09-2006 , 02:17 PM
Falott's Avatar
Registered User
Join Date: Jan 2005
Location: vienna
Posts: 1,095
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. user added image


everything starts and ends in the right place at the right time.

Last edited by Falott; 04-09-2006 at 02:19 PM.
# 5 05-09-2006 , 06:14 AM
skywola's Avatar
Registered User
Join Date: Jan 2004
Location: Tempe, Arizona, USA
Posts: 224
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
# 6 05-09-2006 , 11:25 AM
Falott's Avatar
Registered User
Join Date: Jan 2005
Location: vienna
Posts: 1,095
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.
# 7 05-09-2006 , 02:41 PM
skywola's Avatar
Registered User
Join Date: Jan 2004
Location: Tempe, Arizona, USA
Posts: 224
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
# 8 05-09-2006 , 08:47 PM
Falott's Avatar
Registered User
Join Date: Jan 2005
Location: vienna
Posts: 1,095
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.
Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads