It is currently Fri Apr 26, 2024 12:37 am


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
User avatar

Joined: May 16, 2010
Posts: 14709
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

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


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
Retired Staff
User avatar

Joined: May 22, 2008
Posts: 6947
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: 5870
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
User avatar

Joined: May 16, 2010
Posts: 14709
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.

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


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: 697
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
User avatar

Joined: May 16, 2010
Posts: 14709
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.

_________________
Image
Edmund Burke nailed it when he said, "The only thing necessary for the triumph of evil is for good men to do nothing."


Top
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Adding a image as a layer, moving layer, and then flattening

2

No new posts Shortcuts to 2.10 documentation re: Layer & Layer-group modes

0

No new posts How do I script a new white layer to the bottom of the layer stack

7

No new posts Add layer mask hides the entire layer

3

No new posts Attachment(s) how to get layer offsets from the main layer?

3



* Login  



Powered by phpBB3 © phpBB Group