min/max

when I set the frame range to min/max, what commands are being run to find the start and end frame of animated objects, and how can I get and use those values?

Hi,

If the object is animated by keyframe, we can easily get the frame range to min/max with following command.

{
float $keys[] = keyframe -q -tc objName;
//or
//float $keys[] = keyframe -q -tc objName.attr;
print ("Min frame is " + $keys[0] + "n");
print ("Max frame is " + $keys[(size $keys)-1] + "n");
}

I hope this is what you wanted to do.

Best regards

that's close, but it assumes I know the name of the object in the scene that is animated. When I right-mouse click in the time slider and choose "Set Range to Min/Max", how does Maya find the object, and then set the range? I want to be able to replicate that process.
But thanx for the reply. It's very helpful for somehting else that I was going to need

the procedure attached to that command can be found in :/...AliasWavefront/Maya5.0/scripts/others/TimeSliderMenu.mel

you can copy the source from there.

HIH
s.

niiiiiiiiiiiice
thanx