All pastes #738894 Raw Edit

Unbenannt

public text v1 · immutable
·published 2007-10-16 18:39 UTC
rendered paste body
; Make a bunch of frames of threshold progressively getting larger
; Then we can make an animation.
(define (script-fu-animate-threshold img
			     drawable)

	(let ((i 0))
	(while (< i 135)
    ; Create a new layer
		(print "Got this far, in the inner loop")
		(let (
				(new-layer (car (gimp-layer-copy drawable 0)))
				; Give it a name
				(name (string-append "frame" (number->string i)))
			 )
			
			(print "Got this far, in the inner loop")
			(gimp-layer-set-name new-layer name)

			; Add the new layer to the image
			(print "Got this far, in the inner loop")
			(gimp-image-add-layer img new-layer 0)
		)
		(set! i (+ i 1))
		)
	)
  ; Flush the display 
  (gimp-displays-flush)   
)

(script-fu-register "script-fu-animate-threshold"
		    "<Image>/Script-Fu/Tutorial/animate-threshold"
		    "Animate Threshold"
		    "Jon Skulski"
		    "Jon Skulski"
		    "2007"
		    "RGB*, GRAY*"
		    SF-IMAGE "Image" 0
		    SF-DRAWABLE "Layer to blur" 0)