View Full Version : MEL - User Interface questions...

05 May 2003, 04:48 AM
This will probably probably be pretty simple, but I have a few questions about MEL UIs that I hope someone will be able to answer for me.

First of all, here is my code for my window thus far...

global proc davesavewindow() {
string $dswindow = "davesavewindow";

// if davesave window exists, delete it.
if (`window -exists $dswindow`) deleteUI $dswindow;

// now create new davesave window.
$dswindow = `window -title "davesave v-1.0" -mnb 1 -mxb 0 -bgc 0.0 0.0 0.0 -tlb 0 -rtf 1 -s 1 -wh 640 480 davesavewindow`;

// set working parent to be GUI window.
setParent davesavewindow;

// add column construct.
columnLayout -bgc 0.0 0.0 0.0 ColumnLayout;

// set working parent to columnLayout.
setParent davesavewindow|ColumnLayout;

// create a frame for the layout.
frameLayout -label "" -li 0 -lv 0 -cll 0 -bgc 0.0 0.0 0.0 -marginWidth 5 -marginHeight 5 -width 630 -height 460 FrameLayout;

// set working parent to columnLayout.
setParent davesavewindow|ColumnLayout;

// create a status bar.
textField -text "Ready" -editable false -width 630 -height 20 StatusLine;
string $sbarPath = "davesavewindow|ColumnLayout|StatusLine";

// finally, show GUI
showWindow davesavewindow;

Now this produces this window:

Why, if all of my background colors (-bgc) are set to black (0.0 0.0 0.0 for r g b respectively), is there a huge windows default block in the middle of my UI? I don't understand why that would happen.

Also, I have noticed a lot of -bgc modifiers for interface controls, but nothing about the font color (foreground color)... is it possible to set this as well? I couldn't imagine MEL would be so shortsided not to allow that.

One more question... I was wondering if it is possible to grab the names of all the cameras in the open Maya scene file. If so, can someone point me to the command that might do this?

Thanks for all of your help! :)

05 May 2003, 04:55 AM
Did you try putting something in the window to see if that would do it?

Is this what youre looking for as camera names?

// Create a camera and get the shape name.
string $cameraName[] = `camera`;
string $cameraShape = $cameraName[1];

05 May 2003, 04:57 AM
No... but the frame has a width and a height, so it should at least fill the area with the background color, which is black. :shrug:

Of course, any text I put in there will also be black, unless I can change the foreground color... :banghead:

05 May 2003, 05:02 AM
//getCamera Names

string $cameraShape = $cameraName[1];

I think this is all to get camera here...

05 May 2003, 05:06 AM
Well, I don't want to create cameras using this UI, just want to be able to build a list of the cameras in the scene when the window is either launched or refreshed.

05 May 2003, 05:11 AM
Well that would just be

//getCamera Names

string $cameraShape = $cameraName[1];

I'm think font colors are going to be depentent on user inter face the main application UI....I dunno...
displayRGBColor [-q] [-hsv] name r g b | [-list]
displayRGBColor -list
displayRGBColor -resetToFactory

05 May 2003, 05:19 AM
$cameraName[] is a variable... Maya doesn't know what it is unless you define it previously. And I don't really want to change ALL display colors... just the foreground text for my MEL UI. I still can't understand why they allow you to change the background color if you can't change the foreground color as well. Seems kind of stupid to me. :annoyed:

05 May 2003, 05:32 AM
This command lists all cameras... DUR... should've known. :p


05 May 2003, 06:22 PM
Well now let us know something if you find out anything on those other issues.

05 May 2003, 12:32 AM
Well, first of all, here is the updated GUI... it's not very pleasant, but that's because I can't figure out how to change the text color. I will probably go back to just using the default colors, but I had to see if changing them would work.

NOW, I'm having a problem with everything in the image above which is not checked or highlighted. It seems only 5 contols can be clicked on the form... the rest just act as though they are inactive. I didn't set them up to be inactive, so I was wondering what is going on? If you would like to try out the mel script, you may download it here ( It doesn't do anything except display the window, but I thought people might understand more what the problem is if they could interact with the interface themselves. (Also, you can grab the window logo here ( You will have to change the location of the image in the script to match your own file system. For some reason, I could not make it relative.)

If anyone can tell me why it seems only a certain number of controls would work (even though I have all the controls inside different layouts), please respond! Thanks! :)

11 November 2005, 10:49 AM
TiKiMoN, well I have the EXACT same problem as yours about text color in my UI !! it's been a while since u posted, so I was wondering if u figured out the solution already ?! if u did then plz tell me how u did it cuz I'm LOST :shrug:

CGTalk Moderation
11 November 2005, 10:49 AM
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.