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
def shiftValue(value, values=[35, 70, 100, 120, 150]): | |
if value in values: | |
index = values.index(value) | |
if not len(values) - 1 == index: | |
return values[index + 1] | |
else: | |
return values[0] | |
else: | |
return values[0] |
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
import re | |
from collections import OrderedDict | |
def sortedStringList(array=[]): | |
sortDict=OrderedDict() | |
for splitList in array: | |
sortDict.update({splitList:[int(x) for x in re.split("(\d+)",splitList)if bool(re.match("\d*",x).group())]}) | |
return [sortObjKey for sortObjKey,sortObjValue in sorted(sortDict.items(), key=lambda x:x[1])] |
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
import maya.cmds as cmds | |
import maya.mel | |
import maya.OpenMaya as OpenMaya | |
def connectPort_2_Atom(_port=7005,_mode="python"): | |
#open port with Atom port | |
exi_port=cmds.commandPort(":%s" % _port,q=True) | |
if(exi_port==1): |
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
cd /d C:\Program Files\Autodesk\Maya2016\bin | |
for %%f in (%*) do ( | |
mayapy pyside-uic -o %~dpn1_pyside.py %%f | |
) | |
cd /d C:\Program Files\Autodesk\Maya2017\bin | |
for %%f in (%*) do ( | |
mayapy pyside2-uic -o %~dpn1_pyside2.py %%f | |
) |
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
for %%f in (%*) do ( | |
pyside-uic -o %~dpn1_pyside.py %%f | |
) | |
for %%f in (%*) do ( | |
pyside2-uic -o %~dpn1_pyside2.py %%f | |
) |
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 -*- | |
#コーディング: utf-8 | |
#------------------------------------------------------------------------------ | |
from Qt.QtWidgets import * | |
from Qt.QtGui import * | |
from Qt.QtCore import * | |
import maya.OpenMayaUI as OpenMayaUI | |
try : |
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
import maya.cmds as cmds | |
def convCreaseSet(): | |
creaseDict={} | |
for _mesh in cmds.ls(type="mesh"): | |
for _edge in cmds.ls("%s.e[*]" % _mesh,fl=True): | |
_value=cmds.polyCrease(_edge,q=True,v=True) | |
creaseDict.setdefault(_value[0],[]).append(_edge) |
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
#ファイル名に (<数字>) がついてしまったものを元に戻す。 | |
#オリジナルが存在したら複製は消す。 | |
#日付は見ていないので注意 | |
import os | |
import re | |
def find_all_files(directory): | |
for root, dirs, files in os.walk(directory): | |
yield root | |
for file in files: |
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 -*- | |
#コーディング: utf-8 | |
#------------------------------------------------------------------------------ | |
import maya.cmds as cmds | |
#------------------------------------------------------------------------------ | |
def testJob(): | |
print cmds.listRelatives(cmds.ls(sl=True),shapes=True) | |
def main(): |
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 -*- | |
#コーディング: utf-8 | |
#------------------------------------------------------------------------------ | |
import maya.cmds as cmds | |
#------------------------------------------------------------------------------ | |
checkAttr={"castsShadows":1 | |
,"receiveShadows":1 | |
#,"holdOut":0 #Maya2017~ | |
,"motionBlur":1 | |
,"primaryVisibility":1 |
OlderNewer