View Full Version : delete shelves in a go?
12-18-2009, 11:51 AM
Hey. I would like to delete mayas shelves all in one go. So I thought of using the deleteShelfTab command
deleteShelfTab Custom; which makes a confirmDialog pop-up
but instead of having to manually click the confirm button from the confrimDialog popup for every shelf, how can I execute the confirm command in code?
I tried to read and understand the script itself, but sadly to say I couldn't
So I have to turn to you bright fellows and steal your time if you have any to share :)
Merry Christmas by the way
12-18-2009, 05:28 PM
In the deleteShelfTab.mel script you can find the following part of code:
if ($cancel == `confirmDialog -title (uiRes("m_deleteShelfTab.kConfirm"))
-message $dlgMsg -button $ok -button $cancel -defaultButton $ok
-cancelButton $cancel -dismissString $cancel `)
This is where the popup asking you if you want to delete the shelf is created.
Copy the whole script and rename it to whatever you want to call it. Don't forget to rename the procedure aswell. Then all you have to do is remove the confirmDialog part of the code from your newly created custom script.
Now you can use this new custom procedure to delete a shelf without the popup confirm dialog.
Hope this answers your question.
PS. Visste inte om att det fanns studenter pa Game Acadamy som holl pa med MEL.
Efter mitt senaste besok dar trodde jag alla ville bli concept artister eller modellerare.
God Jul & Gott Nytt ar pa dig med.
12-20-2009, 07:05 PM
Thanks. I never thought of that. Perfect!
I'm just curious if it's possible to add another string to the command to delete it or is this the way it has to be done. One other apporach I could think of is by querying the active confirm dialog and execute it's "confirm button". But I'm not sure if this is even possible
Thanks alot again.
PS. Det är möjligt att det verkade så då (ledsen, kommer inte ihåg dig och när du besökte oss) och det stämmer väl visserligen fortfarande. Däremot tror jag folk har blivit klarare på vad de vill göra så vi har även folk som är intresserade av animation och t.ex. jag som vill lära mig mer om scripting. Åh, btw, vi har bytt namn till "The Game Assembly" efter en namnkrock med en tysk utbildning.
och gott nytt år!
12-21-2009, 10:02 AM
btw.. you get all available shelf layouts via:
tabLayout -q -ca ShelfLayout;
and there is still: deleteRandomShelf (http://www.creativecrash.com/maya/downloads/scripts-plugins/interface-display/c/delete-random-shelf) :D
Jag var också under 2001 vid Games akademin i Berlin! Roligt, att det finns ett Game Academy i Sverige (eller var) ;]
12-21-2009, 12:50 PM
I tried some and seems I found a stable solution by using the following:
if (`shelfLayout -q -ex Animation`)
deleteUI -layout Animation;
And adding this one after the other, putting them in a script file which is executed upon restart which deletes them every time. So If you want them back, all you have to do is delete the lines from the script or just comment them out. This instead of having to manually removing the "deleted" suffix appended to each shelf file in the prefs folder.
I'm confused though. Seems it works aswell without using the -layout flag. Also I understand I want to delete a UI element, but shouldn't I really try to find a shelfLayout to delete?
Anyway, it seems to work fine now. Thanks alot for the tips. Really wanted to just skip copying a scriptfile and changing it even though it's a working hack and something I will think about for future scripts perhaps.
Thanks to the both of you!
Jaha så du gick där. Hur kom det sig att du sökte dig till Tyskland? Nog måste det ha funnits utbildningar även här vid den tiden?
12-21-2009, 02:08 PM
Mayas UI-scope is actually more rigid than the DAG! You actually can't have an element with the same name even under different layouts! (though you know, you could have a pCube1 under group1 and group2). So even if you name your layout "X" there could always be only 1 UI-element with that name.
if you find `shelfLayout -ex Animation` you can be sure that `deleteUI Animation` kills exactly that shelfLayout!
But of course you could work with paths as well!:
I'm actually writing an awesome UI-Editor for Maya... maybe I get it done over holidays ;]
Es tu'm ledsen. "Google Translate" något kommer till sin spets ... Jag var en av de första kurserna. Vid den tiden, bara 7 månader. Numera kan man göra där 2 års utbildning. I tiden, dock har jag jobbat 8 år i yrket.
12-21-2009, 04:53 PM
Ah, thanks for clearing that up. Makes perfect sense.
Yeah, it's nice to be able to spend time on other stuffs during the holidays. That UI editor, how's that supppsed to work? sounds interesting.
Ah, i see. Google translator kinda translated the previous msg quite well =)
12-21-2009, 04:53 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.
vBulletin v3.0.5, Copyright ©2000-2014, Jelsoft Enterprises Ltd.