Switch to full style
Post all Gimp scripts and script writing questions here
Post a reply

Re: Multiple Layer Actions Script Rel2 [bugfix and more actions]

Sat Jan 04, 2014 11:10 pm

Thank you GinoD writing scripts for layers within groups has definitely been a challenge but with everything, there are no problems but solutions waiting to be created

The problem that 'gimp-image-get-layers' returns any pseudo group layers [which cannot be altered]has been overcome by adding this procedure many thanks to Saulgoode who worked patiently with me on this

Code:
(define (get-all-real-layers image)
    (define (get-children group)
      (let loop ((children (vector->list (cadr (gimp-item-get-children group))))
                 (sub-layers '()) )
        (if (null? children)
          (reverse sub-layers)
          (loop (cdr children)
                (if (zero? (car (gimp-item-is-group (car children))))
                  (cons (car children) sub-layers)
                  (append sub-layers (get-children (car children))) )))))
    (let loop ((top-layers (vector->list (cadr (gimp-image-get-layers image))))
               (all-layers '()) )
      (if (null? top-layers)
        all-layers
        (loop (cdr top-layers)
              (if (zero? (car (gimp-item-is-group (car top-layers))))
                (append all-layers (list (car top-layers)))
                (append all-layers (get-children (car top-layers)))) ))))

This was called by
Code:
   ((= listType 0) ;All Layers
   (set! layerList (get-all-real-layers image))

Re: Multiple Layer Actions Script Rel3 [Allowed for layer groups]

Sun Jan 05, 2014 12:28 am

Rel3 with layer group functionality has just been posted (see initial post)

Re: Multiple Layer Actions Script Rel3 [Allowed for layer groups]

Sun Jan 05, 2014 2:09 am

Nice progress on this script, Graechan. All layers to Image size is very handy. :bigthup

Re: Multiple Layer Actions Script Rel3 [Allowed for layer groups]

Sun Jan 05, 2014 2:31 am

I downloaded the update, but I don't see the layer group function.

Re: Multiple Layer Actions Script Rel3 [Allowed for layer groups]

Sun Jan 05, 2014 2:33 am

GnuTux a lot of added actions will follow when I finish my adaptations for layer groups I was keen to get the 'All layers to image size'
action in there as well, as it's one I will find useful to

Re: Multiple Layer Actions Script

Sun Jan 05, 2014 1:45 pm

ofnuts wrote:
Wallace wrote:Is there something that would clear a selection on all layers. If not maybe this could be added.


See clear-layers here : https://sourceforge.net/projects/gimp-t ... s/scripts/ :)

This said there is a limit to this kind of script... either you can only have function without parameters, or you end up redoing parameter entry dialogs for every tool you use. Or you have some clever code that can read the PDB, discovers the parameters and generates a dialog on the fly...


You make a good point Ofnuts and thanks for the script link. ;)

I do have another suggestion for the "Multiple Layer Actions Script", and that would be "Desaturate" all layers/visible layers.

Re: Multiple Layer Actions Script Rel3 [Allowed for layer groups]

Sun Jan 05, 2014 5:45 pm

Mackenzieh the script now works within layer groups, it's not a option, previous releases of the script would fail if a layer group existed whereas this release won't due to the fact that 'gimp-image-get-layers' will return the ID of the 'layer group'
(which is a pseudo layer that cannot have its pixels altered).
In Rel3 I've used the call 'get-all-real-layers' that returns the children of the layer group instead
These are the layers associated with the 'layer group' and can have their pixels altered

Re: Multiple Layer Actions Script Rel3 [Allowed for layer groups]

Sun Jan 05, 2014 5:52 pm

Is Rel3 just a bug fix of Release 1 Graechan?
Because I'm not seeing any added operations.

Re: Multiple Layer Actions Script Rel3 [Allowed for layer groups]

Sun Jan 05, 2014 6:01 pm

K1TesseraEna wrote:Is Rel3 just a bug fix of Release 1 Graechan?
Because I'm not seeing any added operations.


That is also my question as well because, I too am not seeing any added operations.

Re: Multiple Layer Actions Script Rel3 [Allowed for layer groups]

Sun Jan 05, 2014 6:09 pm

K1TesseraEna Rel3 is a bugfix of Rel2 not Rel1 now I can add additional Actions without the script failing due to the reasons given above to Mackenzieh
Ditto to Mackenzieh please be patient as I needed to get the scripts framework correct

Re: Multiple Layer Actions Script Rel3 [Allowed for layer groups]

Sun Jan 05, 2014 6:29 pm

If you run the filter on any group it works. That is the fix folks. :)
Works well Graechan. I can't wait to see more added functions.

Re: Multiple Layer Actions Script Rel3 [Allowed for layer groups]

Sun Jan 05, 2014 6:42 pm

Rod wrote:If you run the filter on any group it works. That is the fix folks. :)
Works well Graechan. I can't wait to see more added functions.



Oh, okay. Thanks Rod for explaining it. :)

Re: Multiple Layer Actions Script Rel3 [Allowed for layer groups]

Mon Jan 06, 2014 2:01 am

new Action list coming tomorrow in Rel4
"Set Invisible"
"Set Visible"
"Invert"
"Clear Selection"
"Layer to Image Size"
"Semi-Flatten"
"Flatten"
"Add Alpha"
"Remove Layer From Image"

Re: Multiple Layer Actions Script Rel3 [Allowed for layer groups]

Mon Jan 06, 2014 10:01 pm

Graechan can you add export to any file format supported by GIMP?
Something like the export_layers script?
http://registry.gimp.org/node/28268
SVG, PATTERNS,GIH,GBR,JPG,PNG ect..ect

Re: Multiple Layer Actions Script Rel3 [Allowed for layer groups]

Mon Jan 06, 2014 11:05 pm

Rod wrote:Graechan can you add export to any file format supported by GIMP?
Something like the export_layers script?
http://registry.gimp.org/node/28268
SVG, PATTERNS,GIH,GBR,JPG,PNG ect..ect



This is a good idea Rod, except for svg export.
Paths in gimp are not associated with any layer(s) in particular,
that would definitely require the script name/description change.

I like the idea as a concept for a separate script, though,
merge linked, diverge, export linked paths. etc. as svg(s)

Re: Multiple Layer Actions Script Rel3 [Allowed for layer groups]

Tue Jan 07, 2014 3:06 am

I was sorting and updating my collection of script and i found a few that may integrate well

Something i often want do to layers is make all seamless, Gimp built in "make seamless " filter is not too good, to use a euphemism, my favorite is RobA " RR make seamless " http://gimpscripts.com/2013/08/rr-make-seamless/ that has a little flaw, can't be repeated.
appear in "repeat last filter" but greyed out.

would be nice have for all layers

Also to complete there is "Tileable Filters" also from RobA that contains

This script creates the following new menu entries (modeled after the Tileable Blur provided in Gimp already):

Filters >Distorts >Tileable Emboss
Filters >Blur >Tileable Motion Blur
Filters >Distorts >Tileable Wind
Filters >Light and Shadow >Tileable Sparkle
Filters >Noise >Tileable Slur
Filters >Noise >Tileable Spread
Filters >Artistic >Tileable Cubism
Filters >Artistic >Tileable Oilify
Filters >Artistic >Tileable Photocopy
Filters >Artistic >Tileable Softglow


REALLY TOO MUCH menu entries to my taste, yet this battery of seamless filters is very useful, it would be nice have them more grouped and adapted to run on all layers

Then i stumble on Esamulko page , https://sites.google.com/site/elsamuko/gimp he has some excellent filters in his arsenal,
my favorite ,to be applied to all layer are for very different reasons and in random order

Escape lines https://sites.google.com/site/elsamuko/gimp/escape-line
SPROCKET HOLES !! :yes the best sprocket holes i found https://sites.google.com/site/elsamuko/gimp/sprocket
and for special effect :
the National Geographic style https://sites.google.com/site/elsamuko/gimp/ng
And a cupe version of "300 movie" style https://sites.google.com/site/elsamuko/gimp/300

many also include a batch version (not sure if may help )
and there are much more there , as the 2 for sharpening without halo https://sites.google.com/site/elsamuko/ ... on-sharpen https://sites.google.com/site/elsamuko/gimp/eaw-sharpen ,
a good emulation of old" Photocrom" lithographies https://sites.google.com/site/elsamuko/gimp/photochrom
and vintage https://sites.google.com/site/elsamuko/gimp/vintage and much more
https://sites.google.com/site/elsamuko/gimp/lomo
But i can' propose everything...well there is also a very nice lomo script https://sites.google.com/site/elsamuko/gimp/lomo
BUT would complicate installations because to work require Esamulko Curve presets ( scroll down ! https://sites.google.com/site/elsamuko/gimp/lomo) installed, ...are cool presets i suggest to install them anyway, but i fear that have to install additional folders may confuse or discourage


Well a lot but i am not suggesting to include everything
i think the Sprocket Hole , Escapes lines and National Geographic Style may be of large interest

That and RobA battery of make seamless and tileable filters




,

Re: Multiple Layer Actions Script

Tue Jan 07, 2014 4:28 am

I wrote (it did not, of course, support layer groups). I also recall making a later version that copied the active layer's blend mode or opacity to the target layers, but I can't locate the code for that.


Saulgood ,i am not sure if is the same you can't locate but i have a copy of 1 of your script that , yes, add the merging mode used to the new layer name

To be exact is a modified version of "new layer from visible"
the most relevant difference with "new layer from visible" is that the focus is not shifted on the new layer , but the active layer remain the same after running the script
And the second is that the name of new layer embeds the layermode used

With this difference become a fantastic tool to experiment and confront face to face result of different layer mode:
you may find 1 good combination of mode and transparency, run the script to save it (as new layer) , try another, save and so on

Normally focus shift, so you should reactivate the right layer, and even worse is hard kept trace of the various combination

I love that script , it saved me a lot of times , if you couldn't find i may search on my HD, just let me know

Re: Multiple Layer Actions Script Rel3 [Allowed for layer groups]

Tue Jan 07, 2014 5:15 pm

Photocomics, I appreciate the offer, but I already have your script. The one to which I previously alluded was from a time before I started maintaining my scripts using Fossil, and I don't think I ever shared it publicly.

Re: Multiple Layer Actions Script Rel3 [Allowed for layer groups]

Tue Jan 07, 2014 6:06 pm

Hello Saulgoode.
I have a question:
Is it possible - for all layers (in order):
Alpha to selection -> Selection to path.
It refers to the rapid conversion of ttf font files to svg.
(http://gimpchat.com/viewtopic.php?f=12&t=3002&start=10%20#%20p123355)

Re: Multiple Layer Actions Script Rel3 [Allowed for layer groups]

Tue Jan 07, 2014 6:43 pm

MareroQ wrote:Hello Saulgoode.
I have a question:
Is it possible - for all layers (in order):
Alpha to selection -> Selection to path.
It refers to the rapid conversion of ttf font files to svg.

Yes, it is possible (nearly trivial), however, if the original layer is a text layer than it would be better to create the path using 'gimp-vectors-new-from-text-layer'. This will avoid degradation of the font owing to the rendering of the font followed by conversion to a selection followed by conversion to a path.
Post a reply