This is a collection of small scripts/macros I have in my shelf which help me quite a lot. Some are just for fun.
Connect all selected vertices to the first selected one
With shift pressed, clicking this script enables the TrackSelectionOrder which is necessary so Maya remembers the order in which elements were selected.
After doing that once, select one first vertex and a bunch of others, then click the script and all selected vertices are connected to the first one
int $mods =`getModifiers`;
if ($mods % 2) //shift
{selectPref -tso true;}
else
{
string $vertsSplit[] = `ls -os`;
int $count = `size($vertsSplit)`;
for ($i=1; $i < $count; $i++)
{
select $vertsSplit[0];
select -tgl $vertsSplit[$i];
polyConnectComponents;
}
select $vertsSplit[0];
string $parent[] = `listRelatives -p`;
select $parent;
DeleteHistory;
doMenuComponentSelectionExt($parent[0], "vertex", 0);
}
Arrange in radial array
Arranges all selected objects in an upwards spiral
string $objs[] = `ls -sl`;
$i = 1;
$r = 25;
string $locs[] = `spaceLocator -p 5 0 5`;
CenterPivot $locs[0];
for ($obja in $objs)
{
float $locpos[] = `xform -ws -q -rp $locs`;
move -rpr $locpos[0] $locpos[1] $locpos[2] $obja;
rotate -r -p 0 0 0 0 $r 0 $locs[0];
move -r 0 0.5 0 $locs[0];
}
delete $locs;