PDA

View Full Version : Isolate Select - turn on AutoLoad NewObjects


Haider of Sweden
09-21-2006, 08:29 AM
Hello,

by echoing the MEL commands, I found out that activating the Auto Load New Objects under Isolate Select gives me:
isoSelectAutoAddNewObjs modelPanel4 1;

I couldnt find any help topic for that (I guess I am looking for the wrong command)
Apearently, I need to add the modelPanel name to the command above. I wonder how I can run that command so that it affects all the viewports.

This little script will be used toghether with an existing Isolate Toggle MEL. The toggler itself works great, but I need to activate the Auto Load New Objects all the time and I'd like to avoid needing to.

Thanx in advance.

Mikademius
09-21-2006, 12:10 PM
A whatIs gave me this:

whatIs isoSelectAutoAddNewObjs;
// Result: Mel procedure found in: C:/Program Files/Alias/Maya7.0/scripts/others/createModelPanelMenu.mel //

Maybe you can look it up there.
Can't you just loop through all the modelPanels? To set it for all of them?

Haider of Sweden
09-22-2006, 11:43 AM
Hey Martin, thank you.

I am not sure yet if looping through the viewport is the right way to do - but your tip about "whatIs" is cool. I never knew of that command before, but I've been thinking about it.
I used to search for a particular string/command inside all the MEL, and not everytime, I managed to find the MEL file that I was looking for.

Thank you for that one at least :)

Mikademius
09-22-2006, 02:33 PM
Even though you didn't want to loop I had to try :)
I was thinking that if I could find a way to list all the modelPanels I'd be able to set the settings for all of them. I searched for several list commands, but ended up using getPanel command...


string $getAllPanels[] = `getPanel -allPanels`;
print $getAllPanels;


Now Maya will list all the panels, but we only want the modelPanels. We need a way to filter out the modelPanels. This, a loop with a match can do for us.


for ($panels in $getAllPanels){
string $matchPanel = `match "modelPanel" $panels`;
if ($matchPanel == "modelPanel"){
print ($panels + " is a modelPanel" + "\n");
}
}


So if you replace my print command here with your command it should work :)


string $getAllPanels[] = `getPanel -allPanels`;
print $getAllPanels;

for ($panels in $getAllPanels){
string $matchPanel = `match "modelPanel" $panels`;
if ($matchPanel == "modelPanel"){
isoSelectAutoAddNewObjs $panels;
}
}


However I would have figured out what the isoSelectAutoAddNewObjs does and rewrite it to fit this script. No point using procs you don't know what do now is there? ;)

CGTalk Moderation
09-22-2006, 02:33 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.