Here is some more Diamond BQ for your eyes.
Stay Frosty
//select the mesh you desire to randomise the verts on and run scriptReflection: Being my first experience with programming I am quite happy with the script I have created. The course, along with the text book MEL Scripting for Maya Animators by Mark R. Wilkins, Chris Kazmier and Stephan Osterburg , gave me a basic understanding of MEL programming which I believe will be extremely valuable in the future.
//Click button with mesh selected and BAM the verts randomise
if(`window -exists rVerts`)//Checks to see if window exists
deleteUI -window rVerts;//If the window exists it is closed
window -title "Randomize Verts" //Puts a title on the window
-widthHeight 100 100 //Width and Height of window
rVerts;
columnLayout;//The type of layout of the window
button -label "Randomize" -command randomVerts;//the button name and command it will execute
showWindow rVerts; //shows the window
proc randomVerts()
{
$Selected = `ls -sl`; // this line lists the selceted objects and defines what $selected will do
$myVerts = `getVerts`; // this line grabs all the vertices of selected objects and puts them into a string array represtented by $myVets
for ($vert in $myVerts) // this line says for every Vertice selected in the array of $myVerts to run the following commands
{
float $randNumX = rand ( -0.5, 0.5 );//this line defines how many units the verts will randomly move vertices in the X axis
float $randNumY = rand ( -0.5, 0.5 );//this line defines how many units the verts will randomly move vertices in the Y axis
float $randNumZ = rand ( -0.5, 0.5 );//this line defines how many units the verts will randomly move vertices in the Z axis
select -r $vert ;//this line replaces the mesh selection with the selection of the vertices within the selcted mesh
move -r $randNumX $randNumY $randNumZ ;//this line moves the verts randomly according to the values defined above
select -r $Selected; // returns or reselectes the previously selected object
}
}