Cancelling Scripts (GUI only)
In general you can’t cancel a script but certain operations can, such as importing a file or rendering an image, animation or XR. Cancelling in those situations means to cancel the dialog associated, like the rendering output window or import progress dialog.
The only operations you can cancel are:
- lux.importFile()
- lux.renderImage()
- lux.renderFrames()
- lux.renderAnimation()
- lux.renderXR()
- lux.encodeVideo()
Simply check the return value to see if it was False and therefore cancelled, or failed.
Especially if you’re using a loop-structure you can do the following:
>>> frames = 10
>>> for frame in range(1, frames + 1):
lux.setAnimationFrame(frame)
if not lux.renderImage("/path/to/output.{}.png".format(frame)):
break