GetMayaRAMUsage

From scripting
Revision as of 05:58, 22 April 2017 by Nickpisca (talk | contribs) (Created page with " float $Ram1 = GetMayaRAMUsage(); //Note, this tool only works on Windows XP Pro and newer. Windows XP Home may not run this. global proc float GetMayaRAMUsage() { //Aut...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
float $Ram1 = GetMayaRAMUsage();
//Note, this tool only works on Windows XP Pro and newer.  Windows XP Home may not run this.

global proc float GetMayaRAMUsage() {
//Author Nick Pisca 0001d 2010
string $TLbuffer[];
string $TL = `system ("tasklist")`;
$TLToks = `tokenize $TL " " $TLbuffer`;
int $TLCount = 0;
string $TLMayaUsage = 0;
do {
	string $TLX = `match "maya" $TLbuffer[$TLCount]`;
	if ($TLX != "") {
		$TLMayaUsage = $TLbuffer[($TLCount+4)];
	}
	$TLCount++;
} while ($TLCount<size($TLbuffer));
string $s2 = `substitute "," $TLMayaUsage ""`;
float $TLMayaDbl = float($s2);
return $TLMayaDbl;
}



More information on MEL scripting, read YSYT.