mirror of https://github.com/GNOME/gimp.git
Applied modified version of first patch for bug #642939.
Original patch supplied by Nelson A. de Oliveira. Modified to not use the -1 "insanity" for invalid/none layer ID's in scripts per IRC discussion.
This commit is contained in:
parent
8438bc5bb7
commit
403630fd57
|
@ -32,30 +32,29 @@
|
|||
|
||||
(gimp-context-push)
|
||||
|
||||
(gimp-image-insert-layer theImage baseLayer 0)
|
||||
(gimp-image-insert-layer theImage baseLayer 0 0)
|
||||
|
||||
(set! thickLayer (car (gimp-layer-new theImage theWidth theHeight RGBA-IMAGE "Camo Thick Layer" 100 NORMAL-MODE)))
|
||||
(gimp-image-insert-layer theImage thickLayer 0)
|
||||
(gimp-image-insert-layer theImage thickLayer 0 0)
|
||||
|
||||
(set! thinLayer (car (gimp-layer-new theImage theWidth theHeight RGBA-IMAGE "Camo Thin Layer" 100 NORMAL-MODE)))
|
||||
(gimp-image-insert-layer theImage thinLayer 0)
|
||||
(gimp-image-insert-layer theImage thinLayer 0 0)
|
||||
|
||||
(gimp-selection-all theImage)
|
||||
(gimp-context-set-background inColor1)
|
||||
(gimp-drawable-fill baseLayer BACKGROUND-FILL)
|
||||
|
||||
(plug-in-solid-noise RUN-NONINTERACTIVE
|
||||
theImage thickLayer 1 0 (rand 65536) 1 inGrain inGrain)
|
||||
theImage thickLayer 1 0 (rand 65536) 1 inGrain inGrain)
|
||||
(plug-in-solid-noise RUN-NONINTERACTIVE
|
||||
theImage thinLayer 1 0 (rand 65536) 1 inGrain inGrain)
|
||||
theImage thinLayer 1 0 (rand 65536) 1 inGrain inGrain)
|
||||
(gimp-threshold thickLayer 127 255)
|
||||
(gimp-threshold thinLayer 145 255)
|
||||
|
||||
(set! theBlur (- 16 inGrain))
|
||||
|
||||
(gimp-context-set-background inColor2)
|
||||
(gimp-by-color-select thickLayer
|
||||
'(0 0 0) 127 CHANNEL-OP-REPLACE TRUE FALSE 0 FALSE)
|
||||
(gimp-image-select-color theImage CHANNEL-OP-REPLACE thickLayer '(0 0 0))
|
||||
(gimp-edit-clear thickLayer)
|
||||
(gimp-selection-invert theImage)
|
||||
(gimp-edit-fill thickLayer BACKGROUND-FILL)
|
||||
|
@ -66,7 +65,7 @@
|
|||
|
||||
|
||||
(gimp-context-set-background inColor3)
|
||||
(gimp-by-color-select thinLayer '(0 0 0) 127 CHANNEL-OP-REPLACE TRUE FALSE 0 FALSE)
|
||||
(gimp-image-select-color theImage CHANNEL-OP-REPLACE thinLayer '(0 0 0))
|
||||
(gimp-edit-clear thinLayer)
|
||||
(gimp-selection-invert theImage)
|
||||
(gimp-edit-fill thinLayer BACKGROUND-FILL)
|
||||
|
|
|
@ -112,15 +112,7 @@
|
|||
(= remove-bg TRUE)
|
||||
(= separate-layer TRUE))
|
||||
(begin
|
||||
(gimp-by-color-select
|
||||
active-layer
|
||||
'(0 0 0)
|
||||
15
|
||||
2
|
||||
TRUE
|
||||
FALSE
|
||||
10
|
||||
FALSE)
|
||||
(gimp-image-select-color image CHANNEL-OP-REPLACE active-layer '(0 0 0))
|
||||
(gimp-edit-clear active-layer)))
|
||||
|
||||
(if (= keep-selection FALSE)
|
||||
|
|
|
@ -38,19 +38,19 @@
|
|||
)
|
||||
(gimp-context-set-gradient gradient)
|
||||
(gimp-image-undo-disable img)
|
||||
(gimp-image-add-layer img layer-one 0)
|
||||
(gimp-image-insert-layer img layer-one 0 0)
|
||||
|
||||
(plug-in-solid-noise RUN-NONINTERACTIVE img layer-one TRUE FALSE seed detail xscale yscale)
|
||||
(plug-in-c-astretch RUN-NONINTERACTIVE img layer-one)
|
||||
(set! layer-two (car (gimp-layer-copy layer-one TRUE)))
|
||||
(gimp-image-add-layer img layer-two -1)
|
||||
(gimp-image-insert-layer img layer-two 0 -1)
|
||||
(gimp-image-set-active-layer img layer-two)
|
||||
|
||||
(plug-in-gradmap RUN-NONINTERACTIVE img layer-two)
|
||||
|
||||
|
||||
|
||||
(gimp-by-color-select layer-one '(190 190 190) 55 CHANNEL-OP-REPLACE FALSE FALSE 0 FALSE)
|
||||
(gimp-image-select-color img CHANNEL-OP-REPLACE layer-one '(190 190 190))
|
||||
(plug-in-bump-map RUN-NONINTERACTIVE img layer-two layer-one 135.0 35 landheight 0 0 0 0 TRUE FALSE 0)
|
||||
|
||||
;(plug-in-c-astretch RUN-NONINTERACTIVE img layer-two)
|
||||
|
|
|
@ -34,7 +34,9 @@
|
|||
(gimp-image-undo-group-start theImage)
|
||||
(gimp-layer-resize theLayer (* 3 theWidth) (* 3 theHeight) 0 0)
|
||||
|
||||
(gimp-rect-select theImage 0 0 theWidth theHeight CHANNEL-OP-REPLACE 0 0)
|
||||
(gimp-context-set-feather 0)
|
||||
(gimp-context-set-feather-radius 0 0)
|
||||
(gimp-image-select-rectangle theImage CHANNEL-OP-REPLACE 0 0 theWidth theHeight)
|
||||
(gimp-edit-cut theLayer)
|
||||
|
||||
(gimp-selection-none theImage)
|
||||
|
@ -47,9 +49,9 @@
|
|||
(gimp-selection-none theImage)
|
||||
(if (= inType 0)
|
||||
(plug-in-gauss-iir RUN-NONINTERACTIVE
|
||||
theImage theLayer inRadius inHoriz inVert)
|
||||
theImage theLayer inRadius inHoriz inVert)
|
||||
(plug-in-gauss-rle RUN-NONINTERACTIVE
|
||||
theImage theLayer inRadius inHoriz inVert)
|
||||
theImage theLayer inRadius inHoriz inVert)
|
||||
)
|
||||
|
||||
(gimp-layer-resize theLayer
|
||||
|
|
Loading…
Reference in New Issue