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 _calcVolumeAndCOM() | |
| { | |
| string $shps[]=`listRelatives -pa -ni -s -type "mesh"`; | |
| for($s in $shps){ | |
| float $vol=0; | |
| vector $com=<<0, 0, 0>>; | |
| vector $vt[]=`xform -q -ws -t ($s+".vtx[*]")`; | |
| int $nf=`getAttr -s ($s+".fc")`; | |
| for($i=0; $i<$nf; $i++){ | |
| string $b[]=`polyInfo -faceToVertex ($s+".f["+$i+"]")`; |
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
| // | |
| // cs3 to cc2014 | |
| // | |
| function _aepVer(fileObj) | |
| { | |
| var _code = "" | |
| +"@JSXBIN@[email protected]@MyBbyBn0ABNAnAMAbyBn0ASJCnASzDjSjFjUBAncfftOyFZFnAVBf0AhzBhBCCzKj" | |
| +"JjOjTjUjBjOjDjFjPjGDVzBjGEfFjzEiGjJjMjFFfnnnOyGZGnAVBf0ACzChBhdGnEXzLjUjPiMjPjX" | |
| +"jFjSiDjBjTjFHfXzBhQIfEXzFjTjMjJjDjFJfEXzFjTjQjMjJjUKfXzEjOjBjNjFLfVEfFRBFeBhOff" | |
| +"RBFdyBffnfeDjBjFjQnnOyHZHnAVBf0AhCXzGjFjYjJjTjUjTMfVEfFnOyJZJnAVBf0AhCEXzEjPjQj" |
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
| MApiVersion | |
| app api | |
| maya | |
| 6.5 650 | |
| 8.5 850 | |
| 7.0 700 | |
| 8.0 800 | |
| 2008 200806 200800? |
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 _dos(cmd){ | |
| var ret=[]; | |
| if(cmd=="") return(ret); | |
| var wsh = XSIFactory.CreateActiveXObject('WScript.Shell'); | |
| var tmp = wsh.ExpandEnvironmentStrings("%TEMP%"); | |
| var fn = tmp+"\\_log_dos_return.txt"; | |
| var er = wsh.Run("cmd /c "+cmd+" > " + fn, 0, true); | |
| if(er) return(ret); | |
| var fs = XSIFactory.CreateObject('Scripting.FileSystemObject'); | |
| if(!fs.FileExists(fn)) return(ret); |
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 _notepad(str) | |
| { | |
| var fso = new ActiveXObject("Scripting.FileSystemObject"); | |
| var wsh = new ActiveXObject("WScript.Shell"); | |
| var dir = wsh.ExpandEnvironmentStrings("%temp%"); | |
| var sn = ActiveProject.ActiveScene.Parameters("Name").Value; | |
| var fn = dir + "\\" + sn + ".txt"; | |
| var f = fso.CreateTextFile(fn, true, false); |
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
| <html> | |
| <head> | |
| <script type="text/JavaScript"> | |
| function _sort(_f) | |
| { | |
| var fn = []; | |
| for(var e=new Enumerator(_f); !e.atEnd(); e.moveNext()) | |
| fn.push({'name':e.item().Name, 'obj':e.item()}); | |
| fn = fn.sort(function(a, b) {return((a.name>b.name)?1:-1);}); | |
| var ret = []; |
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
| // RGB -> HSV | |
| vec3 rgb2hsv(vec3 v){ | |
| const float e=1e-20; | |
| vec4 c=vec4(v,0); | |
| c=mix(vec4(c.rbg,-1),c,step(c.b,c.g)); | |
| c=mix(vec4(c.grb,-1.0/3.0-c.a),c,step(c.g,c.r)); | |
| float cr=c.r-min(c.g,c.b); | |
| return vec3(abs(c.a+(c.g-c.b)/(6*cr+e)),cr/(c.r+e),c.r); | |
| } | |
| // HSV -> RGB |
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 _switchCams() | |
| { | |
| string $p=`getPanel -withFocus`; | |
| if(!`modelPanel -ex $p`) return; | |
| string $cams[]={}; | |
| string $cur=`modelPanel -q -cam $p`; | |
| if(nodeType($cur)!="camera"){ | |
| $cams=`listRelatives -pa -s $cur`; | |
| $cur=$cams[0]; |
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[] _GUI(string $func) | |
| { | |
| if(`window -exists ($func+"Win")`) deleteUI ($func+"Win"); | |
| window -title $func ($func+"Win"); | |
| paneLayout -cn "horizontal2" -paneSize 1 100 15 -paneSize 2 100 85; | |
| columnLayout -h 50 -adj 1; | |
| rowColumnLayout -h 50 -nc 2 -cw 1 60 -cw 2 160 -cat 1 "right" 0; | |
| text -l "Node Name"; string $txt=`textField -text "*" ($func+"Tfld")`; | |
| text -l "Node Type"; string $txt2=`textField -text "*" ($func+"Tfld2")`; |
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[] _GUI(string $func) | |
| { | |
| if(`window -exists ($func+"Win")`) deleteUI ($func+"Win"); | |
| window -title $func ($func+"Win"); | |
| paneLayout -w 200 -cn "left3" | |
| -paneSize 1 50 15 | |
| -paneSize 2 50 100 | |
| -paneSize 3 50 85; | |
| columnLayout -w 100 -h 50 -adj 1; |