5
; Chris Gutteridge (cjg@ecs.soton.ac.uk)
6
; At ECS Dept, University of Southampton, England.
7
; This program is free software; you can redistribute it and/or modify
8
; it under the terms of the GNU General Public License as published by
9
; the Free Software Foundation; either version 2 of the License, or
10
; (at your option) any later version.
12
; This program is distributed in the hope that it will be useful,
13
; but WITHOUT ANY WARRANTY; without even the implied warranty of
14
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
; GNU General Public License for more details.
17
; You should have received a copy of the GNU General Public License
18
; along with this program; if not, write to the Free Software
19
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22
; Define the function:
24
(define (script-fu-spinning-globe inImage
32
(theImage (if (= inCopy TRUE)
33
(car (gimp-image-duplicate inImage))
35
(theLayer (car (gimp-image-get-active-layer theImage)))
37
(ang (* (/ 360 inFrames)
38
(if (= inFromLeft TRUE) 1 -1) ))
42
(gimp-layer-add-alpha theLayer)
46
(set! theFrame (car (gimp-layer-copy theLayer FALSE)))
47
(gimp-image-add-layer theImage theFrame 0)
48
(gimp-drawable-set-name theFrame
49
(string-append "Anim Frame: "
50
(number->string (- inFrames n) 10)
52
(plug-in-map-object RUN-NONINTERACTIVE
72
; material (amb, diff, refl, spec, high)
86
-1 -1 -1 -1 -1 -1 -1 -1)
89
(gimp-image-remove-layer theImage theLayer)
90
(plug-in-autocrop RUN-NONINTERACTIVE theImage theFrame)
94
(gimp-image-convert-indexed theImage FS-DITHER MAKE-PALETTE inIndex
99
(gimp-image-clean-all theImage)
100
(gimp-display-new theImage))
103
(gimp-displays-flush)
107
(script-fu-register "script-fu-spinning-globe"
108
_"_Spinning Globe..."
109
"Maps the image on an animated spinning globe"
111
"1998, Chris Gutteridge / ECS dept, University of Southampton, England."
114
SF-IMAGE "The Image" 0
115
SF-DRAWABLE "The Layer" 0
116
SF-ADJUSTMENT _"Frames" '(10 1 360 1 10 0 1)
117
SF-TOGGLE _"Turn from left to right" FALSE
118
SF-TOGGLE _"Transparent background" TRUE
119
SF-ADJUSTMENT _"Index to n colors (0 = remain RGB)" '(63 0 256 1 10 0 1)
120
SF-TOGGLE _"Work on copy" TRUE)
122
(script-fu-menu-register "script-fu-spinning-globe"
123
_"<Image>/Script-Fu/Animators")