PDA

View Full Version : Get name of tearOffCopy view panel ? (MEL)


Horganovski
11-15-2012, 01:24 AM
Another one that should be simple I think but a little stuck on something.

Often I do a 'tear off copy' command to make a 2nd viewport and then I usually hide manipulators and curves in the copy. I want to make a script that will do that in one command, I have all the parts really, but I can't seem to get the name of the new panel.

For example. I do this :

string $oldPanel = `getPanel -wf`;
string $newPanel =`tearOffCopyItemCmd modelPanel $oldPanel;


But since the 'tearOffCopyItemCmd' is a script and has no option I can see to set the name I'm stuck, I tried using something like string $panelsVis[]=`getPanel -vis' to find the new panel, but it doesn't seem to work until after the script has run, ie if I run it during the script it only returns the original one.

I'm sure it's something simple.. any ideas appreciated.

Cheers,
Brian

ldunham1
11-15-2012, 08:48 AM
almost there lol.
The modelPanel has a -tearOffCopy flag that does exactly what you want.

string $oldPanel = `getPanel -wf`;
string $newPanel = `modelPanel -toc $oldPanel` ;

Horganovski
11-15-2012, 02:29 PM
Heh heh, pretty close indeed, but not close enough obviously!

That works great, many thanks.

Cheers,
Brian

CGTalk Moderation
11-15-2012, 02:29 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.