PDA

View Full Version : Docking My Own Toolbox ?


E D G E C R A F T
04-05-2006, 02:06 PM
Hi,

is there an easy way to dock my own toolbox ? I want to be able to add an extra icon to the top right hand corner where you can switch between the channel box / tool settings and attribute editor, and when I press that icon, my own interface appears, susbequent searches have sent me off on all sorts of tangents, is there a nice quick way to do this ? or a tutorial somewhere that will explain the process easily ?

Please help!

Mikademius
04-05-2006, 02:18 PM
I know that mr. Motion has done something similar. Why don't you check out his scripts:
mr.Motion's website (http://www.mrmotion.net)

E D G E C R A F T
04-05-2006, 02:36 PM
Thanks, I've seen a few examples of docking into the channel box, but not a full example of 'whole' replacement, still need to see how to do that ?

Mikademius
04-05-2006, 02:43 PM
Andy did create a new button for the hypershade in his UI videos. Check if you can grab them from his thread. Search for UI building or something.

goleafsgo
04-05-2006, 02:57 PM
Most of the MEL that you would need to look at is in UIComponents.mel. If you are comfortable with MEL you could poke around in there to see how things work.

E D G E C R A F T
04-05-2006, 03:02 PM
Thanks guys, more amateur atm with Mel! :)

I'll dig around further and see what I can find, thanks

E D G E C R A F T
04-05-2006, 04:08 PM
Nope, having no luck here :(

Just can't figure out what I need, it's easy enough copying and pasting mel scripts together from the script editor, and some basic UI type stuff, but don't know where to start with this at all..... :(

goleafsgo
04-05-2006, 08:51 PM
I could try to write something up about doing it...maybe I'll post it in my Portfolio blog :)
I really don't have any art to put there so...

(This is not a promise to make a tutorial but if I have time I'll let you know)

E D G E C R A F T
04-06-2006, 08:51 AM
Thanks, that's a nice offer.

I'll keep looking into the other scripts in the meanwhile. :)

Regards

RyanT
04-06-2006, 08:14 PM
If you want to add a button where the channel box buttons here is how you do it. First you need to locate the statusLine.mel script. This is located in: ProgramFiles\Alias\Maya_Version\scripts\startup
Copy the script to your MyDocuments\Maya\Version\Scripts\ folder.

------WARNING: If you screw this script up Maya will NOT start. The only way to kill the program is to go to your task manager and end the process of Maya. Also if Maya gets any updates you will likely need to copy your changes to the new version of this file.------

The spot you need to add your buttons to is roughly around line 2738. I say roughly because I have added to the version I have. This is where you add the button but you still need to write a proc to add the panel. I only know how to add a panel to the channel layers side. Messing with the Maya UI is tricky because the node based UI is all parented together. (cough Max takes one line of code to dock your panels anywhere in the UI. /end cough). Anyways note you need to also add a proc to the $channelBoxLayerEditorButton in the script. The reason for this is when the channel button gets clicked you need to return the UI back to normal.

So you will need something like this to set up the state of the channel bar.


//This code will return your UI back to its original state. A channel panel on top and the layers on the bottom.
//Force layout to be two panels
string $paneNames[] = `paneLayout -query -childArray ChannelsLayersPaneLayout`;
int $i = 0;
for($pane in $paneNames)
{
$i++;
paneLayout -edit -configuration "horizontal2" -setPane $pane $i ChannelsLayersPaneLayout;
}



Thats not all though. That just makes sure your in the correct state to add the panel you want to add. Or how to get back to the original state. Now you need to add your panel to the channel bar.


setParent ChannelsLayersPaneLayout;

formLayout FooForm;
scrollLayout -hst 8 -vst 8 -cr 1 Scroll;
columnLayout -w 100 -columnWidth 100 -rowSpacing 1 -columnAlign "center" -co "both" 2 MainColumn;
formLayout -edit
-attachForm Scroll "top" 1
-attachForm Scroll "left" 1
-attachForm Scroll "right" 1
-attachForm Scroll "bottom" 1
FooForm;

button -w 50 -h 20 -label "Test";
paneLayout -e -cn "horizontal2" -setPane FooForm 2 ChannelsLayersPaneLayout;


You need to add whatever buttons ect. you want to the MainColumn.

Hope that helps.
-RyanT

E D G E C R A F T
04-07-2006, 08:55 AM
Thanks, Ryan, that's really helpfull, I'm going to try this out, I'll let you know here how I get on.

Regards

azshall
04-07-2006, 06:29 PM
i sure wish everything on Mr. Motion's site wasn't Norwegian, anyone able to translate or know of a webpage translator?

az

Mikademius
04-07-2006, 07:23 PM
The reason the tutorials are in Norwegian is because as a teacher he had to write ithem in norwegian. The system is built that way :) Maybe he'll translate them if you send him a PM.

And I agree that writing tutorials in any other language than english is annoying!

goleafsgo
04-10-2006, 04:05 PM
I've added a tutorial (in English) on how to add your own custom UI to Maya in my CGPortfolio blog. If you try to add something on your own then let me know if you were able to follow it.

There is a description in one post on how to edit a few of Maya's MEL files to get your UI in there, and then another post containing the one new MEL file that you have to add for the example to work.

E D G E C R A F T
04-10-2006, 04:42 PM
Thanks a lot, I'm still working my way around it, so that should prove useful, I'm comfortable enough with UI work in the form of my own script windows and such, but this should help me with full UI integration. Thanks

CGTalk Moderation
04-10-2006, 04:42 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.