;; -*-scheme-*- ;; FlatLand - creates a tileable pattern that looks like a map ;; Copyright (C) 1997 Adrian Likins ;; ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by ;; the Free Software Foundation; either version 2 of the License, or ;; (at your option) any later version. ;; ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, write to the Free Software ;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. (define (script-fu-pattern-land-flat image drawable seed detail x-scale y-scale) ;; make the effect undoable (gimp-image-undo-group-start image) (if (= (car (gimp-selection-is-empty image)) TRUE) (gimp-selection-all image) ) ;; copy the original layer or selection (gimp-edit-copy drawable) ;; set this as layer one, even if it is not a proper layer yet (set! layer-1 (car (gimp-edit-paste drawable FALSE))) (gimp-floating-sel-to-layer layer-1) ;; but it is now ;; dont want a layer called "Pasted Layer", so change it (gimp-drawable-set-name layer-1 _"Noise Layer") ; not v1.2 compatible (plug-in-solid-noise 1 image layer-1 1 0 seed detail x-scale y-scale) (plug-in-c-astretch 1 image layer-1) (set! layer-2 (car (gimp-layer-copy layer-1 TRUE))) (gimp-image-add-layer image layer-2 -1) (gimp-image-set-active-layer image layer-2) (gimp-drawable-set-name layer-2 _"Flat Land Layer") ; not v1.2 compatible (plug-in-gradmap 1 image layer-2) (gimp-image-undo-group-end image) ;; end undo group (gimp-displays-flush) ;; force the display to update ) ;; put in the menu with the other patterns (set! menu-path _"/Filters/Render/Pattern/") ;; change name to get sorted beside Land ;(set! item-name _"Land Flat...") (set! item-name _"Flat Land...") ;; changed name, allows you to keep other version too if you want (script-fu-register "script-fu-pattern-land-flat" ;; (string-append menu-path item-name) _"/Filters/Render/Pattern/Flat Land..." ;; help description, usage instructions: "Land Flat creates a tileable pattern that looks like a map if used with the Land gradient. To use, open gradient editor, load the Land gradient then run the script. Try using the Map Object plugin to map to a sphere and create your own planet. SEE ALSO 'Land' script-fu, which does everything this script does and more. " "Adrian Likins. Alan Horkan. " "Adrian Likins. Alan Horkan. " "2004 08 13 UTC" ;; was "1997" "RGB*" SF-IMAGE "Image" 0 SF-DRAWABLE "Drawable" 0 SF-ADJUSTMENT _"Random Seed" '(80 1 2000000 1 10 0 1) SF-ADJUSTMENT _"Detail" '(5 1 15 1 10 1 0) SF-ADJUSTMENT _"Scale X" '(4 0.1 16 0.1 2 1 1) SF-ADJUSTMENT _"Scale Y" '(4 0.1 16 0.1 2 1 1) ) ;; ALAN: most of my changes here were back copied from my changes to the ;; more complicated land script-fu (also originally by Adrian Likins). ;; 'Land' script does everything this can do, so I have made only minimal changes