|
5 | 5 | (define (script-fu-set-all-layers-invisible inImage inDrawable) |
6 | 6 | (let* ( |
7 | 7 | (layers (gimp-image-get-layers inImage)) |
8 | | - (num-layers (car layers)) |
9 | | - (layer-array (cadr layers)) |
| 8 | + (layer-array (car layers)) |
| 9 | + (num-layers (vector-length layer-array)) |
10 | 10 | (theLayer) |
11 | 11 | ) |
12 | 12 |
|
13 | 13 | (gimp-image-undo-group-start inImage) |
14 | 14 |
|
15 | 15 | (while (> num-layers 0) |
16 | 16 | (set! num-layers (- num-layers 1)) |
17 | | - (set! theLayer (aref layer-array num-layers)) |
18 | | - (if (= (car (gimp-drawable-get-visible theLayer) ) TRUE) |
19 | | - (gimp-drawable-set-visible theLayer FALSE) |
| 17 | + (set! theLayer (vector-ref layer-array num-layers)) |
| 18 | + (if (= (car (gimp-item-get-visible theLayer) ) TRUE) |
| 19 | + (gimp-item-set-visible theLayer FALSE) |
20 | 20 | ) |
21 | 21 | ) |
22 | 22 |
|
|
46 | 46 | (let* |
47 | 47 | ( |
48 | 48 | (image (car (gimp-file-load RUN-NONINTERACTIVE inImageName inImageName))) |
49 | | - (visibleStuff (car (gimp-image-get-active-layer image))) |
| 49 | + (visibleStuff (vector-ref (car (gimp-image-get-selected-layers image)) 0)) |
50 | 50 | (layers (gimp-image-get-layers image)) |
51 | | - (num-layers (car layers)) |
52 | | - (layer-array (cadr layers)) |
| 51 | + (layer-array (car layers)) |
| 52 | + (num-layers (vector-length layer-array)) |
53 | 53 | (thisLayer -1) |
54 | 54 | (thisNumLayers 0) |
55 | 55 | (theseLayers layers) |
|
66 | 66 | ; iterate through all layers of the image |
67 | 67 | (while (> num-layers 0) |
68 | 68 | (set! num-layers (- num-layers 1)) |
69 | | - (set! thisLayer (aref layer-array num-layers)) |
70 | | - (set! thisLayerName (car (gimp-drawable-get-name thisLayer))) |
| 69 | + (set! thisLayer (vector-ref layer-array num-layers)) |
| 70 | + (set! thisLayerName (car (gimp-item-get-name thisLayer))) |
71 | 71 | ; (gimp-message (string-append "Image Layer-Name: " thisLayerName)) |
72 | 72 |
|
73 | 73 | ; iterate through all layer Names we shall use |
74 | 74 | (set! layerNames inLayerNames) |
75 | 75 | (while (not (null? layerNames)) |
76 | 76 | ; if layerName matches this user supplied layername: make it visible |
77 | 77 | (if (string=? (car layerNames) thisLayerName) |
78 | | - (gimp-drawable-set-visible thisLayer TRUE) |
| 78 | + (gimp-item-set-visible thisLayer TRUE) |
79 | 79 | ) |
80 | 80 | (set! layerNames (cdr layerNames)) |
81 | 81 | ) |
82 | 82 | ) |
83 | 83 |
|
84 | 84 | ; Merge all visible layers into one layer which we then save to the given filename |
85 | 85 | (set! visibleStuff (car (gimp-image-merge-visible-layers image CLIP-TO-IMAGE))) |
86 | | - (file-png-save RUN-NONINTERACTIVE image visibleStuff outImageName outImageName 0 9 0 0 0 0 0) |
| 86 | + (file-png-export #:run-mode RUN-NONINTERACTIVE #:image image #:file outImageName #:interlaced FALSE #:compression 9 #:bkgd FALSE #:offs FALSE #:phys FALSE #:time FALSE #:save-transparent FALSE) |
87 | 87 | (gimp-image-delete image) |
88 | 88 | ) |
89 | 89 | ) |
|
0 commit comments