Thread: undocking
View Single Post
# 6 29-11-2006 , 11:03 AM
enhzflep's Avatar
Subscriber
Join Date: Oct 2006
Location: Melbourne
Posts: 313
Been getting into a bit of MEL today, just trying to customize the interface a bit and create a few convenient shortcuts.

I found a way to float a channel box and a way to group custom commands together like a torn-off menu.

Firstly was a script that'll create a floating window that will in this very brief instance allow you quickly set the render-type.

// Exerpt from a new script found on **highend3d**
//
window -title "Render Type";
columnLayout -adjustableColumn true;
button
-label "HW Render"
-command "setCurrentRenderer mayaHardware;";
button
-label "SW Render"
-command "setCurrentRenderer mayaSoftware;";
button
-label "MR Render"
-command "setCurrentRenderer mentalRay;";
showWindow;


There was another thread floating about somewhere about somebody that wanted to be able to turn backface culling on and off reasonably often. It's a bit of a pain to get to, being a drop-down box in Display->Custom Polygon[].

This would be an ideal place for such a command when grouped with other custom commands.

But anyhoo, looking through to check out the available control types to a mel script(button, cobo-box etc) I spotted one for a channel box.

A (very, very) slightly modified version of the code in the maya help examples is:

window -title "My Channel Box";
formLayout form;
channelBox cBoxID;
formLayout -e
-af cBoxID "top" 0
-af cBoxID "left" 0
-af cBoxID "right" 0
-af cBoxID "bottom" 0
form;
showWindow;


As far as I can tell, cBoxID is just an identifier used when setting the form up, there seem to be no nodes with it's name.

Also, something of a nuisance is the fact that custom created windows appear to lose their title when minimised, being numbered sequentially Window1 Window2 etc.

Even without two monitors this is pretty nifty since you can size the window both vertically and horizontally.

Hope it's helpfull.
Simon.

edit: Opps, I was wrong it wasn't 3dtotal it was here:
https://www.highend3d.com/maya/tutorials/


Last edited by enhzflep; 29-11-2006 at 02:26 PM.