Randomise Vertex Position – [Maya]

So I found a great little script here that will randomise the vertex positions in all the axis depending on how much you want it to, check it out below!

$mySelection = `ls- sl`;
$myVerts = `getVerts`; // this command grabs all the vertices of selected objects and put into a string array

for ($vert in $myVerts)
{    
    float $min = -50;
    float $max  = 50; 
    float $randNumX = rand( $min , $max );
    float $randNumY = rand( $min , $max );
    float $randNumZ = rand( $min , $max );

    select -r $vert ;
    move -r $randNumX $randNumY $randNumZ ;
}
select -r $mySelection; // return to previously selected objects

Gary

Leave a Reply

Your email address will not be published. Required fields are marked *