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
""" | |
curves @ utils | |
parses paths to curve.mb's from assets/crvSrc folder | |
EXAMPLES: | |
#imports the first curve in crvSrc folder | |
mc.file(rigLib.utils.curves.curvesList[0], i=1) | |
#prints a list of curves in crvSrc folder |
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 | |
def makeSplineStretchy(chainJoints,chainCurve,stretchAxis = 'X'): | |
chainCurveShape = mc.listRelatives(chainCurve, shapes=1)[0] | |
lengthNode = mc.createNode('curveInfo', n = chainCurve + '_length') | |
mc.connectAttr(chainCurveShape + '.worldSpace[0]', lengthNode + '.inputCurve') | |
restLength = mc.getAttr(lengthNode + '.arcLength') | |
multiNode = mc.createNode('multiplyDivide', n= chainCurve + '_multiDiv' ) | |
mc.connectAttr(lengthNode + '.arcLength', multiNode + '.input1X') | |
mc.setAttr(multiNode + '.input2X', restLength) | |
mc.setAttr(multiNode + '.operation', 2) |
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 | |
from functools import partial | |
def createWindow(): | |
if len(mc.ls(sl=1)) is 2: | |
selSource = mc.ls(sl=1)[0] | |
selTarget = mc.ls(sl=1)[1] | |
else: | |
selSource = selTarget = 'nothing selected' | |
windowName = 'Pose Driver Widget' |
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 sys, os | |
import maya.cmds as mc | |
import rigit.v1_0 as rigit | |
mobilePath = 'C:/Users/Peter/Google Drive/projects/' | |
officePath = '//MONTANA/jobs/ghost/bipedal_drone/assets/' | |
workingPath = officePath | |
assetName = 'bipod' |
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 sys, os | |
import maya.cmds as mc | |
import rigit.v1_0 as rigit | |
mobilePath = 'C:/Users/Peter/Google Drive/projects/' | |
officePath = '//MONTANA/jobs/ghost/bipedal_drone/assets/' | |
workingPath = officePath | |
assetName = 'bipod' |
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 hasSkinCluster(objList = []): | |
hasClusterList = [] | |
for obj in objList: | |
objHist = mc.listHistory(obj, pdo=True) | |
skinCluster = mc.ls(objHist, type="skinCluster") or [None] | |
cluster = skinCluster[0] | |
if cluster: | |
hasClusterList.append(obj) | |
return hasClusterList |
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 oneChannelFalloff( ctrlAt, targetAts, stepFactor = 1 ): | |
''' | |
@param ctrlAt: string, attribute driving the targets | |
@param ctrlAt: string, attribute driven by stepped influence from ctrlAt | |
@param stepFactor: float, how much influence should the effect have | |
@param preval: float, optional starting value of control Attr to be normalized | |
''' | |
preval = mc.getAttr( ctrlAt ) | |
step = 1.0 / len( targetAts ) |
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
for i in range(10): | |
for j in range(10): | |
coord = (i,0,j) | |
print coord | |
plane = mc.polyPlane() | |
mc.xform(plane, t = coord, ws=1) | |
mc.aimConstraint('locator1', plane) | |
# normal for loop iterating over string | |
for x in 'esteban': |
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 mm | |
from rigit.v1_0.utils import hair | |
def makeSoftTarget(prefix, smoothness = 10, parent = None): | |
''' | |
a function for making a single transform with soft body effects | |
@param prefix: str, prefix for naming objects | |
@param smoothness: float, how loosely particle fallows, 10 is very loose 0 is 100% fallow |
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
""" | |
class for creating ball control object | |
@category Rigging @subcategory Rigbase | |
@tags control class | |
@author: petey | |
""" | |
import maya.cmds as mc | |
class ballControl(): | |
def __init__( |
OlderNewer