Call back when playback gets to the end of the timeline

Skip to first unread message

Andres Felipe

Jun 29, 2021, 2:42:24 AMJun 29
to Python Programming for Autodesk Maya
Building a custom Sequencer in Maya. I need to get a callback when maya plays the last frame of the timeline in order to set the timeline with other range. 

Checking if [Current Frame == Last timeline frame] does not work because when you play at certain fps, Maya sometimes jumps some frames. so sometimes I dont get True with [Current Frame == Last timeline].

What I've tried
- Setting playback looping options to "Once" everytime user click on Play, so it always plays the last frame. Problem: sometimes the last frames appears to be stuck for some milliseconds. Its not a continuous Sequence.

- Extend timeline for 30 Extra frames so I have to check if [Current Frame >= Last shot frame]. It plays very contnuous without any stucking frame but, Problem: sometimes plays a "fake" frame that is not part of the current Shot.

I think I need to know if there is a script job or an Open Maya callback that is triggered everytime Maya achieves the last frame in order to execute their looping playback options.

Thanks a lot for your helping.



Marcus Ottosson

Jun 29, 2021, 4:00:37 AMJun 29

Try replacing if [Current Frame == Last timeline frame] with if [Current Frame < Last Frame].

That way, whenever it rewinds, regardless of the last frame, you’ll know.

You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

Andres Felipe

Jun 30, 2021, 2:57:55 AMJun 30
to Python Programming for Autodesk Maya
Hi Marcus,

Thank you for responding so quickly. 

I will try that way but I think that when it rewinds It will show the first frame.
Reply all
Reply to author
0 new messages