Don't change global context and protect scripts from global context settings.

This commit is contained in:
Kevin Cozens
2011-11-09 02:42:34 -05:00
parent 05d4e78830
commit 27bef34bd5
54 changed files with 268 additions and 231 deletions

View File

@ -82,6 +82,7 @@
)
(gimp-context-push)
(gimp-context-set-defaults)
; disable undo on copy, start group otherwise
(if (= work-on-copy TRUE)

View File

@ -128,8 +128,7 @@
)
(gimp-context-push)
(gimp-context-set-antialias TRUE)
(gimp-context-set-feather FALSE)
(gimp-context-set-defaults)
(gimp-image-undo-disable img)
;(gimp-image-resize img (+ length height) (+ height height) 0 0)

View File

@ -20,8 +20,7 @@
)
(gimp-context-push)
(gimp-context-set-antialias TRUE)
(gimp-context-set-feather FALSE)
(gimp-context-set-defaults)
(gimp-selection-none img)
(script-fu-util-image-resize-from-layer img logo-layer)

View File

@ -45,6 +45,7 @@
)
(gimp-context-push)
(gimp-context-set-defaults)
(script-fu-util-image-resize-from-layer img logo-layer)
(script-fu-util-image-add-layers img bands-layer bg-layer)

View File

@ -13,6 +13,7 @@
)
(gimp-context-push)
(gimp-context-set-defaults)
(gimp-selection-none img)
(script-fu-util-image-resize-from-layer img logo-layer)

View File

@ -31,6 +31,7 @@
)
(gimp-context-push)
(gimp-context-set-defaults)
(gimp-selection-none img)
(script-fu-util-image-resize-from-layer img logo-layer)

View File

@ -83,8 +83,7 @@
)
(gimp-context-push)
(gimp-context-set-antialias TRUE)
(gimp-context-set-feather FALSE)
(gimp-context-set-defaults)
(gimp-image-undo-disable img)
(gimp-image-insert-layer img background 0 -1)

View File

@ -27,8 +27,7 @@
)
(gimp-context-push)
(gimp-context-set-antialias TRUE)
(gimp-context-set-feather FALSE)
(gimp-context-set-defaults)
(gimp-image-undo-disable img)
(gimp-image-insert-layer img background 0 -1)

View File

@ -45,6 +45,7 @@
)
(gimp-context-push)
(gimp-context-set-defaults)
(gimp-image-undo-disable img)
(gimp-image-resize img width height 0 0)

View File

@ -108,6 +108,7 @@
blend-gradient-reverse)
(begin
(gimp-context-push)
(gimp-context-set-defaults)
(gimp-image-undo-group-start img)
(apply-blended-logo-effect img logo-layer b-size bg-color

View File

@ -35,6 +35,7 @@
)
(gimp-context-push)
(gimp-context-set-defaults)
(script-fu-util-image-resize-from-layer img logo-layer)
(script-fu-util-image-add-layers img blur-layer bg-layer)

View File

@ -55,7 +55,7 @@
;--- main program structure starts here, begin of "if-1"
(begin
(gimp-context-push)
(gimp-context-set-feather FALSE)
(gimp-context-set-defaults)
(set! img (car (gimp-image-duplicate org-img)))
(gimp-image-undo-disable img)

View File

@ -31,6 +31,7 @@
)
(gimp-context-push)
(gimp-context-set-defaults)
(gimp-image-insert-layer theImage baseLayer 0 0)

View File

@ -77,6 +77,7 @@
)
(gimp-context-push)
(gimp-context-set-defaults)
(gimp-image-undo-disable img)

View File

@ -51,6 +51,7 @@
)
(gimp-context-push)
(gimp-context-set-defaults)
(gimp-image-undo-disable img)

View File

@ -53,6 +53,7 @@
)
(gimp-context-push)
(gimp-context-set-defaults)
(script-fu-util-image-resize-from-layer img logo-layer)
(script-fu-util-image-add-layers img bump-layer bg-layer)

View File

@ -110,6 +110,7 @@
)
(gimp-context-push)
(gimp-context-set-defaults)
(gimp-image-undo-disable img)

View File

@ -21,6 +21,7 @@
)
(gimp-context-push)
(gimp-context-set-defaults)
(script-fu-util-image-resize-from-layer img logo-layer)
(script-fu-util-image-add-layers img layer1 layer2 layer3 shadow background)

View File

@ -51,6 +51,7 @@
)
(gimp-context-push)
(gimp-context-set-defaults)
(gimp-image-undo-group-start image)

View File

@ -26,8 +26,7 @@
)
(gimp-context-push)
(gimp-context-set-antialias TRUE)
(gimp-context-set-feather FALSE)
(gimp-context-set-defaults)
(gimp-image-undo-group-start theImage)

View File

@ -176,6 +176,7 @@
)
(gimp-context-push)
(gimp-context-set-defaults)
(gimp-context-set-foreground text-color)
(gimp-context-set-background bg-color)

View File

@ -32,6 +32,7 @@
)
(gimp-context-push)
(gimp-context-set-defaults)
(gimp-context-set-feather FALSE)
(gimp-context-set-interpolation INTERPOLATION-NONE)
(gimp-context-set-transform-resize TRANSFORM-RESIZE-ADJUST)

View File

@ -112,6 +112,7 @@
(disp-map 0)
)
(gimp-context-push)
(gimp-context-set-defaults)
(gimp-image-delete back-img)
(gimp-image-undo-disable img)

View File

@ -37,7 +37,10 @@
(theMode (car (gimp-image-base-type inImage)))
)
(gimp-context-push)
(gimp-context-set-defaults)
(gimp-image-undo-group-start theImage)
(if (= theMode GRAY)
(set! theMode GRAYA-IMAGE)
(set! theMode RGBA-IMAGE)
@ -90,6 +93,7 @@
(gimp-image-undo-group-end theImage)
(gimp-displays-flush)
(gimp-context-pop)
)
)

View File

@ -56,6 +56,7 @@
)
(gimp-context-push)
(gimp-context-set-defaults)
(gimp-image-set-active-layer image drawable)

View File

@ -34,6 +34,7 @@
)
(gimp-context-push)
(gimp-context-set-defaults)
(if ( = isnew 1) (script-fu-util-image-resize-from-layer img shadow-layer))

View File

@ -50,6 +50,7 @@
)
(gimp-context-push)
(gimp-context-set-defaults)
(script-fu-util-image-resize-from-layer img logo-layer)
(script-fu-util-image-add-layers img grow-me bg-layer)

View File

@ -19,6 +19,7 @@
)
(gimp-context-push)
(gimp-context-set-defaults)
(script-fu-util-image-resize-from-layer img logo-layer)
(script-fu-util-image-add-layers img glow-layer bg-layer)

View File

@ -34,6 +34,7 @@
)
(gimp-context-push)
(gimp-context-set-defaults)
(script-fu-util-image-resize-from-layer img logo-layer)
(script-fu-util-image-add-layers img blur-layer bg-layer)

View File

@ -32,6 +32,7 @@
)
(gimp-context-push)
(gimp-context-set-defaults)
(gimp-image-undo-disable img)
(gimp-image-undo-disable distortion-img)

View File

@ -36,6 +36,9 @@
RGB-IMAGE "Bottom" 100 NORMAL-MODE)))
(layer-two 0)
)
(gimp-context-push)
(gimp-context-set-defaults)
(gimp-context-set-gradient gradient)
(gimp-image-undo-disable img)
(gimp-image-insert-layer img layer-one 0 0)
@ -48,8 +51,6 @@
(plug-in-gradmap RUN-NONINTERACTIVE img layer-two)
(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)
@ -64,6 +65,7 @@
(gimp-display-new img)
(gimp-image-undo-enable img)
(gimp-context-pop)
)
)

View File

@ -46,6 +46,7 @@
)
(gimp-context-push)
(gimp-context-set-defaults)
(gimp-image-undo-group-start image)
(if (= (car (gimp-drawable-has-alpha drawable)) FALSE)

View File

@ -25,8 +25,7 @@
(dir-deg/line (/ 360 num-of-lines))
)
(gimp-context-push)
(gimp-context-set-antialias TRUE)
(gimp-context-set-feather FALSE)
(gimp-context-set-defaults)
(define (draw-vector beg-x beg-y direction)

View File

@ -36,7 +36,7 @@
)
(gimp-context-push)
(gimp-context-set-feather FALSE)
(gimp-context-set-defaults)
(gimp-image-undo-disable img)
(gimp-image-insert-layer img drawable 0 0)

View File

@ -116,6 +116,7 @@
)
(gimp-context-push)
(gimp-context-set-defaults)
; ensure that we don't shrink selection so much
; that we create an empty selection.

View File

@ -32,6 +32,7 @@
)
(gimp-context-push)
(gimp-context-set-defaults)
(gimp-image-undo-disable img)
(gimp-image-insert-layer img bg-layer 0 1)

View File

@ -49,6 +49,7 @@
)
(gimp-context-push)
(gimp-context-set-defaults)
(if (> rel-distance 24) (set! rel-distance 999999))
(if (= rel-distance rel-length) (set! rel-distance (+ rel-distance 0.01)))

View File

@ -45,6 +45,8 @@
(active-layer 0)
)
(gimp-context-push)
(gimp-context-set-defaults)
(gimp-image-undo-group-start image)
(gimp-layer-add-alpha drawable)
@ -111,6 +113,7 @@
(gimp-image-remove-channel image active-selection)
(gimp-image-undo-group-end image)
(gimp-displays-flush)
(gimp-context-pop)
)
)

View File

@ -114,8 +114,8 @@
)
(gimp-context-push)
(gimp-context-set-antialias FALSE)
(gimp-context-set-feather FALSE)
(gimp-image-undo-disable img)
; Create bumpmap layer

View File

@ -59,8 +59,7 @@
(pic-layer (car (gimp-image-get-active-drawable image))))
(gimp-context-push)
(gimp-context-set-antialias TRUE)
(gimp-context-set-feather FALSE)
(gimp-context-set-defaults)
(if (= work-on-copy TRUE)
(gimp-image-undo-disable image)

View File

@ -47,6 +47,7 @@
)
(gimp-context-push)
(gimp-context-set-defaults)
(gimp-image-undo-disable image)

View File

@ -38,6 +38,7 @@
)
(gimp-context-push)
(gimp-context-set-defaults)
(gimp-image-undo-disable image)

View File

@ -53,8 +53,7 @@
)
(gimp-context-push)
(gimp-context-set-antialias FALSE)
(gimp-context-set-feather FALSE)
(gimp-context-set-defaults)
;; select to the full bounds of the selection,
;; fills in irregular shapes or holes.

View File

@ -106,7 +106,7 @@
)
(gimp-context-push)
(gimp-context-set-feather FALSE)
(gimp-context-set-defaults)
(gimp-image-undo-disable img)
(gimp-image-resize img width height 0 0)

View File

@ -35,6 +35,7 @@
)
(gimp-context-push)
(gimp-context-set-defaults)
(gimp-image-undo-disable img)
(gimp-image-insert-layer img bg-layer 0 1)

View File

@ -72,6 +72,7 @@
)
(gimp-context-push)
(gimp-context-set-defaults)
(gimp-selection-none img)
(script-fu-util-image-resize-from-layer img logo-layer)

View File

@ -23,6 +23,7 @@
)
(gimp-context-push)
(gimp-context-set-defaults)
(script-fu-util-image-resize-from-layer img logo-layer)
(script-fu-util-image-add-layers img sparkle-layer shadow-layer bg-layer)

View File

@ -199,7 +199,7 @@
)
(gimp-context-push)
(gimp-context-set-antialias TRUE)
(gimp-context-set-defaults)
(gimp-image-undo-disable img)
(gimp-image-insert-layer img drawable 0 0)

View File

@ -55,6 +55,7 @@
)
(gimp-context-push)
(gimp-context-set-defaults)
(gimp-context-set-antialias antialias)
(gimp-image-undo-disable img)
(gimp-image-insert-layer img BG-layer 0 0)

View File

@ -37,7 +37,7 @@
)
(gimp-context-push)
(gimp-context-set-feather TRUE)
(gimp-context-set-defaults)
(script-fu-util-image-resize-from-layer img logo-layer)
(script-fu-util-image-add-layers img text-shadow-layer drop-shadow-layer blend-layer shadow-layer)

View File

@ -31,11 +31,12 @@
)
)
(gimp-context-push)
(gimp-context-set-feather FALSE)
(gimp-image-undo-group-start theImage)
(gimp-layer-resize theLayer (* 3 theWidth) (* 3 theHeight) 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)
@ -59,6 +60,7 @@
(gimp-layer-set-offsets theLayer 0 0)
(gimp-image-undo-group-end theImage)
(gimp-displays-flush)
(gimp-context-pop)
)
)

View File

@ -79,8 +79,7 @@
)
(gimp-context-push)
(gimp-context-set-antialias TRUE)
(gimp-context-set-feather FALSE)
(gimp-context-set-defaults)
; Create image

View File

@ -121,6 +121,7 @@
)
(gimp-context-push)
(gimp-context-set-defaults)
(gimp-image-undo-disable img)
(gimp-image-undo-disable tile)

View File

@ -51,6 +51,7 @@
)
(gimp-context-push)
(gimp-context-set-defaults)
(gimp-image-undo-group-start image)
(gimp-layer-add-alpha drawable)