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 `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 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
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 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 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") |
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 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_PP") |
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
from pymel.core import * | |
sel = selected()[0] | |
cam = PyNode( 'persp1' ) | |
parent( sel, cam, a=1 ) | |
bbcoord = xform( sel, q=1, os=1, bb=1 ) | |
near = -bbcoord[5] | |
far = -bbcoord[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
''' | |
mayaScene.uv | |
namespace for uv manipulation and queries | |
''' | |
import maya.cmds as cmds | |
def get_names(obj): |
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 cmds | |
mods = cmds.getModifiers() | |
if (mods & 4) > 0: | |
print "Ctrl pressed" | |
else: | |
print "Ctrl not pressed" |
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
/////////////////////////////////////////////////////////////////////////////////////////////////////////// | |
//This script was written by Ben Bathen. | |
//It was based on an idea presented By David Stripinis in his tutorial "Complex Character Setup In Maya For Games." | |
//It was completed April 5, 2003. | |
//This script bakes all the weights from wrap deformers and lattices into a skincluster on a mesh. | |
//This is helpful because a wrap deformer can have alot less vertices than a high Res mesh. | |
//Also you can edit the geomety on the high res mesh at any time without losing your weighting. | |
//select the root, then select the mesh, then execute the script. Works on only one mesh at a time. |
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.OpenMaya as OpenMaya | |
import pymel.core as pm | |
import math | |
#Function to get the texture name. | |
def GetFileTextureName(plug): | |
connectedPlugs = OpenMaya.MPlugArray() | |
plug.connectedTo(connectedPlugs, True, False) | |
for k in range(connectedPlugs.length()): | |
if (connectedPlugs[k].node().apiType() == OpenMaya.MFn.kFileTexture): |
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
from pymel.all import * | |
def getShellFaces( poly, str = 0 ): | |
shells = set() | |
faces = set() | |
total = polyEvaluate( poly, s=1) | |
for f in xrange( polyEvaluate( poly, f=1 ) ): | |
if len( shells ) >= total: |