Select keys= current frame

Select keys= current frame

dg3duy
Collaborator Collaborator
536 Views
6 Replies
Message 1 of 7

Select keys= current frame

dg3duy
Collaborator
Collaborator

How to select the keys of a selected object but only the keys of the current time of the timeline.
For example, I have an animated sphere and in frame 25 I run the script and it selects only the keys of that particular frame.

0 Likes
Accepted solutions (2)
537 Views
6 Replies
Replies (6)
Message 2 of 7

mcw0
Advisor
Advisor
Accepted solution

selectKey("-time", `currentTime -q`)

0 Likes
Message 3 of 7

dg3duy
Collaborator
Collaborator

Works perfect!
How would it be in phyton to do the same, thank you very much for your time.

0 Likes
Message 4 of 7

mcw0
Advisor
Advisor

cmds.selectKey(time=cmds.currentTime(q=1))

0 Likes
Message 5 of 7

dg3duy
Collaborator
Collaborator
# Error: TypeError: Invalid arguments for flag 'time'.  Expected (time, [time]), got float # 

this time in the python version an error occurs when executing the line of code

0 Likes
Message 6 of 7

mcw0
Advisor
Advisor
Accepted solution

Sorry, I wasn't in Maya and didn't test it.

cmds.selectKey(time=(cmds.currentTime(q=1), cmds.currentTime(q=1)))

Message 7 of 7

dg3duy
Collaborator
Collaborator
a wonder, thank you very much!
0 Likes