string $allObjects[]; string $obj; float $locwidth = 30.0; float $loclength = 30.0; float $xWaveCnt = 2.0; float $zWaveCnt = 2.0; float $amplitude = 2.0; float $displace; float $coords[]; float $xOffset; float $zOffset; float $degreesX; float $degreesZ; float $xSin; float $zSin; $allObjects = `ls -fl -selection`; for ( $obj in $allObjects ) { $coords = `xform -q -os -t $obj`; $xOffset = $locwidth - $coords[0]; $zOffset = $loclength - $coords[2]; $degreesX = (360.0 * $xWaveCnt) * ($xOffset / $locwidth); $degreesZ = (360.0 * $zWaveCnt) - ((360.0 * $zWaveCnt) * ($zOffset / $loclength)); $xSin = sin(deg_to_rad($degreesX)); $zSin = sin(deg_to_rad($degreesZ)); $displace = ($xSin * $zSin) * $amplitude; xform -os -r -t 0.0 $displace 0.0 $obj; };