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
| ''' | |
| Select any object and run the script, it will select any node, specified in the list of the "getDG" nType array | |
| Some api node type examples: | |
| Camera = camera | |
| Parent Constraint = parentConstraint | |
| Point Constraint = pointConstraint | |
| Orient Constraint = orientConstraint | |
| Aim Constraint = aimConstraint | |
| Scale Constraint = scaleConstraint | |
| Skin Cluster = skinCluster |
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 | |
| locResult = mc.promptDialog( title='Insert Locators', message='Locator count:', button=['OK', 'Cancel'], defaultButton='OK', cancelButton='Cancel', dismissString='Cancel') | |
| if locResult == 'OK': | |
| locCount = mc.promptDialog( q=1, text=1) | |
| if not locCount or not int(locCount) : | |
| locCount = 1 | |
| sel = mc.ls( sl=1 ) | |
| for s in sel: | |
| pos = mc.xform( s, q=1, t=1, ws=1 ) | |
| for l in xrange( int( locCount ) ): |
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 ast | |
| import sys | |
| import maya.api.OpenMaya as om2 | |
| import maya.cmds as mc | |
| import colorsys | |
| # Plug-in information: | |
| kPluginNodeName = 'colorAttributes' | |
| kPluginNodeClassify = 'utility/general' | |
| kPluginNodeId = om2.MTypeId( 0x86025 ) |
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 | |
| selDrivers = mc.textScrollList( "driverObjects", q=1, si=1 ) | |
| if not selDrivers: | |
| selDrivers = mc.ls( sl=1 ) | |
| outPlug = mc.listConnections( selDrivers, c=1, d=1, s=0 ) | |
| if outPlug: | |
| animCurves = outPlug[1::2] | |
| animCurvesU = [ a for a in animCurves if 'animCurveU' in mc.ls( a, st=1)[-1] ] | |
| if animCurvesU: | |
| drivens = mc.listConnections( animCurvesU, c=1, d=1, s=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
| import os.path | |
| import maya.cmds as mc | |
| ''' | |
| you can call script from this command at the end of the code | |
| fastTextureReplacePath() | |
| it will search based on the path of your scene, i.e., it will seek inside subfolders in the folder where your scene is |
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.mel as mel | |
| import maya.cmds as mc | |
| import os | |
| import json | |
| path = mc.file(q=1, sn=1).rsplit( '/', 1 )[0] | |
| stored = mc.fileInfo( "timelineMarkers", q=1 ) | |
| if stored: info = json.loads( stored[ 0 ].replace( '\\"', '"') ) | |
| else: info = dict() | |
| frames = info.get( "frames" ) or [] |
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.api.OpenMaya as om2 | |
| import maya.api.OpenMayaAnim as oma2 | |
| import maya.cmds as mc | |
| class growSkinWeights(object): | |
| def __init__(self): | |
| self.cIds = None | |
| def growSkinDo(self, mode): |
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.api.OpenMaya as om2 | |
| import maya.api.OpenMayaAnim as oma2 | |
| import maya.cmds as mc | |
| class growSkinWeights(object): | |
| def __init__(self): | |
| self.cIds = None | |
| def growSkinDo(self, mode): |
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.api.OpenMaya as om2 | |
| def spread(x,objType='spaceLocator'): | |
| sel = mc.ls( sl=1 ) | |
| if len(sel) != 2: | |
| mc.warning('Please select two objects') | |
| return | |
| pos1 = mc.xform( sel[0], q=1, ws=1, t=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
| import re | |
| import maya.cmds as mc | |
| def addToGroup( *args ): | |
| post,replacePost,postIndex,dupIgnore = parseArgs( args ) | |
| allObj = mc.ls( sl=1, l=1 ) | |
| rootNode = [ a.rsplit('|',a.count('|')-1 )[0] if a.count('|') > 1 else a for a in allObj ] | |
| newHi = sum( ( [ k for k in mc.listRelatives( m, ad=1, typ='transform', f=1 ) ] + [m] if mc.listRelatives( m, ad=1, typ='transform', f=1 ) else [m] for m in list( set( rootNode ) ) ), [] ) | |
| hiSel = [ x for x in newHi if x in allObj ] | |
| newNObjects = [] | |
| for a in hiSel: |