PRIMITIVE MEL


Creating any object, type in the script editor or the Command Line:

sphere
cone
torus

(will give nurbs result by default, and/or put nurbsCube, nurbsCylinder, etc.
polySphere
polyCone
polyTorus
polyCube

(will give poly result)

anything in one name..
camera; pointLight; spotLight; etc.

making a popup WINDOW:
(be sure to create something and name it “Sphere”, it does not have to literally be a sphere)

window -title "My Window" -widthHeight 300 200 ;
columnLayout ;
button -label "Select" -width 100 -command "select -r Sphere" ;
button -label "Unselect" -width 100 -command "select -cl" ;
showWindow;

or

window -title "My Window" -widthHeight 300 200 ;columnLayout ; button -label "Select" -width 100 -command "select -r Sphere" ; button -label "Unselect" -width 100 -command "select -cl" ;attrFieldSliderGrp -label "Move Sphere Up and Down" -minValue -20 -maxValue 20 -columnAlign 1 left -attribute Sphere.ty;
showWindow;


or

window -title "My Window" -widthHeight 300 200 ;
columnLayout ; button -label "Select" -width 100 -command "select -r Sphere" ; button -label "Unselect" -width 100 -command "select -cl" ;
attrFieldSliderGrp -label "Move Sphere Up and Down"
-minValue -20 -maxValue 20 -columnAlign 1 left
-adjustableColumn true -attribute Sphere.ty;
attrFieldSliderGrp -l "Move Sphere Side to Side"
-minValue -20 -maxValue 20 -columnAlign 1 left
-adjustableColumn true -attribute Sphere.tx;
showWindow;

and further..

window -title "My Window" -widthHeight 300 200 ;
columnLayout ;
button -label "Select" -width 100 -command "select -r Sphere" ; button -label "Unselect" -width 100 -command "select -cl"; attrFieldSliderGrp -label "Move Sphere Up and Down"
-minValue -20 -maxValue 20 -columnAlign 1 left
-adjustableColumn true -attribute Sphere.ty;
attrFieldSliderGrp -l "Move Sphere Side to Side"
-minValue -20 -maxValue 20 -columnAlign 1 left
-adjustableColumn true -attribute Sphere.tx;
attrFieldSliderGrp -label "Move Back to Front"
-minValue -20 -maxValue 20 -columnAlign 1 left
-adjustableColumn true -attribute Sphere.tz;
attrFieldSliderGrp -label "rotate on the X"
-minValue -20 -maxValue 20 -columnAlign 1 left
-adjustableColumn true -attribute Sphere.rx;
attrFieldSliderGrp -label "rotate on the Y"
-minValue -20 -maxValue 20 -columnAlign 1 left
-adjustableColumn true -attribute Sphere.ry;
attrFieldSliderGrp -label "rotate on the Z"
-minValue -20 -maxValue 20 -columnAlign 1 left
-adjustableColumn true -attribute Sphere.rz;
attrFieldSliderGrp -label "scale on the Z"
-minValue -20 -maxValue 20 -columnAlign 1 left
-adjustableColumn true -attribute Sphere.sz; showWindow;

and for practical use in a character:
(note the accepted abbreviations this time)

//enter this within a bones named as below and min.max rotations

window –t “Character Controls” wh 400 600;
columnLayout –adj true
button -1 “left Arm” –c “select –r LtArm”;
button -1 “left Arm” –c “select –r RtArm”;
button -1 “left Arm” –c “select –r LtLeg”;
button -1 “left Arm” –c “select –r RtLeg”;

out commenting:
either by a double forward slash: //
or commented out internal parts with: /*comments*/