Re: [Gimp-user] Script-fu plugin
Thank you so much Saul, that works great!!! Date: Wed, 15 Oct 2008 18:15:05 -0400 From: [EMAIL PROTECTED] To: Gimp-user@lists.XCF.Berkeley.EDU Subject: [Gimp-user] Script-fu plugin Quoting Adonj Adonj [EMAIL PROTECTED]: I updated my Gimp program from version 2.4.7 to 2.6.0-i686. The Script-fu plugin copyToAllLayers.scm gave an error, and a Gimp Message: Plug-In 'Copy mask' left image undo in inconsistent state, closing open undogroups. I wondered if you have a correction for the code.Very much appreciated. Sorry for the delay, my Internet has been broken since Saturday. I have updated the script for GIMP 2.6: http://flashingtwelve.brickfilms.com/GIMP/Scripts/copy-masks-26.scm ___ Gimp-user mailing list Gimp-user@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user _ ___ Gimp-user mailing list Gimp-user@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
[Gimp-user] Script-fu plugin
Quoting Adonj Adonj [EMAIL PROTECTED]: I updated my Gimp program from version 2.4.7 to 2.6.0-i686. The Script-fu plugin copyToAllLayers.scm gave an error, and a Gimp Message: Plug-In 'Copy mask' left image undo in inconsistent state, closing open undogroups. I wondered if you have a correction for the code.Very much appreciated. Sorry for the delay, my Internet has been broken since Saturday. I have updated the script for GIMP 2.6: http://flashingtwelve.brickfilms.com/GIMP/Scripts/copy-masks-26.scm ___ Gimp-user mailing list Gimp-user@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
[Gimp-user] Script-fu plugin
I updated my Gimp program from version 2.4.7 to 2.6.0-i686. The Script-fu plugin copyToAllLayers.scm gave an error, and a Gimp Message: Plug-In 'Copy mask' left image undo in inconsistent state, closing open undogroups. I wondered if you have a correction for the code.Very much appreciated. Quoting Adonj Adonj : I wondered if you knew of a script that would also APPLY the copied layers as you mention. Edit the script to add the following code: (set! layers (visible-layers image))(while (pair? layers)(gimp-layer-remove-mask (car layers) MASK-APPLY)(set! layers (cdr layers))) Just before the line: (gimp-image-remove-layer image source-layer) _ ___ Gimp-user mailing list Gimp-user@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
Re: [Gimp-user] script-fu plugin
Hi, I checked your script a little. I have to admit, that I don't know scheme very much, because I don't like LISP very much (Lots of Irritating Superfluous Parentheses). I rather work with perl-gimp. But there is an error in your script. Scheme has a built-in function cons. Cons needs two arguments. There is only given one: (if (= tmp TRUE) (set! viewable (append viewable (cons (aref all-layers (- i 1)) To make it clearer: The one argument is: aref all-layers (- i 1) I don't know which argument to give as second. It would take me a while to figure it out. One other thing is disturbing: In the register-function isn't given if it is a stand allone script or if it should work on an image. I assumed it should work on an image. To test your script I set: Image/Script-Fu/_Copy mask . May be in special cases, the function aref provides twp arguments for cons, for example if you have sufficient layers and layer masks, but in others it doesn*t. Anyhow the error isn't caught. I am working with LINUX, so you see that the error is OS-Independent. Greetings Bernd [EMAIL PROTECTED] schrieb: Send Gimp-user mailing list submissions to gimp-user@lists.XCF.Berkeley.EDU To subscribe or unsubscribe via the World Wide Web, visit https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user or, via email, send a message with subject or body 'help' to [EMAIL PROTECTED] You can reach the person managing the list at [EMAIL PROTECTED] When replying, please edit your Subject line so it is more specific than Re: Contents of Gimp-user digest... Today's Topics: 1. script-fu plugin (Adonj Adonj) 2. Re: script-fu plugin (peter kostov) 3. Re: Best way to semi-flatten a transparent gif against a background image (Justyn Butler) 4. Script-fu (Adonj Adonj) 5. Re: Best way to semi-flatten a transparent gif against a background image (David Gowers) 6. Re: script-fu plugin ([EMAIL PROTECTED]) 7. Re: Gimp-user Digest, Vol 72, Issue 22 (Mike W) -- Message: 1 Date: Sun, 28 Sep 2008 00:03:52 -0400 From: Adonj Adonj [EMAIL PROTECTED] Subject: [Gimp-user] script-fu plugin To: gimp-user@lists.XCF.Berkeley.EDU gimp-user@lists.xcf.berkeley.edu Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=iso-8859-1 I'm using gimp2.4.7 in windows XP. I copied a script-fu plugin I found to my C:\Program Files\GIMP-2.0\lib\gimp\2.0\plug-ins, which should copy a layer mask to multiple layers or apply a layer mask to multiple layers. I get an error each time I make an attempt to use it, which states: Error: cons: needs 2 argument(s) I'm not familiar with the script. Could there be a simple solution to that? Here is the script: ; 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 (script-fu-copy-mask-to-layers image drawable) (define (visible-layers img) (let* ( (all-layers (gimp-image-get-layers img)) (i (car all-layers)) (viewable ()) (tmp FALSE)) (set! all-layers (cadr all-layers)) (while ( i 0) (set! tmp (car (gimp-drawable-get-visible (aref all-layers (- i 1) (if (= tmp TRUE) (set! viewable (append viewable (cons (aref all-layers (- i 1)) (set! i (- i 1))) viewable)) (let* ( (active-layer (car (gimp-image-get-active-layer image))) (source-layer) (source-mask) (layers) (mask)) (set! layers (visible-layers image)) (gimp-image-undo-group-start image) (set! source-layer (car (gimp-layer-new-from-drawable active-layer image))) (gimp-image-add-layer image source-layer -1) (set! source-mask (car (gimp-layer-get-mask source-layer))) (if (= source-mask -1) (begin (set! source-mask (car (gimp-layer-create-mask source-layer ADD-COPY-MASK))) (gimp-layer-add-mask source-layer source-mask))) (while (car layers) (if (= (car (gimp-layer-get-mask (car layers))) -1) (if (= (car (gimp-drawable-has-alpha (car layers))) 1) (set! mask (car (gimp-layer-add-mask (car layers) source-mask) (set! layers (cdr layers))) (gimp-image-remove-layer image source-layer) (gimp-image-undo-group-end image) (gimp-displays-flush))) (script-fu-register script-fu-copy-mask-to-layers /Script-Fu/_Copy mask Copy the mask from the current layer to all visible layers Saul
Re: [Gimp-user] script-fu plugin
Adonj Adonj wrote: I'm using gimp2.4.7 in windows XP. I copied a script-fu plugin I found to my C:\Program Files\GIMP-2.0\lib\gimp\2.0\plug-ins, which should copy a layer mask to multiple layers or apply a layer mask to multiple layers. I get an error each time I make an attempt to use it, which states: Error: cons: needs 2 argument(s) I'm not familiar with the script. Could there be a simple solution to that? Here is the script: ; 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 (script-fu-copy-mask-to-layers image drawable) (define (visible-layers img) (let* ( (all-layers (gimp-image-get-layers img)) (i (car all-layers)) (viewable ()) (tmp FALSE)) (set! all-layers (cadr all-layers)) (while ( i 0) (set! tmp (car (gimp-drawable-get-visible (aref all-layers (- i 1) (if (= tmp TRUE) (set! viewable (append viewable (cons (aref all-layers (- i 1)) (set! i (- i 1))) viewable)) (let* ( (active-layer (car (gimp-image-get-active-layer image))) (source-layer) (source-mask) (layers) (mask)) (set! layers (visible-layers image)) (gimp-image-undo-group-start image) (set! source-layer (car (gimp-layer-new-from-drawable active-layer image))) (gimp-image-add-layer image source-layer -1) (set! source-mask (car (gimp-layer-get-mask source-layer))) (if (= source-mask -1) (begin (set! source-mask (car (gimp-layer-create-mask source-layer ADD-COPY-MASK))) (gimp-layer-add-mask source-layer source-mask))) (while (car layers) (if (= (car (gimp-layer-get-mask (car layers))) -1) (if (= (car (gimp-drawable-has-alpha (car layers))) 1) (set! mask (car (gimp-layer-add-mask (car layers) source-mask) (set! layers (cdr layers))) (gimp-image-remove-layer image source-layer) (gimp-image-undo-group-end image) (gimp-displays-flush))) (script-fu-register script-fu-copy-mask-to-layers /Script-Fu/_Copy mask Copy the mask from the current layer to all visible layers Saul Goode Saul Goode 6/14/2006 SF-IMAGEImage0 SF-DRAWABLE Drawable 0 ) Isn'tthat a script rather a plug-in? If so it should reside in the scripts folder... But this is gust a guess. I am not familiar with script-fu eithe :( Peter _ ___ Gimp-user mailing list Gimp-user@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user -- http://receptibg.com - рецепти, готварство и хранене, менюта, статии, идеи и полезни съвети --- Boryana Peter Kostovi, web design webdevelopment home site: http://bgwebdeveloper.com ___ Gimp-user mailing list Gimp-user@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
Re: [Gimp-user] script-fu plugin
Quoting Adonj Adonj [EMAIL PROTECTED]: I'm using gimp2.4.7 in windows XP. I copied a script-fu plugin I found to my C:\Program Files\GIMP-2.0\lib\gimp\2.0\plug-ins, which should copy a layer mask to multiple layers or apply a layer mask to multiple layers. I get an error each time I make an attempt to use it, which states: Error: cons: needs 2 argument(s) I'm not familiar with the script. Could there be a simple solution to that? I have updated the script, which can be fetched from http://flashingtwelve.brickfilms.com/GIMP/Scripts/copy-mask.scm ___ Gimp-user mailing list Gimp-user@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
[Gimp-user] Script-fu plugin
Thank you Saul, that worked perfectly! With regards to your message at: http://72.14.205.104/search?q=cache:7GovFRKtKToJ:lists.xcf.berkeley.edu/lists/gimp-user/2007-January/009388.html+plugin+to+copy+mask+to+all+layers+then+applyhl=enct=clnkcd=2gl=ca You say: You can achieve the same result using layer masks. Unfortunately, there is not a simple built-in way of copying a layer mask to multiple layers or of applying a layer mask to multiple layers. There is a script-fu plugin that will do that. I don't know where I got it. It doesn't seem to be in the Gimp's plugin repository. So here it is:. I wondered if you knew of a script that would also APPLY the copied layers as you mention. Thanks, Adonj _ ___ Gimp-user mailing list Gimp-user@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
Re: [Gimp-user] Script-fu plugin
Quoting Adonj Adonj [EMAIL PROTECTED]: I wondered if you knew of a script that would also APPLY the copied layers as you mention. Edit the script to add the following code: (set! layers (visible-layers image)) (while (pair? layers) (gimp-layer-remove-mask (car layers) MASK-APPLY) (set! layers (cdr layers))) Just before the line: (gimp-image-remove-layer image source-layer) ___ Gimp-user mailing list Gimp-user@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
[Gimp-user] Script-fu plugin
That was terrific, Saul, thanks a lot! Adonj _ ___ Gimp-user mailing list Gimp-user@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
[Gimp-user] script-fu plugin
I'm using gimp2.4.7 in windows XP. I copied a script-fu plugin I found to my C:\Program Files\GIMP-2.0\lib\gimp\2.0\plug-ins, which should copy a layer mask to multiple layers or apply a layer mask to multiple layers. I get an error each time I make an attempt to use it, which states: Error: cons: needs 2 argument(s) I'm not familiar with the script. Could there be a simple solution to that? Here is the script: ; 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 (script-fu-copy-mask-to-layers image drawable) (define (visible-layers img) (let* ( (all-layers (gimp-image-get-layers img)) (i (car all-layers)) (viewable ()) (tmp FALSE)) (set! all-layers (cadr all-layers)) (while ( i 0) (set! tmp (car (gimp-drawable-get-visible (aref all-layers (- i 1) (if (= tmp TRUE) (set! viewable (append viewable (cons (aref all-layers (- i 1)) (set! i (- i 1))) viewable)) (let* ( (active-layer (car (gimp-image-get-active-layer image))) (source-layer) (source-mask) (layers) (mask)) (set! layers (visible-layers image)) (gimp-image-undo-group-start image) (set! source-layer (car (gimp-layer-new-from-drawable active-layer image))) (gimp-image-add-layer image source-layer -1) (set! source-mask (car (gimp-layer-get-mask source-layer))) (if (= source-mask -1) (begin (set! source-mask (car (gimp-layer-create-mask source-layer ADD-COPY-MASK))) (gimp-layer-add-mask source-layer source-mask))) (while (car layers) (if (= (car (gimp-layer-get-mask (car layers))) -1) (if (= (car (gimp-drawable-has-alpha (car layers))) 1) (set! mask (car (gimp-layer-add-mask (car layers) source-mask) (set! layers (cdr layers))) (gimp-image-remove-layer image source-layer) (gimp-image-undo-group-end image) (gimp-displays-flush))) (script-fu-register script-fu-copy-mask-to-layers /Script-Fu/_Copy mask Copy the mask from the current layer to all visible layers Saul Goode Saul Goode 6/14/2006 SF-IMAGEImage0 SF-DRAWABLE Drawable 0 ) _ ___ Gimp-user mailing list Gimp-user@lists.XCF.Berkeley.EDU https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user