Tuesday, February 11, 2014

Maya MEL ui buiding Tip

Hi

Today i wanted to put a few ui's into one but didn't know how to go about it.  What helped me get a start on it was to just use buttons with builtin in print commands .. this way dont have to worry about the real code more complicated code..  Then I explored in the images below how to make multiple ui's into one larger ui.  Hope these images are helpful:




And here is the testing code i wrote for the last one in MEL
window;
 columnLayout;
  frameLayout -label "Great Day A" -borderStyle "etchedIn";
   columnLayout;
    button -label "Great Day!"
    -command "print \"Great Day Today!!!\\n\"";
   columnLayout;
    button -label "Hurraay!"
     -command "print \"It is a Great Day!!\\n\"";
  //
  frameLayout -label "Great Day B" -borderStyle "etchedIn";
   columnLayout;
    button -label "Great Day!"
    -command "print \"Great Day Today!!!\\n\"";
   columnLayout;
    button -label "Hurraay!"
     -command "print \"It is a Great Day!!\\n\"";

major take aways:
--simplifying problem by looking at simple print command buttons
--experimenting with different syntax by having great scripting reference books ...
--slowly begin thinking how to integrate the real code into it ...


cheers,
-Nate


Inspired by David Gould's Complete Maya Programming (An Extensive Guide to MEL and the C++ API)