delete shelves in a go?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Display Modes
  12 December 2009
delete shelves in a go?

Hey. I would like to delete mayas shelves all in one go. So I thought of using the deleteShelfTab command

Like so:
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 December 2009
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 `)
return $returnStatus;

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 December 2009
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.
God Jul!
och gott nytt år!
  12 December 2009
btw.. you get all available shelf layouts via:

tabLayout -q -ca ShelfLayout;

and there is still: deleteRandomShelf

Jag var också under 2001 vid Games akademin i Berlin! Roligt, att det finns ett Game Academy i Sverige (eller var) ;]
  12 December 2009
Thanks alot!

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 December 2009
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!:

deleteUI "MayaWindow|mayaMainWindowForm|formLayout2|formLayo  ut14|formLayout15|formLayout51|ShelfLayout|Animati  on";

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 December 2009
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 December 2009
Thread automatically closed

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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 10:17 AM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.