Xsheet frame counter


Hi everyone.

I am an animator and here is the type of script that I would find very usefull for my work.

Timing is everything in animation and to get better at timing things out I would need a frame counter that would display the amount of frames that seperate the current time slider location from the previous key.

Would anyone know how to do that?



Would you want the number of frames to be displayed in the HUD or somewhere else.

The scirpt would be pretty simple. Probably using a script job to update when the time changes.

So for example if you had a control selected and the keys were in the timeline and there was a key on frame 10 and your current time is on frame 15. You want the value of 5 to be displayed correct?


exactly Scott. I am not very clued up in Mel scripting but I think it should be fairly simple. Probably need to save the current time value and compared it with the previous key and display the result on the HUD. Ideally the size of the font would be fairly big :wink:



Here’s a small script I wrote, hope it does what you’re looking for.

headsUpDisplay -section 1 -block 0 -blockSize "medium" -label "Previous keyframe :" 
 -labelFontSize "large" -command "calcPreviousKeyframe()" -event "timeChanged" HUDPreviousKeyframe;
 proc float calcPreviousKeyframe()
 if (size(keyframe("-time", currentTime("-q"),"-query")))
 return 0;
 return (`currentTime -q` - `findKeyframe -timeSlider -which previous`);


whoaooooo that s just perfect Eirini!

thanks a lot for your help.


beat me too it, that is basically what I was going to say



Irene, I made a little change to your script so that when positioned on a keyframe, it still tells us how many frames apart we are from the previous one.

Here is what I have:

headsUpDisplay -section 8 -block 0 -blockSize “large” -label “PreviousKEY:”

-labelFontSize “large” -command “calcPreviousKeyframe()” -event “timeChanged” HUDPreviousKeyframe;

proc float calcPreviousKeyframe()

return (currentTime -q - findKeyframe -timeSlider -which previous);

Now one thing I would find usefull is to be able to unable or disable the display by clicking on the button I created on the shelf. How could I do that?



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.