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.cmds as cmds | |
import re | |
def selShortestEdgePath(): | |
sel = cmds.ls(sl=1,fl=1) | |
objName = cmds.ls(sl=1,o=1)[0] | |
numA = int( re.findall("(?<=\[).+?(?=\])", sel[0])[0]) | |
numB = int( re.findall("(?<=\[).+?(?=\])", sel[1])[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
//changeViewerQuality | |
{ | |
col ="Viewer Odd Color Management Quality (0=low, 1=high except for cached preview, 2=high)"; | |
zom = "Viewer Odd Zoom Quality v2 ( 0=low, 1=high except for cached preview, 2=high )"; | |
type = PREFType.PREF_Type_MACHINE_INDEPENDENT; | |
if( app.preferences.getPrefAsString("Item Window Settings", col, type) == 0){ | |
app.preferences.savePrefAsLong("Item Window Settings", col, 2 , type); | |
app.preferences.savePrefAsLong("Item Window Settings", zom, 2 , type); | |
writeLn("->精度を優先"); |
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 TsUVsnapshotUDIM( size, uTiles, vTiles ): | |
for v in range(vTiles): | |
for u in range(uTiles): | |
udimName = 1000 * (v+1) + (u+1) | |
outPath = ("{0}/images/outUV_{1}.tif").format( cmds.workspace(fullName=True), udimName ) | |
cmds.uvSnapshot( aa=True, uMin=u, uMax=u+1, vMin=v, vMax=v+1, n=outPath, xr=size, yr=size, r=255, g=255, b=255, o=True, ff="tif" ) | |
#TsUVsnapshotUDIM(4096, 2, 2) |
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 as mel | |
def TsUvShellReplacement(): | |
posList = [] | |
list = cmds.ls(sl=True, fl=True) | |
#Get center position. | |
for i in list: | |
cmds.select( i, r=True ) |
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
var selItems = app.project.selection; | |
for (var i=0; i <selItems.length; i++){ | |
selItems[i].displayStartTime = currentFormatToTime("1", selItems[i].frameRate, 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
for (i = 1;i<app.project.items.length;i++){ | |
a = app.project.items[i]; | |
if (a != undefined) { | |
if (a.file != undefined){ | |
app.project.items[i].mainSource.reload() ; | |
} | |
if (a.proxySource != null){ | |
app.project.items[i].proxySource.reload ; | |
} | |
} |
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 -*- | |
## usage | |
# Select and execute a vertex. | |
# | |
# argument | |
# TsSnapCurve().main( curveName, Type ) | |
# curveName : snap curve name | |
# Type : 1=closest ,2=average | |
# |
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 random | |
def TsAddRotateY( baseRot, randamRot ): | |
items = cmds.ls(sl=True) | |
rot = (360 / int(baseRot)) / 2 | |
num = 180 / rot | |
rotList = [] | |
for r in range(rot): | |
rotList.append( num * (r+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 | |
def TsHairModelMdf(): | |
pthCurve = cmds.ls(sl=True) | |
circleName = cmds.circle( c=(0, 0, 0), nr=(0, 0, 1), sw=360, r=1, d=1, ut=0, tol=0.01, s=8, ch=1) | |
cmds.select( circleName, pthCurve[0] ) | |
motionPathName = cmds.pathAnimation( fractionMode=True, follow=True, followAxis="z", upAxis="y", worldUpType="object", inverseUp=False, inverseFront=False, bank=False, startTimeU=1) | |
cmds.nurbsToPolygonsPref( f=0, pt=1, pc=1 ) | |
faceName = cmds.planarSrf( circleName, ch=1, d=3, ko=0, tol=0.01, rn=0, po=1 ) | |
cmds.polyExtrudeFacet( '{0}.f[0]'.format(faceName[0]), constructionHistory=1, keepFacesTogether=1, divisions=20, twist=0, taper=1, off=0, thickness=0, smoothingAngle=30, inputCurve=pthCurve[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 maya.cmds as cmds | |
class TsEgdeScale: | |
def scaleEdge(self, val ): | |
pos = cmds.polyEvaluate( bc=True ) | |
x = ( pos[0][0] + pos[0][1] ) / 2 | |
y = ( pos[1][0] + pos[1][1] ) / 2 | |
z = ( pos[2][0] + pos[2][1] ) / 2 | |
cmds.scale( val, val, val, pivot=(x,y,z) ) | |
NewerOlder