Outliner Divider


So a while ago I was watching a tutorial series for Maya dynamics and the guy giving the class was pedantic about keeping his scene clean and orderly. He would create an empty group, go into rename it and spam the "__" key then just use that group as a cool visual divider for his Outliner. 

Now if something is worth doing its worth overdoing right? Thus I present my new creation, The Outliner Divider tool! This was one of those things that started as a simple button that would create groups, lock and hide all of their channels. But then I remembered you could change colours of things in the Outliner. So I set out to make a bunch of funky colour variations. This presented a very interesting challenge. 

I could have quite easily created a new Proc for each colour button and just alter what each button sets the colour to be. However that would be a senseless waste of lines. What if I could have one master procedure that coloured the button depending on what the Background colour (-bgc) of the button was set to? 

Here we have a snip of my UI Layout. I've set the -bgc to some cool colours I liked, then the command that is called is my "Create" procedure. In brackets I'm declaring the colour that has been chosen as a string, then following this I'm naming that button as that same colour. 

What this translates to is when the procedure is run it receives the $Colour string with the name of whatever button was pushed's name in it. Then within the procedure I can query the correct button's background colour and set that as the group's outliner colour. 


Simple and sweet. But once again returning to the theme of if its worth doing its worth OVER doing right? So I slipped in a simple If statement to check if anything was selected. Now if a user selects something it will change that things colour, If nothing is selected it will create a divider. 

Foot note: I found this PDF very useful with finding colours in 0-1 values as Mel insists on not using 0-255 like every other sensible application. 


Feel free to grab a copy of this script off my GistHub. 

-Sheep 



Comments

Popular Posts