Created
June 3, 2013 01:08
-
-
Save dgovil/5695617 to your computer and use it in GitHub Desktop.
Set whatever object you want as the master object. It'll clean up all the other selected controllers to only have keyframes when the master controller does.
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
masterObject = "controllerName" | |
import maya.cmds as mc | |
objs = mc.ls(sl=1) | |
keyframes = mc.keyframe(masterObject,q=1) | |
fs = int( mc.playbackOptions(q=1, ast=1 ) ) | |
fe = int( mc.playbackOptions(q=1, aet=1 ) ) | |
keyframes = sorted( [k for k in set(keyframes) if k>=fs and k<=fe] ) | |
objs = mc.ls(sl=1) | |
for f in range(fs,fe+1): | |
if f in keyframes: | |
mc.setKeyframe(objs,t=[f],i=True) | |
for f in range(fs,fe+1): | |
if f not in keyframes: | |
mc.cutKey(objs, time=(f,f) ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment