diff options
| author | MobileMachine\jeremy <[email protected]> | 2017-06-06 22:59:03 -0400 |
|---|---|---|
| committer | MobileMachine\jeremy <[email protected]> | 2017-06-06 22:59:03 -0400 |
| commit | 24725fa8681f906ab44d80687c09fecc171a2896 (patch) | |
| tree | 312a601df29aca7f8db9f44082d96ebc7a679138 /install.mel | |
| parent | Initial commit (diff) | |
| download | artv2-24725fa8681f906ab44d80687c09fecc171a2896.tar.xz artv2-24725fa8681f906ab44d80687c09fecc171a2896.zip | |
Initial Submission
First submission of current state of ARTv2. Currently considered to be in Alpha. There are a couple of animation tools not implemented yet, and one module not implemented yet, as well as incomplete documentation.
Diffstat (limited to 'install.mel')
| -rw-r--r-- | install.mel | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/install.mel b/install.mel new file mode 100644 index 0000000..2480931 --- /dev/null +++ b/install.mel @@ -0,0 +1,57 @@ +string $scriptLocation=`scriptLocation`; + + +// Setup module +python("import os"); +python("home = os.path.expanduser(\"~\")"); + +string $mayaModDir = python("home+\"/maya/modules/\""); +if (`about -os` == "mac") $mayaModDir = python("home+\"/Library/Preferences/Autodesk/maya/modules/\""); +python("try:\n\tmodDir=os.path.relpath(\""+$scriptLocation+"\",\""+$mayaModDir+"\").replace('\\\\', '/')\nexcept:\n\tmodDir=\"\""); +string $modDir = python("modDir"); +if ($modDir == "") $modDir = `substring $scriptLocation 1 (size($scriptLocation)-1)`; + + +string $modName = "ARTv2"; +string $modFileName = $modName+".mod"; +string $modFile = $scriptLocation + "/" + $modFileName; +string $newModFile = $mayaModDir + $modFileName ; +string $toBeReplacedStr = "REPLACE_TO_YOUR_PATH"; + + +int $copySuccess = `sysFile -cp $newModFile $modFile`; +if (!$copySuccess) sysFile -md $mayaModDir; + + +$inFileId=`fopen $modFile "r"`; +$outFileId=`fopen $newModFile "w"`; +string $nextLine = `fgetline $inFileId`; + +while ( size( $nextLine ) > 0 ) { + $nextLine = `substitute $toBeReplacedStr $nextLine $modDir`; + fprint($outFileId, $nextLine); + $nextLine = `fgetline $inFileId`; +} +fclose $inFileId; +fclose $outFileId; + + +// load script path for current session +loadModule -a; +loadPlugin "ARTv2"; +pluginInfo -edit -autoload true "ARTv2"; + +// Helper functions for locating script's location +global proc scriptLocator (){} + +global proc string scriptLocation () +{ + string $whatIs=`whatIs scriptLocator`; + string $fullPath=`substring $whatIs 25 999`; + string $buffer[]; + int $numTok=`tokenize $fullPath "/" $buffer`; + int $numLetters=size($fullPath); + int $numLettersLastFolder=size($buffer[$numTok-1]); + string $scriptLocation=`substring $fullPath 1 ($numLetters-$numLettersLastFolder)`; + return $scriptLocation; +}
\ No newline at end of file |