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 | |
filepath = r'E:/test_folder/' | |
os.chdir(filepath) | |
# make all filenames lowercase | |
for file in os.listdir(os.getcwd()): | |
name = file.lower() | |
os.rename(file, name) |
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
helper = MaxPlus.Factory.CreateHelperObject(MaxPlus.ClassIds.Point) | |
helper_node = MaxPlus.Factory.CreateNode(helper) | |
MaxPlus.INode.SetBoneNodeOnOff(helper_node, True, 0) # Bone On | |
MaxPlus.INode.SetBoneAutoAlign(node, False) # Auto-Align off | |
MaxPlus.INode.SetBoneScaleType(node, 0) # Stretch: None |
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 | |
persp = cmds.getPanel(withLabel='Persp View') | |
ge = cmds.getPanel(withLabel='Graph Editor') | |
if cmds.getPanel(withFocus=True) == persp: | |
cmds.panel(persp, edit=True, replacePanel=ge) | |
if cmds.getPanel(withFocus=True) == ge: | |
cmds.panel(ge, edit=True, replacePanel=persp) |
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 node in pm.selected(): | |
if node.nodeType() in ["joint"]: | |
if node.drawStyle.get() is 0: | |
node.drawStyle.set(2) | |
else: | |
node.drawStyle.set(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 pymel.core as pm | |
""" | |
To use: | |
Select a control on the source and then a control on the destination | |
Run the copy command | |
Select controls of the source to be copied | |
Run the paste command |
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 | |
selection = mc.ls(sl=1) | |
toSelect = [] | |
for item in selection: | |
constraint = mc.listConnections( item+'.parentInverseMatrix[0]', d=1, s=0,type='constraint') | |
if constraint: | |
constraint = constraint[0] | |
src = mc.listConnections(constraint+'.target[0].targetParentMatrix', d=0, s=1) | |
if src: | |
toSelect.extend(src) |
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 pymel.core as pm | |
anim_layer_editor = 'AnimLayerTabanimLayerEditor' | |
current_anim_layers = pm.treeView(anim_layer_editor, q=True, si=True) | |
pm.mel.layerEditorSelectObjectAnimLayer(current_anim_layers) |
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 pymel.core as pm | |
from el_anim_utilities import anim_util as anim | |
selection = pm.ls(sl=True) | |
for sel in selection: | |
coord = pm.xform(sel, q=True, ws=True, rotatePivot=True) | |
loc = pm.spaceLocator(name='{}_loc'.format(sel)) | |
pm.xform(loc, s=(40, 40, 40), t=coord) | |
anim.set_color(loc, 17) |
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 pymel.core as pm | |
import maya.mel as mel | |
import maya.cmds as cmds | |
CORE_ATTRIBUTES = {'rx': 'rotateX', | |
'ry': 'rotateY', | |
'rz': 'rotateZ', | |
'tx': 'translateX', | |
'ty': 'translateY', | |
'tz': 'translateZ' |
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 pymel.core as pm | |
import collections | |
import anim_util as au | |
reload(au) | |
class AnimCurve: | |
"""Stores all data of an animation curve for copying/rebuilding""" |