There’s also this. from maya.api import OpenMaya as om def onPlayingBack(state, _): if state is False: print("# Playback stopped!")
id = om.MConditionMessage.addConditionCallback("playingBack", onPlayingBack)# om.MMessage.removeCallback(id) It’ll catch all sorts of “playing” events, including your cmds.play(), *except* the hold-K-and-drag context. Not relevant in this case, but pointing it out anyway for future readers. What about a one time “idle” scriptJob event? Not sure about the scriptJob version, but for om.MTimerMessage.addTimerCallback() which is also called during times of idle, it actually gets called *during* playback as well, as Maya may sleep for some time inbetween each frame. E.g. if a scene natively runs at 10 ms/frame, but playback is locked to 30 ms/frame, then there’s 20 ms of idle inbetween each frame. On 8 May 2018 at 06:19, Wesley Chandler <heywes...@gmail.com> wrote: > Oh thanks Justin, thats a good idea! I'll give it a try. > > On Monday, May 7, 2018 at 3:37:53 PM UTC-4, Justin Israel wrote: >> >> What about a one time "idle" scriptJob event? >> >> On Tue, May 8, 2018, 3:43 AM Wesley Chandler <heyw...@gmail.com> wrote: >> >>> Hi guys, >>> >>> Does anyone know a way to run a function or scriptJob after playback >>> stops? >>> >>> I'm running a one-time scriptJob that launches cmds.play(record=True), >>> and after its done recording, I wanted to run a couple other commands after. >>> >>> Much thanks! >>> >>> -- >>> 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_maya+unsubscr...@googlegroups.com. >>> To view this discussion on the web visit https://groups.google.com/d/ms >>> gid/python_inside_maya/9ed9fc90-ef76-4dbc-8e18-00bbb84ba55b% >>> 40googlegroups.com >>> <https://groups.google.com/d/msgid/python_inside_maya/9ed9fc90-ef76-4dbc-8e18-00bbb84ba55b%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >> -- > 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_maya+unsubscr...@googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/python_inside_maya/1ceae32a-437b-49f2-8cd3- > f51d464eef4f%40googlegroups.com > <https://groups.google.com/d/msgid/python_inside_maya/1ceae32a-437b-49f2-8cd3-f51d464eef4f%40googlegroups.com?utm_medium=email&utm_source=footer> > . > > For more options, visit https://groups.google.com/d/optout. > -- 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_maya+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOD752S68uCbG-fgeKkzkj_ovH7woX3yfVXjaEVnv83BKw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.