Horganovski
01-03-2011, 02:05 AM
Hey Folks,
Probably a simple one for those who know their MEL, but I'm still pretty new to it and I'm afraid it has me stumped.
I'm trying to write a little animation helper and I want to get the last selected keyframe and store it in a variable. I can do this :
keyframe -q -lastSelected;
and it returns the value I need.. but I can't seem to store that in a variable, I've tried :
float $endKey=`keyframe -q -lastSelected`;
and
float $endKey[]=`keyframe -q -lastSelected`;
but both return errors (// Error: Cannot convert data of type float[] to type float. // ) and (// Error: Invalid redeclaration of variable "$endKey" as a different type. // ) respectively, but I'm afraid I'm still a little too green to be able to understand/make use of those messages. It seems to me that the variable should just be a float since I'm looking for a single number, but adding the brackets in the 2nd example to make the variable an array doesn't seem to work either. I'm probably overlooking something simple.
Any ideas much appreciated.
Cheers,
Brian
Probably a simple one for those who know their MEL, but I'm still pretty new to it and I'm afraid it has me stumped.
I'm trying to write a little animation helper and I want to get the last selected keyframe and store it in a variable. I can do this :
keyframe -q -lastSelected;
and it returns the value I need.. but I can't seem to store that in a variable, I've tried :
float $endKey=`keyframe -q -lastSelected`;
and
float $endKey[]=`keyframe -q -lastSelected`;
but both return errors (// Error: Cannot convert data of type float[] to type float. // ) and (// Error: Invalid redeclaration of variable "$endKey" as a different type. // ) respectively, but I'm afraid I'm still a little too green to be able to understand/make use of those messages. It seems to me that the variable should just be a float since I'm looking for a single number, but adding the brackets in the 2nd example to make the variable an array doesn't seem to work either. I'm probably overlooking something simple.
Any ideas much appreciated.
Cheers,
Brian
