Rod wrote:
...Try that first.If it works Gimp will open all the pat files in single layers then use GAP to save all layers as separate png images.Then just throw them all in the patterns folder or direct a path to them from Edit/Pref/Patterns...
To save layers as *. pat can be useful scripts:
script-fu-save-layers-to-pat-files
; Saves_all_layers_to_separate_pat_files.scm
;
; origine http://groups.google.ca/group/comp.graphics.apps.gimp/browse_thread/thread/010e01bd0930438a#
; modification pour enregistrer en .pat (motifs Gimp)
; fonctionne Gimp 2.6.1 Windows
;
(define (script-fu-save-layers-to-pat-files image dont-ask display-images short-description-of-the-pattern)
(let ((basename (car (gimp-image-get-filename image))))
(when (string=? basename "")
(set! basename (string-append
(car (gimp-temp-name ""))
(car (gimp-image-get-name image)))))
(let loop ((layers (vector->list (cadr (gimp-image-get-layers image)))))
(unless (null? layers)
(gimp-edit-copy (car layers))
(let ((img (car (gimp-edit-paste-as-new)))
(new-name (string-append
basename
(car (gimp-drawable-get-name (car layers)))
".pat")))
(file-pat-save dont-ask img (aref (cadr (gimp-image-get-layers img)) 0) new-name new-name short-description-of-the-pattern)
(if (= FALSE display-images)
;; clean up afterwards if we are not going to
;; display the images anyway:
(gimp-image-delete img)
(gimp-display-new img)))
(loop (cdr layers))))))
(script-fu-register "script-fu-save-layers-to-pat-files"
; modif samj _"Save all layers to a different file"
_"Save layers to pat (Motifs Gimp)..."
_"Saves all layers to separate .pat files"
"Niels Giesen ([email protected]) - samj"
"Niels Giesen - samj"
"2008-10-29"
""
SF-IMAGE "Image" 1
SF-TOGGLE _"Don't ask options for each layer" TRUE
SF-TOGGLE _"Display images?" FALSE
SF-STRING "Description sommaire des motifs" "Motifs issus de calques")
(script-fu-menu-register "script-fu-save-layers-to-pat-files"
; modif samj _"<Image>/File")
_"<Image>/File")script-fu-save-pat-layers
; 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.
;; Take a pattern file with multiple layers -- for example, one
;; created by the Photoshop Pattern Loader plug-in -- and save
;; each layer as a separate GIMP-usable pattern.
;;
;; Installed in "Filters->Animations->Save layers as patterns"
(define (script-fu-save-pat-layers image drawable)
(gimp-progress-set-text "Saving layers as pattern files")
(gimp-image-undo-group-start image)
(gimp-selection-none image)
(let* (
(layers (gimp-image-get-layers image))
(num-layers (car layers))
(i 0)
(layers (cadr layers))
(path (string-append gimp-directory "/patterns/"))
(extension ".pat")
)
(while (< i num-layers)
(let* (
(layer (aref layers i))
(layer-name (car (gimp-layer-get-name layer)))
(fullpath (string-append path layer-name extension))
)
(plug-in-autocrop-layer RUN-NONINTERACTIVE image layer)
;; Note -- this changes the original image,
;; leaving each layer autocropped
(file-pat-save RUN-NONINTERACTIVE image layer fullpath fullpath
layer-name)
)
(set! i (+ i 1))
))
(gimp-progress-set-text "Saved all layers")
(gimp-image-undo-group-end image)
(gimp-displays-flush)
)
(script-fu-register "script-fu-save-pat-layers"
"<Image>/File/Save layers as patterns (*.pat)"
"Save each layer to a separate file after autocropping *.pat in gimp-directory /patterns/"
"Akkana Peck"
"Akkana Peck"
"6/3/2009"
""
SF-IMAGE "Image" 0
SF-DRAWABLE "Drawable" 0
)
The two scripts in Save as pat.zip