Store the selection of keys that are selected in the image I made as an example. That selection information can be used later to reselect the keys. I want to store in an array to be able to select them later by means of the index.
The script creates the animation keys. How can I select the new keys, either the key before or after the current frame in the timeline?
import maya.cmds as mc
def insertKeyPercentage(percentage = 100):
key1 = mc.currentTime(q = True)
p = 4
key2 = mc.setKeyframe(i = True, t = (key1 +p))
key3 = mc.setKeyframe(i = True, t = (key1 -p))
insertKeyPercentage(percentage = 100)
Have a look at selectKey()
it work similiar to the setKeyframe()
function.
key1 = mc.currentTime(q = True)
mc.selectKey(t=(key1-1, key1+1))