我遇到了执行此操作的现有代码,但我认为必须有更好的方法。所以,我需要在 Autodesk Maya 中获得最高级别的网格节点。
// List all mesh objects
string $nodess[] = `ls -type mesh` ;
// Replace existing items on active list with this
select -r $nodess[0] ;
int $i = 1 ;
while ($i < 30) {
// Pick up the tree 30 times
pickWalk -d up ;
$i++ ;
}
// List all selected objects
string $rootNode[] = `ls -sl` ;
// Clear selection
select -cl ;
string $myroot = $rootNode[0] ;