Call back when playback gets to the end of the timeline

17 views
Skip to first unread message

Andres Felipe

unread,
Jun 29, 2021, 2:42:24 AMJun 29
to Python Programming for Autodesk Maya
Scenario:
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. 

Problem
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.

Cheers,

Andrés




Marcus Ottosson

unread,
Jun 29, 2021, 4:00:37 AMJun 29
to python_in...@googlegroups.com

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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/5ff06f46-36a8-47be-b832-5f0f50b36089n%40googlegroups.com.

Andres Felipe

unread,
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
Forward
0 new messages