This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #------------------------------------------------ | |
| # 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} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| proc string[] _qs2obj(string $qs[]) | |
| { | |
| string $q[]=`ls -type "objectSet" $qs`; | |
| if(size($q)<1) return($qs); | |
| return(stringArrayCatenate(stringArrayRemove($qs, $q), _qs2obj(`sets -q $q`))); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function _padding(val,n) | |
| { | |
| n -= (''+val).length-1; | |
| return((n>0?(new Array(n)).join('0'):'')+val); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //-------------------------------- | |
| // zero padding | |
| //-------------------------------- | |
| function _padding(val,n) | |
| { | |
| n -= (''+val).length-1; | |
| return((n>0?(new Array(n)).join('0'):'')+val); | |
| } | |
| //-------------------------------- | |
| // examples: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //override & set | |
| proc _ovrAttr(string $node, string $attr, string $v) | |
| { | |
| string $plg = $node + "." + $attr; | |
| if(!objExists($plg)) return; | |
| editRenderLayerAdjustment($plg); | |
| string $cmd = "setAttr \""+$plg+"\""; | |
| string $typ = `getAttr -type $plg`; | |
| switch($typ){ | |
| case "string": $cmd += " -type \"string\" \"" + $v + "\""; break; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| import maya.OpenMaya as om | |
| import maya.cmds as cmds | |
| def _findFlippedUVs(nodesOnly=True): | |
| ret = [] | |
| selList = om.MSelectionList() |