Skip to content

Instantly share code, notes, and snippets.

@hmasato
hmasato / MAYA_playVLC.mel
Created November 13, 2013 13:22
[Maya, Mel, Win] _playVLC
proc _playVLC(string $files[])
{
if(size($files)<1) return;
string $app="C:/PathToVLC/vlc.exe";
if(!`filetest -x $app`) return;
string $opt = " --one-instance -R";
string $cmd="";
for($f in $files){
@hmasato
hmasato / MAYA_getFileTextures.mel
Created November 13, 2013 12:38
[MAYA, Mel] _getFileTextures
proc string[] _getFileTextures(string $node)
{
string $ret[] = {};
if($node=="") return($ret);
if(!objExists($node)) return($ret);
string $sels[]=`ls -sl`; //store config
select -hi -r $node;
@hmasato
hmasato / MAYA_system.mel
Last active December 27, 2015 18:18
[Maya, MEL, Win] _system
proc string _system(string $cmd)
{
string $tmp = "";
string $dir = `pwd`;
if(match("^//", $dir)!="") $tmp=getenv("TEMP");
if($tmp == "") return( system($cmd) );
chdir($tmp);
string $ret = system($cmd);
chdir($dir);
@hmasato
hmasato / MB_mobuTest01.py
Last active December 26, 2015 20:28
[Motionbuilder, python] _mobuTest01 Re: Looking for animation sandbox solution. http://forums.autodesk.com/t5/MotionBuilder-General/Looking-for-animation-sandbox-solution/m-p/4527329
#------------------------------------------------
# Re: Looking for animation sandbox solution. - Autodesk Discussion Groups
# http://forums.autodesk.com/t5/MotionBuilder-General/Looking-for-animation-sandbox-solution/m-p/4527329
#------------------------------------------------
#------------------------------------------------
# just experiment ;)
# step1: cleanup code
#
# takeName2takeID={"Walking":0, "Idle2Walk":1, "Kicking":2, "Standing":3, "Walk2Idle":4, "Seated":5}
@hmasato
hmasato / REG_createFolderTS_uninstall.reg
Created October 17, 2013 07:16
[Win, reg] _createFolderTS_uninstall.reg
Windows Registry Editor Version 5.00
[-HKEY_CURRENT_USER\Software\Classes\.NewFolderBasedOnTimestamp]
[-HKEY_CURRENT_USER\Software\Classes\NewFolderBasedOnTimestamp]
@hmasato
hmasato / REG_createFolderTS_install.reg
Created October 17, 2013 07:15
[Win, reg] _createFolderTS_install.reg
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Classes\.NewFolderBasedOnTimestamp]
@="NewFolderBasedOnTimestamp"
[HKEY_CURRENT_USER\Software\Classes\.NewFolderBasedOnTimestamp\ShellNew]
"Command"="cmd /d /e:on /c for /f \"tokens=1-7 delims=.,\\:/\" %%A in (\"%%date%%.%%time%%\") do for /f \"tokens=*\" %%a in (\"%1\") do if not exist \"%%~dpa\\%%A%%B%%C_%%D%%E_%%F%%G\" mkdir \"%%~dpa\\%%A%%B%%C_%%D%%E_%%F.%%G\""
"nullfile"=hex:
[HKEY_CURRENT_USER\Software\Classes\NewFolderBasedOnTimestamp]
"FriendlyTypeName"="Folder (Timestamp)"
@hmasato
hmasato / REG_createFolder_uninstall.reg
Created October 17, 2013 07:14
[Win, reg] _createFolder_uninstall.reg
Windows Registry Editor Version 5.00
[-HKEY_CURRENT_USER\Software\Classes\.NewFolderBasedOnDate]
[-HKEY_CURRENT_USER\Software\Classes\NewFolderBasedOnDate]
@hmasato
hmasato / REG_createFolder_install.reg
Created October 17, 2013 07:13
[Win, reg] _createFolder_install.reg
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Classes\.NewFolderBasedOnDate]
@="NewFolderBasedOnDate"
[HKEY_CURRENT_USER\Software\Classes\.NewFolderBasedOnDate\ShellNew]
"Command"="cmd /d /e:on /c if not exist \"%1\\..\\%%date:/=%%\" mkdir \"%1\\..\\%%date:/=%%\""
"nullfile"=hex:
[HKEY_CURRENT_USER\Software\Classes\NewFolderBasedOnDate]
"FriendlyTypeName"="Folder (Date)"
@hmasato
hmasato / MAYA_forceQuit.mel
Created October 16, 2013 13:28
[MAYA, MEL] _forceQuit
proc q(){q;}q;
@hmasato
hmasato / MAYA_optimizeMatTex.mel
Created September 10, 2013 05:47
[MAYA] _optimizeMatTex (optimize tons of materials / textures)
//
// _optimizeMatTex
//
//-----------------------------------
proc string _getProfileAttr(string $plug)
{
string $typ=`getAttr -type $plug`;
string $cnt[]=`listConnections -s 1 -d 0 -p 1 -c 0 $plug`;
if(size($cnt)){
string $buf[]={};