Difference between revisions of "Maya Mel"
								
								Jump to navigation
				Jump to search
				
				
							
								
							
		|  (Created page with "=My mels= === Easy install tip === <pre> //stolen from advanced skeleton file and other scripts //basically call 'whatIs' on a procedure that you just sourced so you know when...") | |||
| Line 1: | Line 1: | ||
| =My mels= | =My mels= | ||
| + | === Easy install tip === | ||
| + | <pre> | ||
| + | //stolen from advanced skeleton file and other scripts | ||
| + | //basically call 'whatIs' on a procedure that you just sourced so you know when the current mel file is | ||
| + | //useful for dragging and dropping files in viewport for installation | ||
| + | |||
| + | global proc installDir (){} | ||
| + | string $p = `whatIs installDir`; | ||
| + | |||
| + | string $fullPath=`substring $p 25 999`; | ||
| + | string $buffer[]; | ||
| + | string $slash="/"; | ||
| + | if (`gmatch $p "*\\\\*"`)//sourced from ScriptEditor | ||
| + | 	$slash="\\"; | ||
| + | int $numTok=`tokenize $fullPath $slash $buffer`; | ||
| + | int $numLetters=size($fullPath); | ||
| + | int $numLettersLastFolder=size($buffer[$numTok-1]); | ||
| + | string $scriptLocation=`substring $fullPath 1 ($numLetters-$numLettersLastFolder)`; | ||
| + | print $scriptLocation; | ||
| + | |||
| + | </pre> | ||
| === Easy install tip === | === Easy install tip === | ||
| <pre> | <pre> | ||
Revision as of 23:27, 7 June 2019
My mels
Easy install tip
//stolen from advanced skeleton file and other scripts
//basically call 'whatIs' on a procedure that you just sourced so you know when the current mel file is
//useful for dragging and dropping files in viewport for installation
global proc installDir (){}
string $p = `whatIs installDir`;
string $fullPath=`substring $p 25 999`;
string $buffer[];
string $slash="/";
if (`gmatch $p "*\\\\*"`)//sourced from ScriptEditor
	$slash="\\";
int $numTok=`tokenize $fullPath $slash $buffer`;
int $numLetters=size($fullPath);
int $numLettersLastFolder=size($buffer[$numTok-1]);
string $scriptLocation=`substring $fullPath 1 ($numLetters-$numLettersLastFolder)`;
print $scriptLocation;
Easy install tip
//stolen from advanced skeleton file and other scripts
//basically call 'whatIs' on a procedure that you just sourced so you know when the current mel file is
//useful for dragging and dropping files in viewport for installation
global proc installDir (){}
string $p = `whatIs installDir`;
string $fullPath=`substring $p 25 999`;
string $buffer[];
string $slash="/";
if (`gmatch $p "*\\\\*"`)//sourced from ScriptEditor
	$slash="\\";
int $numTok=`tokenize $fullPath $slash $buffer`;
int $numLetters=size($fullPath);
int $numLettersLastFolder=size($buffer[$numTok-1]);
string $scriptLocation=`substring $fullPath 1 ($numLetters-$numLettersLastFolder)`;
print $scriptLocation;
