Hi all! 
One more thing for today.
As I said previously, I've wrote a MEL to randomize the existing NURBS curves with keeping its length. I think this MEL is very useful for us, please try this!
The author for base script is Mr. Ryan Ellis.
Thnx for him! :bowdown:
(EDIT: )
I add a scaleFactor argument.
global proc modifyCurvesRandom(float $maxDeviation, float $scaleFactor)
{
string $sels[] = `ls -sl`;
string $obj;
for ($obj in $sels) {
float $cvs[] = `getAttr ($obj + ".cv
[li]")`;[/li] int $numCvs = size($cvs) / 3;
float $startingLoc[] = {$cvs[0], $cvs[1], $cvs[2]};
vector $startingVector = <<($cvs[3] - $cvs[0]), ($cvs[4] - $cvs[1]), ($cvs[5] - $cvs[2])>>;
int $nodeCount = $numCvs - 1;
float $lastLoc[] = $startingLoc;
vector $lastVec = $startingVector;
float $loc[];
float $diffLoc[];
for ($i = 0; $nodeCount > $i; ++$i) {
int $i3 = 3 * $i;
float $dX = ($cvs[$i3 + 3] - $cvs[$i3 + 0]);
float $dY = ($cvs[$i3 + 4] - $cvs[$i3 + 1]);
float $dZ = ($cvs[$i3 + 5] - $cvs[$i3 + 2]);
float $length = sqrt($dX * $dX + $dY * $dY + $dZ * $dZ);
vector $newVec;
float $test = ($maxDeviation + 1);
do {
$newVec = unit(sphrand(1));
$test = rad_to_deg(`angle $lastVec $newVec`);
} while ($test > $maxDeviation);
$loc[0] = $newVec.x * $length;
$loc[1] = $newVec.y * $length;
$loc[2] = $newVec.z * $length;
$diffLoc[0] = ($loc[0] - $dX) * $scaleFactor;
$diffLoc[1] = ($loc[1] - $dY) * $scaleFactor;
$diffLoc[2] = ($loc[2] - $dZ) * $scaleFactor;
select -r ($obj + ".cv[" + ($i+1) +"]");
move -r $diffLoc[0] $diffLoc[1] $diffLoc[2];
$lastLoc[0] = $cvs[$i3 + 3] + $diffLoc[0];
$lastLoc[1] = $cvs[$i3 + 4] + $diffLoc[1];
$lastLoc[2] = $cvs[$i3 + 5] + $diffLoc[2];
}
}
select -r $sels;
}
[img]http://www.asahi-net.or.jp/%7EDM5K-STU/WIP/M-V2-802.jpg[/img]
I wrote a lot of MEL scripts in the making for muscle rig.
These will be public with muscle rig scene itself.
C&C are welcome! :bowdown: