This file contains 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
#hmasato | |
#https://gist.github.com/hmasato/8979ff25e9d2c5d44883 | |
def numToAlphaSeq(intValue, upperCase = True, baseStr = 'abcdefghijklmnopqrstuvwxyz'): | |
ret = '' | |
if not str(intValue).isdigit(): return(ret) | |
baseDecimal = len(baseStr) | |
while intValue >= 0: | |
remainder = int(intValue % baseDecimal) #remainder | |
intValue = (intValue - 1 - remainder) / baseDecimal |
This file contains 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
#hmasato | |
#https://gist.github.com/hmasato/b72a95fbadf1c63b56ec | |
#------------------------------ | |
#grab frame buffer to QImage | |
#------------------------------ | |
import ctypes | |
import maya.OpenMaya as om | |
import maya.OpenMayaUI as omui |
This file contains 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
//hmasato | |
//https://gist.github.com/hmasato/64427eb43ad89742b811 | |
// | |
//_scriptEditor_replaceSelected | |
// | |
proc _scriptEditor_replaceSelected(string $src, string $dst) | |
{ | |
global string $gLastFocusedCommandExecuter; |
This file contains 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
#hmasato | |
#https://gist.github.com/hmasato/996e5d40542937b1f5e4 | |
#PARMmenu.xml | |
""" | |
<?xml version="1.0" encoding="UTF-8"?> | |
<menuDocument> | |
<menu> | |
<scriptItem id="my_pasteRefAsStamp"> |
This file contains 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() |
This file contains 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 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 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 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`))); | |
} |
NewerOlder