;; rotate-anim : Create multiple layers that rotate 180 degrees ;; author: Yoonsuck Choe, copyright 2001 (gnuPL) ;; See comment below for description and usage. (define (script-fu-rotate-anim inStep Blur) (let* ((step inStep) (blur Blur) (img 0)(drawable 2)(n drawable)(sn n) (w 85) (h 85) (s 0.2)) ; (w (/ (gimp-drawable-width n) 2)) ; (h (/ (gimp-drawable-height n) 2)) ; (s (/ (* 3.141592 step) 180.0))) ;; convert to RGB if image is INDEXED (if (= 1 (car (gimp-drawable-is-indexed drawable))) (gimp-convert-rgb img)) ;; copy current layer, add the layer, and rotate HUE by step ;; degrees (set! w (+ (/ (car (gimp-drawable-width n)) 2.0) 0)) (set! h (+ (/ (car (gimp-drawable-height n)) 2.0) 0)) (set! s (/ (* 3.141592 inStep) 180.0)) (while (< n (/ (/ 360 step) 2)) (gimp-layer-copy sn TRUE) ;; new copied layer is now n+1 (set! n (+ n 1)) (gimp-image-add-layer img n -1) ;; Strangely, value shift 0.0 makes image darker (gimp-transform-2d n blur w h 1.0 1.0 (* s n) w h) ) ) ) (script-fu-register "script-fu-rotate-anim" "/Xtns/Script-Fu/Misc/Rotate Animation - Simple" "Create multiple layers that rotate 180 degrees (for animations).\nStart with a fresh new image loaded at gimp startup.\nAt each step, a new layer is created and the bottom layer is copied and rotated. Parameters: step = degrees rotated per layer, blur = blur when rotating (gives better result)." "Yoonsuck Choe" "copyright 2001 (gnuPL), Yoonsuck Choe " "Dec 8, 2001" "" SF-VALUE "Step:" "10" SF-VALUE "Blur" "1" )