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
Material = cmds.ls(sl=1) | |
ObjsWithMatSG = cmds.listConnections(Material,type='shadingEngine') | |
ObjsWithMat = cmds.listConnections(ObjsWithMatSG,type='shape') |
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
''' | |
timeDragger 1.0 | |
29/03/2015 | |
Tom Bailey | |
''' | |
import maya.cmds as cmds | |
import maya.mel as mel | |
''' |
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
import time | |
from maya.api import OpenMaya | |
MVector = OpenMaya.MVector | |
def get_dagnode(mesh): | |
sel = OpenMaya.MSelectionList() | |
sel.add(mesh) | |
return OpenMaya.MFnDagNode(sel.getDagPath(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
# python api2.0 setWeights(),setWeight() | |
# http://ueta.hateblo.jp/entry/2015/08/24/102937 | |
import time | |
import maya.api.OpenMaya as OpenMaya2 | |
import maya.api.OpenMayaAnim as OpenMayaAnim2 | |
#_time = time.time | |
_time = time.clock |
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
import maya.OpenMaya as om | |
import maya.cmds as cmds | |
def getUvShelList(name): | |
selList = om.MSelectionList() | |
selList.add(name) | |
selListIter = om.MItSelectionList(selList, om.MFn.kMesh) | |
pathToShape = om.MDagPath() | |
selListIter.getDagPath(pathToShape) | |
meshNode = pathToShape.fullPathName() |
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
def check_faces_in_the_same_place(sel=False): | |
objs = ls(sl=sel, type='mesh') | |
errors = [] | |
for obj in objs: | |
areas = {} | |
for f in obj.f: | |
a = round(f.getArea(),5) | |
if a in areas: | |
areas[a].append(f) |
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
import maya.OpenMaya as om | |
import maya.cmds as cmds | |
def edgesIsSmooth(name, edgeArray): | |
selList = om.MSelectionList() | |
selList.add(name) | |
selListIter = om.MItSelectionList(selList, om.MFn.kMesh) | |
pathToShape = om.MDagPath() | |
selListIter.getDagPath(pathToShape) | |
shapeFn = om.MFnMesh(pathToShape) |
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
''' | |
This is the default UndeadLabs maya UserSetup.py. It should be copied into | |
one of the user's MAYA_SCRIPT_DIR folders (typically, the one for the | |
current version, like '2014x64', but it works in the generic one as well) | |
''' | |
import os | |
import site | |
import sys | |
ZIP_NAME = os.environ.get('MAYA_ZIP', 'ulmaya.zip') |
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""" | |
# | |
# 指定パス以下の スクリプトを元にシェルフを動的作成 for maya | |
# | |
# ├─dyn_shelf_root | |
# │ ├─hoge_tab | |
# │ │ └─ スクリプト1.py | |
# │ │ └─ スクリプト2.py | |
# │ └─mage_tab | |
# └─ スクリプト3.py |
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
import maya.cmds as cmds | |
import re | |
import maya.OpenMaya as om | |
def getComponentId(component): | |
"""get id number from a component (i.e. pCube.vtx[12]) , and return as int (i.e. 12 ) .""" | |
tokens = re.split('[\[\]]',str(component)) | |
try: | |
return int(tokens[1]) |