MEL - Maya UI Building


#21

try this

window -t “Tab Window” -w 240 -h 430 ;

string $tabs = tabLayout -innerMarginWidth 5 -innerMarginHeight 5 -scr 1 -hst 16 -vst 16 -cr 1;

string $tab1 = columnLayout -adj 1;
setParent…; setParent…;
string $tab2 = columnLayout -adj 1;
setParent…; setParent…;

tabLayout -edit
-tabLabel $tab1 “Animation”
-tabLabel $tab2 “Rendering”
$tabs;

showWindow;

i used this layout to put all scripts that i have collected (from highend and simplymaya, and some scripts of jason.) into one window.

note that the -scr flag makes your tab layout sctollable.

and here’s the zip file of the ui that i did.

hope this helps.

:thumbsup:


#22

h0Tice, worked great, thanks for that one


#23

no prob bro

:smiley: :beer:


#24

I want to place a “helpLine” at the bottom of a UI. This UI consists of one main tabLayout, and each tab is itself a separate formLayout. So every time you select a different tab, a different formLayout is shown. Problem: I noticed that UI´s do not support multiple helpLine controls (at least that´s what it seems like). I tried to put a separate helpLine at the bottom of each formLayout (in this case I tried it on 2 different form layouts), however the first helpLine in the first formLayout was no longer responsive- only the second helpLine (the last one I created) worked.

Question: is there a way to place the same helpLine control under multiple form layouts? In this case, the same control would have multiple parents. I´ve actually tried placing the helpLine with the same control name under different fom layouts, but still only the last helpLine was responsive. I would also like to avoid rebuilding the entire UI when I select a tab.

:beer:
David


#25

why dont you do something like this (pseudo code)


window
       $main= formLayout
              tabLayout
                     tab 1
                     tab 2
                     tab 3
       setParent $main
       
       helpLine
showWIndow

Then attach the helpLine to the bottom and the bottom of the tabLayout to the helpLine, or something like that


#26

Yeah, that´s my alternative. But I wanted to avoid this just because the way the UI is built it seems more intuitive if the helpLine is inside the tabLayout, not out.

-david


#27

Originally posted by dwalden74
Yeah, this stuff with the dimensions of windows/controls has always been a mystery to me as well. Even when you specify explicit w/h it just kinda´does what it wants. The only real way to fix the size of a window in my experience is to use -sizeable 0, but that of course fixes it at the specified size. There´s probably a logic somewhere to this but I stopped searching for it, …

… but for those who still care: the usage of setting optionVars for frequently used productionscripts is not as widely popular as the power of the command would deserve! and besides - setting up and drawing information from (just like e.g. windowSize and -Position) an optionVar is a) personal and b) not the least as complicated as understanding formLayout! :wink:

my2P’sworth…
s.


#28

I’m looking for something about UI building in maya.

I’d like to know if it’s possible to make a realtime camera view or a render view inside a layout that is in a window .

If yes, could someone explain me what type of command and flags should i use to do that ?

thanks


#29

yah cipher, that would be great just like how xsi has the draw render region? if you get that accomplished please let everyone know.


#30

Hello every1, I am quite new to Maya and MEL, and I was looking for some information:

What is the Name of the Script Editor Window in MEL?

I found out about:

  • Outliner : outlinerPanel1Window
  • Hypershader: hyperShadePanel1Window
  • Attributes: AEWindow

But for the Script Editor Window my method didnt work! (Turn on ‘Echo All Commands’ in the Script Editor window and read what it does…)

So, hopefully some pros out here can help me out:-)
greetz


#31

ScriptEditor;


#32

As far as I understand the matter till now, ScriptEditor; is a script that does this:

showWindow $gCommandWindow;

Now I would like to write a Script to close the ScriptEditor. How can I deal with this in MEL? Any suggestions?


#33

You cannot use “deleteUI $gCommandWindow” for that particular case. But you can use this:
window -edit -vis 0 $gCommandWindow;


#34

Originally posted by takashiuan
[B]As far as I understand the matter till now, ScriptEditor; is a script that does this:

showWindow $gCommandWindow;

Now I would like to write a Script to close the ScriptEditor. How can I deal with this in MEL? Any suggestions? [/B]

try this…

//toggle the script editor

{

string $scriptWin = $gCommandWindow;

int $scriptTog = window -q -vis $gCommandWindow;

if ($scriptTog == 1)

window -edit -vis 0 $scriptWin;

else

showWindow $gCommandWindow;

};

//get the last panel that had focus

string $returnPanel = getPanel -wf;
setFocus $returnPanel;


#35

Hey guys,

I am attempting, with much frustration, to just put an image as the background of a UI window for the purpose of creating a custom character rigging tool. I am using OSX and as far as I know you can use .bmp, .xpm or .iff for the image. When I use the command image -i path file name , the window comes up, but doesn’t display the image or an error. This is what I have thus far:

window -ra;
window -widthHeight 450 530 -title “Goblin Control” gobWin;
formLayout;

image -vis 1 -image "/Volumes/Storage/Projects/MEL_CharacterUI/GoboUI_background.xpm";

showWindow;


#36

Hey everyone,

I just have a question that nobody seems to know how to answer, so maybe you could help…

I am building a Maya UI, and I need to include a timeline for the user to scroll through… ok no problem…

BUT, it also needs to be able to show the keys…of selected objects and I CAN NOT for the LIFE of me, figure out how to get this to work

I used modelPanel and a timePort widget. I’ve tried using the timeControl function to edit the timePort in my UI and i get an error saying that a time Control already exists.

Any help will be great!.. thanks if nobody knows, maybe you could refer me to a … book, online source, or person that is knowledgable enough to help me? This is so important that I get this working and I’ve been pulling my hair out for over a week now.


#37

hi guys, im trying to use the MJ Poly Tools in maya 6 but the script doesnt run…do you know if it doesnt support maya 6 ?? but at the same time it works on maya 5 even though it says its for maya 4 ???

thanks


#38

[QUOTE=jedijrmax]Hey everyone,

I am building a Maya UI, and I need to include a timeline for the user to scroll through… ok no problem…

BUT, it also needs to be able to show the keys…of selected objects and I CAN NOT for the LIFE of me, figure out how to get this to work

QUOTE]

Here is how i get it to work with a row layout… basic

rowLayout -nc 3 -ad3 3 -cw3 118 115 791 -cat 3 “left” 10;
symbolButton -i “C:\images\kbnimages\knkey.bmp”
-c " setKeyframe (up to ?)"; // you set it up
symbolCheckBox
-ofi “C:\images\kbnimages\knkey.bmp” // i made my own images
-oni “C:\images\kbnimages\knkey.bmp” // i made my own images
-onCommand " setKeyframe (up to ?)";
symbolCheckBox
-ofi “C:\images\kbnimages\knplay.bmp” // i made my own images
-oni “C:\images\kbnimages\knstop.bmp” // i made my own images

-onCommand “play -forward true” -offCommand “play -state off”;
timePort;
setParent…;

But you can use maya images if you like, but when i’m making a gui. I like to have 13 pieces of flare…


#39

Here’s some kind of problem I’ve beed fighting for a while.
For example I want to add some menu items to one of maya’s menus( Polygons for instance).
I can use the set parent command or -p flag to parent my item to needed menu. I’t seem’s to work ok while I’m adding the item after maya have already started, but once I add it to user setup to add the menu item every time maya starts it kills the whole menu, leaving only my item, which I intended to add.
Is there something I’m missing?


#40

Mr Hawk, the best way to go about adding menu items to maya’s current menu lists, is to copy the menu list from the Alias/maya6.0/scripts/startup (or /others) directory, and copy them into your local scripts directory, and just modify the contents.