It is currently Mon Oct 23, 2017 6:34 am


Latest GIMP Scripts & Plug-ins

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Layer Adjustments
PostPosted: Thu Jan 13, 2011 1:02 pm  (#1) 
Offline
GimpChat Member

Joined: May 16, 2010
Posts: 13982
Location: USA
So i found these cool scripts here
http://the-gimp.deviantart.com/art/Adju ... rs-1473128

But everytime i use any of them i get this same error "set! - unbound variable theLayer"

So i looked at the scripts and this is what one the "pattern adjustment script" - looks like

;
; pattern-fill-adjustment-layer
;
; Creates a pattern fill "adjustment layer".
;
; Alexander Melcher (a.melchers@planet.nl)
; At xMedia, The Netherlands

; 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.

; Define the function

(define (script-fu-pattern-fill-adjustment-layer inImage
                                            inLayer
                                            inPattern
                                            inReplaceLayer
   )

   ; Make sure to work on the layer, not the layer mask
   (if (= (car (gimp-drawable-is-layer-mask inLayer)) TRUE)
      (set! theLayer (car (gimp-image-get-active-layer inImage)))
      (set! theLayer inLayer)
   )

   ; Group undo information
   (gimp-undo-push-group-start inImage)

   ; Create the adjustment layer
   (set! adjustment (car (gimp-layer-new inImage
                    (car (gimp-image-width inImage))
                    (car (gimp-image-height inImage))
                    (car (gimp-drawable-type-with-alpha theLayer))
                    "Pattern Fill"
                    100 0)))
   (if (= inReplaceLayer TRUE)
      (begin
         (gimp-layer-set-linked adjustment
                  (car (gimp-layer-get-linked theLayer)))
         (gimp-layer-set-opacity adjustment
                  (car (gimp-layer-get-opacity theLayer)))
      )
      ()
   )

   ; Create the effect
   (set! currentSelection (car (gimp-selection-save inImage)))
   (gimp-image-remove-channel inImage currentSelection)
   (gimp-selection-all inImage)
   (gimp-edit-clear adjustment)
   (set! currentPattern (car (gimp-patterns-get-pattern)))
   (gimp-patterns-set-pattern inPattern)
   (gimp-bucket-fill adjustment 2 0 100 255 FALSE 0 0)
   (gimp-patterns-set-pattern currentPattern)
   (gimp-image-add-layer inImage adjustment -1)
   (if (= inReplaceLayer TRUE)
      (begin
         (gimp-image-remove-layer inImage theLayer)
         (if (= (car (gimp-drawable-is-layer-mask inLayer)) TRUE)
            (gimp-selection-load inLayer)
         (if (= (car (gimp-layer-mask theLayer)) -1)
            (gimp-selection-none inImage)
            (gimp-selection-load (car (gimp-layer-mask theLayer)))
         )
         )
      )
      (gimp-selection-load currentSelection)
   )

   ; Add a layer mask
   (if (= (car (gimp-selection-is-empty inImage)) FALSE)
      (begin
         (set! adjustmentMask (car (gimp-layer-create-mask adjustment 1)))
         (set! currentFgColor (car (gimp-palette-get-foreground)))
         (gimp-palette-set-foreground '(255 255 255))
         (gimp-bucket-fill adjustmentMask 0 0 100 255 FALSE 0 0)
         (gimp-palette-set-foreground currentFgColor)
      )
      (set! adjustmentMask (car (gimp-layer-create-mask adjustment 0)))
   )
   (gimp-image-add-layer-mask inImage adjustment adjustmentMask)

   (if (= inReplaceLayer TRUE)
      (gimp-selection-load currentSelection)
      ()
   )

   ; Group undo information
   (gimp-undo-push-group-end inImage)

   ; Force update
   (gimp-displays-flush)

   ; Return
   (list 1)
)

; Register script-fu-pattern-fill-adjustment-layer

(script-fu-register
    "script-fu-pattern-fill-adjustment-layer"
    "<Image>/Adjustment Layers/Pattern Fill"
    "Creates a pattern fill \"adjustment layer\"."
    "Alexander Melchers"
    "2002, Alexander Melchers, xMedia"
    "7th November 2002"
    "RGB* GRAY*"
    SF-IMAGE      "The Image"             0
    SF-DRAWABLE   "The Layer"             0
    SF-PATTERN    "Pattern"               "Pine?"
    SF-TOGGLE     "Replace Layer"         FALSE
)


All of the scripts give the same error so i imagine it to be a fix that can be applied globally for all of them?

So i was hoping one of you awesome script writers could tell me how to fix them so they work?
I think they would be an awesome addition to Gimp.

Thanks


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Layer Adjustments
PostPosted: Thu Jan 13, 2011 1:11 pm  (#2) 
Offline
Global Moderator
User avatar

Joined: May 22, 2008
Posts: 6951
Location: Somewhere in GIMP
I see others are having the same error message.

_________________
Image
World War IV will be fought with sticks and stones. - Albert Einstein


Top
 Post subject: Re: Layer Adjustments
PostPosted: Thu Jan 13, 2011 1:32 pm  (#3) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5872
are you sure is worth ?
There are several updated "Layer Effect" or "layer adjustment" scripts in the registry, that is 8 years old and apparently doesn't do anything that the others can't do.

(at least judging from the description on the page )

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Post subject: Re: Layer Adjustments
PostPosted: Thu Jan 13, 2011 2:05 pm  (#4) 
Offline
GimpChat Member

Joined: May 16, 2010
Posts: 13982
Location: USA
@ PC - seems like these work like a mask though.

@ O Yup, it's almost like something in the scripts are not quite right, but i ran one through the script-fu console and got no errors.
I thought maybe there is something that you have to do before you can run the script.
I tried a few things like
making a selection - didn't work
selecting a layer - didn't work
creating a layer mask - didn't work
selecting the mask in the layer - didn't work either

So i don't know what's up with them.


Top
 Post subject: Re: Layer Adjustments
PostPosted: Fri Jan 14, 2011 1:03 pm  (#5) 
Offline
Script Coder
User avatar

Joined: Jul 14, 2010
Posts: 691
PhotoComix wrote:
are you sure is worth ?
There are several updated "Layer Effect" or "layer adjustment" scripts in the registry, that is 8 years old and apparently doesn't do anything that the others can't do.

(at least judging from the description on the page )


Yes- This is the one I use: http://registry.gimp.org/node/186

-Rob A>

_________________
Image
Fantasy Cartography and Mapping by RobA


Top
 Post subject: Re: Layer Adjustments
PostPosted: Fri Jan 14, 2011 2:06 pm  (#6) 
Offline
GimpChat Member

Joined: May 16, 2010
Posts: 13982
Location: USA
These are a little different though it seems they include
brightness
dodge and burn
lightness

I use layerfx also (python version), but these seem different.
They do not seem to have a lot of control though.Ill throw them in the not-use pile for now. =)

thanks folks.


Top
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Can all adjustments made to one image be batch applied to others?

5

No new posts filling value gaps created by levels adjustments

12

No new posts Attachment(s) ML Bevel Reflect Plug-in V2.0 With Depth Adjustments

85

No new posts Batch script: add a predefined image layer, set layer mode, export.

7

No new posts All Layer Boundaries to cropped layer HEIGHT request

5



* Login  



Powered by phpBB3 © phpBB Group