It is currently Fri Apr 19, 2024 7:38 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 25 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Run Code on Visible Layers Script for GIMP
PostPosted: Thu Oct 19, 2017 3:12 pm  (#1) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
A simple script that Wallace or others might be interested in.
For those times when you wish you could run a filter/script/plug-in on all visible layers without having to dive too much into code.
You'll still need to know a little (very little) about coding.
After you run a successful line of code maybe people can start sharing your one-liners that execute whatever plug-in/script/filter that they use instead of having to share a whole different script.

Here's an example one-liner. Feel free to share more.
pdb.script_fu_drop_shadow(image,layer,4,4,15,(0,0,0),60,False)
The above line when pasted in to use with script will drop shadow on the visible layers.

more details and instructions here -->Run Code on Visible Layers Script for GIMP

_________________
TinT


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: Run Code on Visible Layers Script for GIMP
PostPosted: Fri Oct 20, 2017 1:55 am  (#2) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2241
Location: Poland
I was interested in a similar solution to RWL Actions (http://gimpchat.com/viewtopic.php?f=9&t=11963#p161758) - unfortunately I did not know a few things:
- how to enable the code in the plugin window (and your code works);
- how to deal with a group of layers.
I believe that there will be something more universal than proposed by Graechan (Multiple Layer Actions Script - http://gimpchat.com/viewtopic.php?f=9&t=9446&hilit=Multiple+Layer+Actions#p122845) or me
A very developmental topic - for a good encoder (and I think about You)
I hope there will be many more versions.

_________________
Image

Slava
Ukraini!


Top
 Post subject: Re: Run Code on Visible Layers Script for GIMP
PostPosted: Fri Oct 20, 2017 2:22 am  (#3) 
Offline
Administrator
User avatar

Joined: Aug 10, 2012
Posts: 13008
Location: Native to NYC living in Arizona, Gimp 2.8 & 2.10, Win 11 PC.
I like this idea a lot.
Also,
if it could be something along the lines of;
"Just copy and past this here,
or that there"
.
Would make it something,
that someone without any coding experience could use.

This is only a thought,
I'm not sure if this could ever work like this.

As it stands...
someone (i.e. trandoductin),
creates a script.
We copy and past them into a scripts/plugin's folder.
Once this is done,
we're off to the races with a new script.
No need for knowing how to code whatsoever.

_________________
Image
"A wise man learns more from a foolish question than a fool can learn from a wise answer"
Image


Top
 Post subject: Re: Run Code on Visible Layers Script for GIMP
PostPosted: Fri Oct 20, 2017 6:29 am  (#4) 
Offline
GimpChat Member
User avatar

Joined: May 16, 2010
Posts: 14709
Location: USA
Don't know if this will be useful to those who do not understand the procedure data browser.

_________________
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: Run Code on Visible Layers Script for GIMP
PostPosted: Fri Oct 20, 2017 6:58 am  (#5) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4736
Rod wrote:
Don't know if this will be useful to those who do not understand the procedure data browser.


My sentiment too. The difficulty of programming isn't the programming language or even programming. It is the ability to figure out errors and fix them. And this script is making that even harder since in case of typos users just see a "plugin crashed" message. At least In the Python console they would see a slightly more meaningful explanation, and even a pointer to the problem character.

But well, Tin has always been on a quest to provide Gimp programming to non-programmers(*) :)

(*) who here aren't professional IT people but just the people with the adequate mindset

_________________
Image


Top
 Post subject: Re: Run Code on Visible Layers Script for GIMP
PostPosted: Fri Oct 20, 2017 9:37 am  (#6) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
Rod wrote:
Don't know if this will be useful to those who do not understand the procedure data browser.

True.
But those who do understand procedure browser can easily whip up a one-liner for those who don't.
I hope people can share their one-liners.

_________________
TinT


Top
 Post subject: Re: Run Code on Visible Layers Script for GIMP
PostPosted: Fri Oct 20, 2017 9:42 am  (#7) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
Wallace wrote:
I like this idea a lot.
Also,
if it could be something along the lines of;
"Just copy and past this here,
or that there"
.
Would make it something,
that someone without any coding experience could use.

This is only a thought,
I'm not sure if this could ever work like this.

As it stands...
someone (i.e. trandoductin),
creates a script.
We copy and past them into a scripts/plugin's folder.
Once this is done,
we're off to the races with a new script.
No need for knowing how to code whatsoever.

That's exactly what I was thinking.... those who do know can provide the one-liners to those who don't know to just simply paste and run.

_________________
TinT


Top
 Post subject: Re: Run Code on Visible Layers Script for GIMP
PostPosted: Fri Oct 20, 2017 9:58 am  (#8) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
For those who are keen and willing to learn just a little to come up with one-liners themselves, they can view this simple instructions to come up with other one-liners for others to use.
:hehe

_________________
TinT


Top
 Post subject: Re: Run Code on Visible Layers Script for GIMP
PostPosted: Fri Oct 20, 2017 11:05 am  (#9) 
Offline
GimpChat Member
User avatar

Joined: Jan 06, 2017
Posts: 204
I haven't tried this yet*, being a non-programmer it's a bit daunting.. but the instructions seem fairly straightforward. I'm trying to do a "Heal selection" on about 6 layers, just a small selection that needed a bit of filling-out..


*OK I did it after about 9 attempts! ..First problem was I saw in the Procedure browser something about INTERACTIVE and NON-INTERACTIVE, so I put a '1' in the brackets to start things off.. didn't work, tried a '0' still no-go), after realising I should just ignore that part I tried to make my code readable, I put - "'pdb.python_fu_heal_selection(image,layer,40,Sides,Random)'" - I also tried using quotation marks around 'Sides' and 'Random', then it dawned on me I needed an integer in both cases so I finally got it to work with the following code: pdb.python_fu_heal_selection(image,layer,40,2,1)

Took me nearly as long to work it out as it did for me to type this out. :) So there's hope yet!! Thanks for the script Tin - I shall enjoy trying stuff out with it I'm sure :D


Last edited by Zero01 on Fri Oct 20, 2017 11:14 am, edited 1 time in total.

Top
 Post subject: Re: Run Code on Visible Layers Script for GIMP
PostPosted: Fri Oct 20, 2017 11:08 am  (#10) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
right on Zero01

Your response details struggles that you overcame. I thought it's worth it to add a link to from 1st post of script download thread so others can read and learn from your experience.

_________________
TinT


Top
 Post subject: Re: Run Code on Visible Layers Script for GIMP
PostPosted: Fri Oct 20, 2017 4:10 pm  (#11) 
Offline
GimpChat Member
User avatar

Joined: Jan 06, 2017
Posts: 204
Wow, fame at last eh? I'll just say to anyone attempting to use this script, it may seem daunting but it's actually (fairly) staightforward. :)


Top
 Post subject: Re: Run Code on Visible Layers Script for GIMP
PostPosted: Fri Oct 20, 2017 5:25 pm  (#12) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2241
Location: Poland
Good solutions should be shown - only for those who are interested.
In This console does not need to be changed
Thay đổi các hyphen (-) trong tên hàm cho underscores (_).

http://www.arakne.es/en/dessign/gimp-python-script-console2-updated-new-button-for-save-only-source-code/#Descarga/Download

_________________
Image

Slava
Ukraini!


Top
 Post subject: Re: Run Code on Visible Layers Script for GIMP
PostPosted: Fri Oct 20, 2017 5:55 pm  (#13) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
MareroQ,
That extended console is cool.
Thanks for sharing.

_________________
TinT


Top
 Post subject: Re: Run Code on Visible Layers Script for GIMP
PostPosted: Fri Oct 20, 2017 6:43 pm  (#14) 
Offline
GimpChat Member
User avatar

Joined: Apr 15, 2017
Posts: 1825
I'm no stranger to scripting/commands. Been using Avisynth and FFmpeg for years. But please explain the benefit of using this plugin versus Ctrl+F on all layers you desire?


Top
 Post subject: Re: Run Code on Visible Layers Script for GIMP
PostPosted: Fri Oct 20, 2017 7:24 pm  (#15) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
I had Wallace's creation of fonts when I did this.
Of course, there's no real benefit if you're willing to Ctrl+F on all the layers.
I think when Wallace creates a font he has at least 36 characters so clicking on 36 layers and Ctrl+F on all of them seem overly repetitive.

_________________
TinT


Top
 Post subject: Re: Run Code on Visible Layers Script for GIMP
PostPosted: Sat Oct 21, 2017 3:45 am  (#16) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4736
trandoductin wrote:
I had Wallace's creation of fonts when I did this.
Of course, there's no real benefit if you're willing to Ctrl+F on all the layers.
I think when Wallace creates a font he has at least 36 characters so clicking on 36 layers and Ctrl+F on all of them seem overly repetitive.


For that problem it could be better to make a grid of characters in one single layer, and then export it using a a script that cuts the tiles.

_________________
Image


Top
 Post subject: Re: Run Code on Visible Layers Script for GIMP
PostPosted: Sat Oct 21, 2017 8:56 pm  (#17) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
Maybe Wallace can explain in details but when Wallace requested a script to run on all visible layers, he needed the effect to be applied individually on each layer so I don't think he could've used the one layer then cut into tiles solution.
Plus after you cut them into tiles you'll have adjust spacing and i's and j's would be in separate tiles because of the dotted parts separated from the main letter.

_________________
TinT


Top
 Post subject: Re: Run Code on Visible Layers Script for GIMP
PostPosted: Mon Feb 26, 2018 1:56 am  (#18) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
So I ran into an example of where Ctrl+F doesn't work (unless of course you wrote a script that did the steps asked by Pat).
Pat wants to do Alpha To Selection and Pattern Fill on each layer just now.
And a one-liner (technically multiple lines just ran together as one liner).
https://www.gimplearn.net/viewtopic.php ... 947#p14947

This was forgotten until Pat mentioned it. Thanks Pat.

_________________
TinT


Top
 Post subject: Re: Run Code on Visible Layers Script for GIMP
PostPosted: Mon Feb 26, 2018 6:47 am  (#19) 
Offline
GimpChat Member

Joined: May 12, 2015
Posts: 4694
Thank you, Tin. That little script of yours work very well! I love it! Now I am seeing if I can get BRL all layers to work for me. Your scripts are really good.


Top
 Post subject: Re: Run Code on Visible Layers Script for GIMP
PostPosted: Mon Feb 26, 2018 10:48 am  (#20) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
Do you need a one-liner for BRL or did you find the script I wrote for Wallace?

_________________
TinT


Top
Post new topic Reply to topic  [ 25 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Is it possible to make a new path from the visible?

5

No new posts VS Code - configure linting for PythonFu

0

No new posts Attachment(s) Inserting pdb.python_gegl command in my code

21

No new posts Attachment(s) Source Code for all my GEGL Filters

32

No new posts Attachment(s) Kaleidoscope Plugin Source Code

1



* Login  



Powered by phpBB3 © phpBB Group