|14-10-2017, 08:38 PM||#1|
Join Date: Sep 2011
Selecting every second keyframe
Hi, is there a way to select every second or nth frame?
I have ~hundred frames - baked range, and to create shivering effect I need to select each second key-frame.
Doing it manually would take ~10 minutes every time.
|21-10-2017, 01:59 AM||#2|
Join Date: Dec 2006
Location: South FL
Run this code in a Python tab. The "2" popping up throughout the code just means that while looping through the list, it will act on every other item, essentially its your "nth item" value. Let me know if there are any issues.
import maya.cmds as mc object = mc.ls(selection =True) keys = mc.keyframe(object, query =True) i = 0 while i < len(keys): mc.selectKey(object, k =True, time = (keys[i], keys[i]), add =True) i = i+2 print "Selected " + str(len(keys[::2])) + " keys: ", str(keys[::2])
|Thread||Thread Starter||Forum||Replies||Last Post|
|How to copy a keyframe and get everything with it||jttraverse||Maya Basics & Newbie Lounge||8||11-06-2016 09:26 AM|
|Keyframe simple maya loops in python?||St4rb0y||Mel Scripts & Programming||0||14-07-2014 04:36 PM|
|Can't keyframe||yolpyolpp||Maya Basics & Newbie Lounge||1||20-01-2014 04:43 PM|
|Selecting Control Vertices||Emms||Technical Issues||1||04-10-2012 04:14 AM|
|selecting objects instead of surfaces?||aebstract||Maya Basics & Newbie Lounge||10||27-05-2011 11:43 AM|