Created
January 9, 2019 01:35
-
-
Save splinecraft/ceb752a449f70704066e6d52771d4ba4 to your computer and use it in GitHub Desktop.
inverts selected keyframe values (* -1)
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 | |
curves = cmds.keyframe(q=True, sl=True, n=True) | |
if curves: | |
for curve in curves: | |
key_times = cmds.keyframe(curve, q=True, sl=True, tc=True) | |
key_vals = cmds.keyframe(curve, q=True, sl=True, vc=True) | |
for i, frame in enumerate(key_times): | |
cmds.keyframe(curve, e=True, time=(frame,frame), absolute=True, vc=(key_vals[i]*-1)) | |
else: | |
cmds.warning('No keys selected') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment