All pastes #738897 Raw Edit

Anonym

public text v1 · immutable
·published 2007-10-16 18:40 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 130)
  (while (< i 135)
    ; Create a new layer
    (print "Got this far, in the inner loop")
    (set! new-layer (car (gimp-layer-copy drawable 0)))
  
    ; Give it a name
    (set! 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)
    
    (let* 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)