[MEL]does not loop through


#1

Hi,

Im new to MEL, just started doing basic stuff. Why my code does not print anything? No, the scene is not empty.

string $sel[] = `select -all -hi`;
string $itm;
for ($itm in $sel) {
	//string $type = nodeType($item);
	//print ($type + " : " + $item + "
");
	print "wtf?
";
};

#2

Ok I took a lunch break and I know why. Because

print `size($sel)`;
0

How is that possible? Is that mean that:

string $sel[] = `select -all -hi`;

it does not assign selected objects to the list?


#3

Ok I get it. the select does not return anything. Need to do it in two steps:

select -all -hi;
string $sel[] = `ls -sl`;
string $itm;
for ($itm in $sel) {
	//string $type = nodeType($item);
	//print ($type + " : " + $item + "
");
	print "wtf?
";
};