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 selected curves in graph editor | |
| curves = pm.keyframe(q=True, selected=True, name=True) | |
| print(curves) | |
| """ | |
| [u'IKSpine2_M_visibility_idle_mvmt_inputB', u'IKSpine2_M_translateX_idle_mvmt_inputB', | |
| u'IKSpine2_M_translateY_idle_mvmt_inputB', u'IKSpine2_M_translateZ_idle_mvmt_inputB', | |
| u'IKSpine2_M_rotate_idle_mvmt_inputBX', u'IKSpine2_M_rotate_idle_mvmt_inputBY', | |
| u'IKSpine2_M_rotate_idle_mvmt_inputBZ', u'IKSpine2_M_scaleX_idle_mvmt_inputB', | |
| u'IKSpine2_M_scaleY_idle_mvmt_inputB', u'IKSpine2_M_scaleZ_idle_mvmt_inputB', |
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 | |
| current_frame = pm.getCurrentTime() | |
| curves = pm.findKeyframe(curve=True) | |
| first_key = 0.0 | |
| last_key = 0.0 | |
| for curve in curves: | |
| key = pm.findKeyframe(curve, which='first') |
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 | |
| def makeAnimLayer(layerName): | |
| baseAnimationLayer = cmds.animLayer(query=True, root=True) | |
| foundLayer = False | |
| if (baseAnimationLayer != None): | |
| childLayers = cmds.animLayer(baseAnimationLayer, query=True, children=True) |
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
| namespace = pm.selected()[0].namespace() |
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
| """ | |
| Script for setting counter translate keys on the feet for walk/run cycles. Select the 2 keys on the curve(s) | |
| of the foot Tz and run. It assumes you have a master curve with the speed for 1 second on the main control. | |
| """ | |
| import pymel.core as pm | |
| class Footfall: | |
| """ |
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 pymel.core.datatypes as dt | |
| def get_distance(object1, object2): | |
| # use rotation pivot to get the position since frozen transforms will affect | |
| # where the object "is" | |
| position1 = pm.xform(object1, query=True, worldSpace=True, rotatePivot=True) | |
| position2 = pm.xform(object2, query=True, worldSpace=True, rotatePivot=True) | |
| v1, v2 = dt.Vector(position1), dt.Vector(position2) |
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 mel | |
| def get_selected_channels(): | |
| #fetch maya's main channelbox | |
| channelBox = mel.eval('global string $gChannelBoxName; $temp=$gChannelBoxName;') | |
| attrs = cmds.channelBox(channelBox, q=True, sma=True) | |
| if not attrs: | |
| return [] | |
| return attrs |
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 * | |
| import pymel.core as pm | |
| import json | |
| from collections import Counter | |
| """ | |
| Glitch finder version 1.0 by Eric Luhta, ericl@splinecraft.com | |
| Creatist: Eric Luhta |
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
| """ | |
| ####################################################################### | |
| scale_keys v1.4 | |
| by Eric Luhta | |
| Last update: 12/20/2016 | |
| Makes scaling curves in the graph editor vastly more powerful and simple. | |
| Helpful info can be found in the tool's "About" tab. |
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 | |
| def get_snap_value(values, last_sel): | |
| differences = [] | |
| for value in values: | |
| differences.append(abs(last_sel - value)) | |
| return min(differences) | |
| def selection_ok(curve): |