(let* ((draw-offset-x (car (gimp-drawable-offsets drawable)))
:
:
(diff-clouds (car (gimp-layer-new image width height type
"Clouds" 100 DIFFERENCE-MODE)))
:
:
)
(gimp-image-undo-group-start image)
Graechan, I would point out that the above coding presents a memory leak potential in that it is creating a new layer before the UNDO history is grouped. Should the user perform an UNDO after running your 'asphalt-difference-clouds' procedure, the 'diff-clouds' layer will be removed from the image (since it was
added inside the UNDO group), but its creation will not be undone and the layer will occupy memory until GIMP is quit.
For your 'script-fu-asphalt', script this problem won't ever arise, since the entire script -- including the call to 'asphalt-difference-clouds' -- is itself wrapped in an UNDO group. Nonetheless, I wanted to point it out so that you were aware of what might happen in other cases.