Created
July 27, 2016 19:25
-
-
Save Onefabis/69526ebf0ad573f8554cd05713ccfa37 to your computer and use it in GitHub Desktop.
deletes the keys with decimal 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.cmds as mc | |
import maya.mel as mel | |
selObj = mc.ls( sl=1 ) | |
aPl = mel.eval('$tmpVar=$gPlayBackSlider') | |
trg = mc.timeControl( aPl, q=1, ra=1 ) | |
if( trg[1]-trg[0]>1 ): | |
sttr = trg[0] | |
endtr = trg[1] | |
else: | |
sttr = mc.playbackOptions( q=1, min=1 ) | |
endtr = mc.playbackOptions( q=1, max=1 ) | |
timeK = mc.keyframe( selObj, q=1, tc=1, t=( sttr, endtr ) ) | |
y = list( sorted( set( timeK ) ) ) | |
floatsK = [ x for x in y if x-int(x)] | |
for f in floatsK: | |
mc.keyframe( t=(f,f), a=1, tc=max( timeK ) + 1, o='over' ) | |
mc.cutKey( cl=1, t=(max( timeK ) + 1, ) ) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment