SafeArrayDelete MEL

From scripting
Jump to: navigation, search
//0001D LLC 2016 Nick Pisca (c)
//Why?  Sometimes deleting 100,000's of objects will crash Maya.  This is safer.
string $ll[] = `ls -tr "NM_*_*"`;
int $ct = size($ll);
for ($x=0;$x<$ct;$x++) {
	print ("Deleting Object Name: "+$ll[$x]+"\n");
	delete $ll[$x];
}



More information on vectors and arrays, read pages 12-16 in YSYT.