[Maya MEL] Reverse the Order of a Selection List (Natively)

Hi bentraje,

I don’t know if there’s a way of doing this in the command, but I wrote my own that does something similar.

proc list_children(string $top_model)
{
    $children = `listRelatives -c $top_model`;
    $size = size($children);
    for($i=0;$i<$size;++$i)
    {
        print $children[$i];
        print "\n";
        list_children($children[$i]);
    }
}

$sel= `ls -sl`;
for ($list in $sel)
{
    list_children($list);
}

Hope this helps!

1 Like