PDA

View Full Version : List selected keys?


PlebianX
11-26-2003, 01:14 PM
I'm making a little utility for a friend(who works for a potential employer ;) ) that just converted from max to maya, so that he can grab a keyframe in the graph editor and use a float slider group to set the in and out tangent angle exactly. This is obviously something you would normally only do to 1 keyframe at a time, but being the forward-thinking individual I wish I always was ;) I'm trying to get it to work well even with groups. When the keyframe selected doesn't have unifified tangents it moves them individually, and together when they're not broken. But if you have several keyframes selected it'll just do the same thing to all of them. So my question is:

Can you list and later select individual keyframes?
And also:
Can you set a control to update on selection changes? Otherwise upon recieving focus?

Thanks in advance!

Jhavna
11-27-2003, 11:46 AM
Can you list and later select individual keyframes?

This should work...

get the selected keyframe times:
float $times[] = `keyframe -sl -q`;
//query selected keys

get the transform types
string $types[] = `keyframe -sl -n -q`;
//query selected keys for name of anim curve


then to reselect
for ($i = 0; $i < size($names); $i++)
{
selectKey -add -k -t $key_time[$i] $names[$i] ;
}
//for the size of the $names (you could replace with $times) select the keyframe only (-k) at given time on the given animation curve


Can you set a control to update on selection changes? Otherwise upon recieving focus?

Unfortunately I haven't played around with controls yet as such, and I would also be interested how one would set this up....

CGTalk Moderation
01-16-2006, 07:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.