Skip to content

Instantly share code, notes, and snippets.

@tb-animator
Created January 21, 2020 17:46
Show Gist options
  • Select an option

  • Save tb-animator/ea4d4688ec19acdfedd7a768ab0da75d to your computer and use it in GitHub Desktop.

Select an option

Save tb-animator/ea4d4688ec19acdfedd7a768ab0da75d to your computer and use it in GitHub Desktop.
import maya.mel as mel
import maya.cmds as cmds
'''
Quickly scale your selected keys or entire animation curves by -1, if you have keys selected in the graphEditor, they will all be scaled.
If no keys are selected, the currently highlighted channels in the channelbox will be flipped
'''
gChannelBoxName = mel.eval('$temp=$gChannelBoxName')
selection = cmds.ls(sl=True)
chList = cmds.channelBox(gChannelBoxName,
query=True,
selectedMainAttributes=True)
cmds.scaleKey(includeUpperBound=False, valueScale=-1, valuePivot=-1, animation='keysOrObjects', attribute=chList)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment