Being the owner of a valiant but slow machine, for a long time I’ve been using a keyboard shortcut to pause and resume cycles’ rendered viewport preview. It’s set up with wm.context_toggle as identifier and scene.cycles.preview_pause as context.
It had quirk of not updating the UI button until you hovered it, but it worked as intended, immediately toggling the preview state.
Python equivalent for quick testing:
import bpy bpy.context.scene.cycles.preview_pause = False #True if you want to pause
Unfortunately, I can’t get it to work on 2.80 and later. The script runs without errors, the button changes state when you hover it but the actual preview state doesn’t change.
The INFO panel shows the python for this action should be the same from 2.79 and earlier, and Blender acknowledges that the preview_pause state changed, so what’s going on here? Is there some new attribute setting being changed under the 2.8+ hood that I’m missing?
(two manual clicks interposed by a Run Script)