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 setInfinite(): | |
# get active attr in graph editor | |
activeAttr = cmds.animCurveEditor("graphEditor1GraphEd",q=1,cs=1) | |
if activeAttr: | |
for spline in activeAttr: | |
objName = spline[0:spline.index("_")] | |
attr = spline[spline.index("_")+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 componentToJoint(): | |
if cmds.objectType(cmds.ls(sl=1)[0]) != "mesh": | |
return | |
# return the selection as a list | |
selList = getSelection() | |
print selList | |
componentType = selList[0][selList[0].index(".") + 1:selList[0].index("[")] |
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 | |
# bm_axisDisplay | |
# Forces the Local Rotation Axis display on or off for all joints or for the selected joints or transforms | |
def setAxisDisplay(display=False, allObj=False): | |
# if no joints are selected, do it for all the joints in the scene | |
# if allObj flag is True then this will toggle the axis display for all objects in the scene, not just joints. | |
if not allObj: | |
if len(cmds.ls(sl=1, type="joint")) == 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 | |
# replaces the selected transform's shape with a new one | |
def changeShape(obj=None,type=None): | |
shapeTypes = ["cube", "circle", "square", "triangle"] | |
if type not in shapeTypes: | |
print "Shape type not recognized" | |
return | |
if not obj: |
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 | |
# copy SDK from one driven node to another | |
def copySDK(): | |
# 1: Select driven object and then its driver | |
# 2: Select new driven object and then its driver | |
sel = cmds.ls(sl=1) | |
parentDriven = cmds.ls(sl=1)[0] | |
parentDriver = cmds.ls(sl=1)[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
# bm_nurbsRibbon | |
import maya.cmds as cmds | |
# sets up a ribbon with j drive joints and k bind joints | |
class NurbsRibbon(object): | |
def __init__(self, numFollicles=6, numDrivers=3, name="nurbsRibbon"): | |
if numDrivers <= 1: | |
return |
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
# our standard imports when using pySide | |
import maya.OpenMayaUI as omui | |
import maya.cmds as cmds | |
import maya.mel as mel | |
from PySide import QtCore | |
from PySide import QtGui | |
from shiboken import wrapInstance |
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 geoCtrl(name="geoCtrl_1", geo=[], child=None): | |
""" | |
:param name: The name for our geometry control. | |
:param geo: The list of our face selection. You can just pass it cmds.ls(sl=1) | |
:param child: The child that our control will manipulate. | |
:return: [ctrl, ctrlShape] |
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 | |
# bm_paintTools | |
# Intelligent tools for attribute painting | |
# optional values of op (operation) are absolute and smooth. Absolute replaces | |
def floodSelection(value=0, op="absolute"): |
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 sys | |
import os | |
from PySide import QtCore, QtGui, QtUiTools | |
import shiboken | |
import maya.cmds as cmds | |
import maya.OpenMayaUI as MayaUI | |
""" |