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: |
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 | |
class randomScatter(): | |
def _init_(self): | |
if mc.window("randSelection", exists=1): | |
mc.deleteUI("randSelection") | |
mc.window("randSelection", t="WithOutFlip_Rivet - Avijit Das", w=405, sizeable=0) | |
mc.rowColumnLayout(nc=3,cal=[(1,"right")], cw=[(1,100),(2,200),(3,105)]) | |
mc.rowColumnLayout(w=405) | |
mc.text("Select two Edge the click Rivet", height=20) | |
mc.separator(height=20, style='in') |
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
''' | |
Author: Alexander Smirnov | |
The script will quickly search and add referenced files from directory you will enter in the main text field | |
Icon buttons from the lower right corner simply the same as the native maya ones | |
Start will launch the 'scriptJob' that monitoring any reference scene request before opening | |
Stop will delete the 'scriptJob' |