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
''' | |
Align pivots by Serge Scherbakov. | |
Usage: | |
1. Select source object(s) | |
2. Add to selection target object | |
3. Run script by 'import copyPivot\n copyPivot.copyPivot() | |
''' | |
import maya.cmds as cmds | |
import maya.mel as mel |
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
''' [Crease To Normal] | |
Created on 23.07.2012 | |
edgeCreaser - uses edge Crease info to make it hard edge, or use Hard edge info to make edge crease. | |
@author: Serge Scherbakov | |
''' | |
import maya.cmds as cmds | |
class edgeCreaser(): | |
@staticmethod | |
def apply(mode = 'c2n'): |
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
from pymel.all import * | |
sel = ls( selected(), fl=1 ) | |
aCe = [] | |
while len( sel ): | |
ce = [] | |
for e in sel: | |
if ce == []: ce.append( e ) | |
else: |
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
# --------------------------------------------------------------------------------------- | |
# - pompVertNormFaceAvg | |
# | |
# - Sets the vertex normals of a face selection, | |
# averaging normals shared by multiple selected faces. | |
# | |
# | |
# - by Pontus Karlsson 2013 (www.pomperi.com) | |
# --------------------------------------------------------------------------------------- |
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
cmds.select(cmds.ls(dag=1, ap=1, sl=1, type="joint")) | |
cmds.select(cmds.ls(dag=1, ap=1, sl=1, type="nurbsCurve")) | |
cmds.select(cmds.ls(dag=1, ap=1, sl=1, type="constraint")) |
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
selection = cmds.ls(sl = True) | |
for model in selection: | |
refcheck = cmds.referenceQuery(model, inr = True) | |
if (refcheck == 1): | |
reftodel = cmds.referenceQuery(model, f = True) | |
cmds.file(reftodel, rr = True) | |
cmds.file(newfile, r=True) | |
else: | |
cmds.delete(model) | |
cmds.file(newfile, i=True) |
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 dragAttr( attr_names ): | |
if not cmds.dragAttrContext('dragAttributeCtx', ex=True): | |
cmds.dragAttrContext('dragAttributeCtx') | |
cmds.dragAttrContext( 'dragAttributeCtx', e=True, ct=attr_names ) | |
cmds.setToolTo( 'dragAttributeCtx' ) | |
dragAttr( "Push_Deform2.inflation" ) |
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
select `ls -typ "animCurveTL" -typ "animCurveTU" -typ "animCurveTA" -typ "animCurveTT"`; gets just the curves that are animated - i.e. parameters that change over time The 2 letters at the end specify imput and output units input is Time or Unitless output is Linear Unitless Angle or Time - gotta admit, i never knew about the ls -typ "animCurve" catchall - thanks |
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
from pymel.core import * | |
for s in selected(): | |
so = PyNode( 'tinker_director_anim:' + s ) | |
connectAttr( so.t, s.t, f=1, l=0 ) | |
connectAttr( so.r, s.r, f=1, l=0 ) | |
connectAttr( so.s, s.s, f=1, l=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 | |
import maya.mel as mel | |
import maya.OpenMaya as om | |
#Add Render Element Extra_Tex | |
mel.eval("vrayAddRenderElement ExtraTexElement") | |
#Rename Extra_Tex | |
cmds.rename("vrayRE_Extra_Tex", "vrayRE_Extra_Tex_UV") |
OlderNewer