RFX-GIMP
gap-edit
Not logged in
Command:
Edit in GAP
Type:
Effect (but an atypical one)
Download:
gap-edit.script
Description:
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:
gap-edit.preloop
Loop code:
gap-edit.loop
Post-loop code:
gap-edit.post
Triggers:
gap-edit.init
Parameters:
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".
Notes:
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.