Edit in GAP
Effect (but an atypical one)
When this script is run, the selected range of frames is exported to GIMP GAP and then the user is presented with the following dialog.

As the message states, the user should leave the dialog open until editing in GIMP is complete. The checkbox has no effect but is included because the RFX plug-in system does not support a plain text message dialog by itself.

After closing the dialog by clicking OK, the modified frames will be imported into LiVES. If CANCEL is pressed, no changes will be imported but it may be necessary to run the GAP Cleanup utility to remove some exported files.

NOTE: No changes to the size or number of frames should be made while in GIMP.

Pre-loop code:
Loop code:
Post-loop code:
None -- a "dummy" boolean parameter is displayed, but is only there to present a message to the user and have the dialog wait for "OK".
This script uses some clever hacks to shoehorn the export/import process into a LiVES RFX "effect". It would probably be better implemented as a "tool", but tools operate on the entire clip, not the selected range.

The script moves much of the default.preloop code into the 'init' trigger so that it gets executed before the user is presented with the dialog ('preloop' code gets executed after the parameter dialog is closed). The 'init' code also converts the frames to XCF files. This is done because the parameter dialog is used to signal when the user has finished his GAP editing -- unlike other effects, clicking OK does not start the processing, it indicates the processing is basically finished.

The 'preloop' code merely re-establishes communication with the Script-fu server. Apparently 'init' code is run as a separate process and thus when that process finishes, the connection to the Script-fu server is lost.

The 'loop' code converts the modified XCF files into LiVES frames and the 'post-loop' code deletes all of the XCF files.