I've created the following script to roughen the vertexes of selected shapes. I'd like this script to create history that could be animated - it would be like a 3D static if I could change the way the vertexes were roughened in time. Any ideas how that could be approached?
Thanks!
{
float $roughness = .1;
string $allObjects[];
string $obj;
int $vertexCount[];
float $x;
float $y;
float $z;
$allObjects = ls -selection
;
// process each shape
for ( $obj in $allObjects ) {
// select next object
select -r $obj;
// get the number of vertices used in the mesh
$vertexCount = polyEvaluate -v
;
// process each vertex
for ( $i=0 ; $i < $vertexCount[0] ; $i++ )
{
// select next vertex
select -r ( $obj + ".vtx[" + $i + "]") ;
$x = rand(-$roughness,$roughness);
$y = rand(-$roughness,$roughness);
$z = rand(-$roughness,$roughness);
move -r $x $y $z ;
}
}
// re-select initial object selection
select -r $allObjects;
}