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]) |
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
| """Illustration of how to retrieve the shape under the mouse cursor | |
| Usage: | |
| Run `start()` to start listening for when the mouse stops and to display a tooltip | |
| Run `stop()` to stop listening | |
| """ | |
| from PySide import QtGui, QtCore |
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 maya.mel as mel | |
| from maya.utils import executeDeferred | |
| from functools import wraps | |
| import re | |
| def defer(fn): | |
| '''Delays execution of the decorated function until Maya is available.''' | |
| @wraps(fn) |
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
| #---------Reconstruct Subdiv Script for Maya---------- | |
| #Script by - Kanishk Chouhan | |
| #Email - [email protected] | |
| #Blog - www.pixel-architect.blogspot.com | |
| #Description - | |
| #This script allows u to reverse the result of smooth operation in maya after deleting the history | |
| #It also preserves the original UV of the mesh | |
| #Select the mesh u want to unsmooth and execute the script | |
| #Script might take some time to execute depending on the polycount... |
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 findSkinClusters (): | |
| skins = [] | |
| shapes = pm.listRelatives(shapes=True, noIntermediate=True) | |
| for shape in shapes: | |
| skinClusters = pm.ls(type=pm.nodetypes.SkinCluster) | |
| for skin in skinClusters: | |
| mesh = pm.skinCluster(skin, q=True, g=True) | |
| if mesh[0] == shape: | |
| relatedSkinCluster = sc | |
| skins.append(skin) |
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 mc | |
| import maya.OpenMaya as om | |
| def softSelection(): | |
| selection = om.MSelectionList() | |
| softSelection = om.MRichSelection() | |
| om.MGlobal.getRichSelection(softSelection) | |
| softSelection.getSelection(selection) | |
| dagPath = om.MDagPath() |
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 -*- | |
| import maya.OpenMaya as om | |
| import maya.cmds as cmds | |
| def _findFlippedUVs(nodesOnly=True): | |
| ret = [] | |
| selList = om.MSelectionList() |