Download MEL SCRIPT CLICK ME!




randMove_v1 from frankb on Vimeo.






//Francis A. Bitonti (c)2008

global string $floatFieldName1="";
global float $neigh1;

global proc floatValueChanged1() {
global string $floatFieldName1;
global float $neigh1;

// query the value from the float field
$neigh1 = `floatField -query -value $floatFieldName1`;

// print value
print("newValue="+ $neigh1 +"\n");
$neigh1 = $neigh1;
}

global string $floatFieldName2="";
global float $neigh2;

global proc floatValueChanged2() {
global string $floatFieldName2;
global float $neigh2;

// query the value from the float field
$neigh2 = `floatField -query -value $floatFieldName2`;

// print value
print("newValue="+ $neigh2 +"\n");
$neigh2 = $neigh2;
}

//variable for tessale functions ui

global string $floatFieldName3="";
global float $neigh3;

global proc floatValueChanged3() {
global string $floatFieldName3;
global float $neigh3;

// query the value from the float field
$neigh3 = `floatField -query -value $floatFieldName3`;

// print value
print("newValue="+ $neigh3 +"\n");
$neigh3 = $neigh3;
}

window -t "random mixup" -h 200 -w 300; columnLayout;
text -h 28 -l "random mixup _v1" -w 121;
text -h 23 -l "Developed by Francis A. Bitonti" -w 151;
separator -h 17 -w 200;
text -h 30 -l "xyz move scale and rotate ranges on" -w 220;
text -h 30 -l "move first field is a negitive number." -w 220;
$floatFieldName3 = `floatField -h 23 -max 500 -min 0 -s 1 -v 0 -w 100 -changeCommand "floatValueChanged3();"`;
$floatFieldName2 = `floatField -h 23 -max 500 -min 0 -s 1 -v 0 -w 100 -changeCommand "floatValueChanged2();"`;
$floatFieldName1 = `floatField -h 23 -max 500 -min 0 -s 1 -v 0 -w 100 -changeCommand "floatValueChanged1();"`;
button -h 28 -l "duplicate" -w 107 -c "dup()";
button -h 28 -l "move" -w 107 -c "trans()";
button -h 28 -l "rotate" -w 107 -c "rota()";
button -h 28 -l "scale" -w 107 -c "sc()";
separator -h 17 -w 200;
showWindow;


global proc dup(){

duplicate -rr -un;

}

global proc trans(){

float $l1;
float $h1;
float $z1;

global float $neigh3;
global float $neigh2;
global float $neigh1;

$neigh1 = -($neigh1);

string $tempNode[] = `ls -sl -fl`;

for ($i = 0; $i < size($tempNode) ; $i++) {

select -r $tempNode[$i];
$l1 = `rand $neigh1 $neigh2`;
$h1 = `rand $neigh1 $neigh2`;
$z1 = `rand 0 $neigh3`;

move -r $l1 $h1 $z1 ;
select -cl;
}

}


global proc rota(){

float $l1;
float $h1;
float $z1;

global float $neigh3;
global float $neigh2;
global float $neigh1;

$neigh1 = -($neigh1);

string $tempNode[] = `ls -sl -fl`;

for ($i = 0; $i < size($tempNode) ; $i++) {

select -r $tempNode[$i];
$l1 = `rand $neigh1 $neigh2`;
$h1 = `rand $neigh1 $neigh2`;
$z1 = `rand $neigh1 $neigh3`;

rotate -r -os $l1 $h1 $z1 ;
select -cl;
}

}


global proc sc(){

float $l1;
float $h1;
float $z1;

global float $neigh3;
global float $neigh2;
global float $neigh1;

//$neigh1 = -($neigh1);

string $tempNode[] = `ls -sl -fl`;

for ($i = 0; $i < size($tempNode) ; $i++) {

select -r $tempNode[$i];
$l1 = `rand $neigh1 $neigh2`;
$h1 = `rand $neigh1 $neigh2`;
$z1 = `rand $neigh1 $neigh3`;

scale -r $l1 $h1 $z1 ;
select -cl;
}

}