It is currently 27 Jan 2022, 14:37

• Featuring Members' Images •
Could be related to 'GIMP10 Constantize Plug-in'
tim
skinnyhouse
skinnyhouse
nidhogg
oldmangrumpy

GIMP/GL:  Tutorials | Tips | Questions | Interests | Script Requests
Recommendations:  Index | Top 10
Resources:  🡆 Python-Fu Plug-ins | Scheme-Fu Scripts | GIMP
Python:  Lessons | Questions | Exercises
The Arts:  GIMPed | GIMPed Photos | Other | Contests | Public Domain Images | Isolated Images | Blender
Inkscape
Social:  Say Hello | Anything Goes | Shares | FCSP

GIMP10 Constantize Plug-in

Share your Python Fu Scripts/plug-ins for GIMP here
tim
GL Blogger
1st Place
5775 Post(s)

GIMP10 Constantize Plug-in

Post#1 by tim » 07 Sep 2018, 05:06


More 90% of the time, when .scm scripts or .py plug-ins break, it's because of old CONSTANT names in the files are not recognized by GIMP 2.10 (2.10.6). I have had numerous cases where all that was needed was a simple constant names replacement here or there and the script would run flawlessly.
I know there might be scripts/plug-ins that require logic changes but they're rare.
So this plug-in is here for you to replace all old constant names in .scm or .py files so that it would run in GIMP 2.10.6.
gimp10_constantize.py #
version 1. put in your GIMP's /plug-ins/
Tested in GIMP 2.10.6
(8.33 KiB) Downloaded 461 times
gimp10_constantize.py #
version 2. Added LAYER MASK Constants
(9.28 KiB) Downloaded 283 times
gimp10_constantize.py #
version 3. Added BUCKET FILL Constants
(10.42 KiB) Downloaded 689 times
Script Menu Location: Python-Fu/GIMP10 Constantize...
instructions:
1. Just have any image opened in GIMP 2.10.
2. Run script (Python-Fu/GIMP10 Constantize...). Navigate to and select the .scm or .py file you'd like this script to run on. Click "OK" to run. That's it.
3. If anything goes wrong, there will be a copy of your original file under the same folder with '_backup' appended to it (for example if you input "C:\myscript.scm", it'll back up your script in "C:\myscript.scm_backup"
4. After it runs, your file should be overwritten with all the new constant names.

[highlight=green]See also: GIMP10 Constantize Batch Plug-in (to be used along with this plug-in to do all files in the scripts/plug-ins directory).[/highlight]

I don't know what are the constant names are, right now I have it handle these
  • LAYER_MODES
  • BLEND_MODES
  • FILL_MODES
  • MASK_TYPES (added in version 2)
  • BUCKET_FILLS (added in version 3)
These are unchanged in GIMP 2.10
  • GRADIENT TYPES
  • IMAGE MODES
but if there are addition CONSTANT groups, they should be easy to add to this plug-in to handle it and upload a new version.

After the script, if it's .scm you should be able to refresh scripts and the .scm should run. If it's .py you should be able to run the plug-in without having to exit GIMP since I try to set it to executable as well.
aka Tin
World Food Program | Good Deeds Forum

         

Pat625
Tutorial Creator
2nd Place
4514 Post(s)

Post#2 by Pat625 » 07 Sep 2018, 07:08


I used your script and now this works in 2.10.4 and 2.10.6 (Samj)
Save All Layers as Brushes.scm #
(2.78 KiB) Downloaded 404 times

skinnyhouse
Script Coder
5th Place
2305 Post(s)

Post#3 by skinnyhouse » 07 Sep 2018, 07:10


Clever, clever, clever!

oldmangrumpy
Tutorial Creator
10th Place
1438 Post(s)

Post#4 by oldmangrumpy » 07 Sep 2018, 07:57


Tin - a caveat if you do not mind. I have downloaded your plugin and attempted to use it for my failing 2.10 scripts.

However, mine are currently configured under 'user>AppData>2.10>Gimp>' ... which seems to be the default for 2.10 non portable versions.

When i load your plugin to search for the target script, the Appdata path is not visible from your script. Obviously I have made it visible in file explorer for my own normal use.

So, tomorrow I will re-organise my GIMP preferences and try your plugin again.

Thanks for giving us this tool.
Senior's moments are just part of a lifelong learning experience - never stop learning
OMG's: Downunder Art Thread | Gold Ring Addiction

tim
GL Blogger
1st Place
5775 Post(s)

Post#5 by tim » 07 Sep 2018, 12:43


Pat625, right on Pat happy to hear, thanks for testing it too. Also thanks for adding the updated .scm I added a link to it in my GIMP 2.10 Scripts/Plugins links list that https://www.gimplearn.net/viewtopic.php ... f=3&t=1448 (Currently #2).

skinnyhouse, Thanks, you wrote some script I will make Script Coder your default group on this forum now.

omg, You should be able to browse to it, i am not on Windows but on linux to browse to folders that aren't shown you just click on File System instead of Desktop or whatever that is shown and drill down to your correct folder. I have no control over what is shown to you from the script anyways. If that doesn't work, worse case is you move them to a place that it does see or that you could browse to "fix" then move it back.
aka Tin
World Food Program | Good Deeds Forum

         

david
Forum Member
18th Place
300 Post(s)

Post#6 by david » 07 Sep 2018, 14:30


tim,

A great idea!!
I have just installed 2.10.
I put your file into plugins, but unfortunately it does not show up in Python-fu. I suspect I might be missing a lib file.
I will investigate further (I had many problems with lib files when adding other plugins - only fixed with fantastic help from rich).

The only thing I have a problem with at the moment is the saulgoode script for luminosity masks, which I use a great deal.
When I view them in 2.10 they show against a background of transparency. They still work, but judging them from their appearance is more difficult.

I have attached a copy. Perhaps you can tell me if the change is due to differences between 2.8 and 2.10.

david.
Attachments
sg-luminosity-masks.scm #
(4.81 KiB) Downloaded 247 times

tim
GL Blogger
1st Place
5775 Post(s)

Post#7 by tim » 07 Sep 2018, 14:42


david, does sg-luminosity-masks only create masks.
I think you might like scheme script shared in this thead https://www.gimplearn.net/viewtopic.php ... mask#p6601
I wrote it after reading Pat-David's tutorial on luminosity masks so I think it's identical to sg-luminosity-masks (except it creates layers with the masks next to them for you to quickly toggle on/off).
aka Tin
World Food Program | Good Deeds Forum

         

david
Forum Member
18th Place
300 Post(s)

Post#8 by david » 07 Sep 2018, 14:50


tim,

Thanks for your lightning fast reply!!!
I have downloaded your script and will try it.
I have always used the saulgoode script simply because it was the one I downloaded originally and it was familiar.
It creates the nine levels of luminosity masks.

david.

tim
GL Blogger
1st Place
5775 Post(s)

Post#9 by tim » 07 Sep 2018, 14:54


my script creates nine levels of masks but have it on the the 9 layers of the image that you can quickly toggle on/off.
I think the only diffence is instead of getting 9 masks you get 9 layers of those masks already applied.
aka Tin
World Food Program | Good Deeds Forum

         

tim
GL Blogger
1st Place
5775 Post(s)

Post#10 by tim » 07 Sep 2018, 14:58


We have this menu "Script-Fu", then "Create New", then "Luminosity Masks" available
Screenshot from 2018-09-07 07-55-55.png
Screenshot from 2018-09-07 07-55-55.png # (145.3 KiB) Viewed 9215 times (Thumbnail | Recognize | Sq Tile | LNFI)
aka Tin
World Food Program | Good Deeds Forum

         


GIMP/GL:  Tutorials | Tips | Questions | Interests | Script Requests
Recommendations:  Index | Top 10
Resources:  🡆 Python-Fu Plug-ins | Scheme-Fu Scripts | GIMP
Python:  Lessons | Questions | Exercises
The Arts:  GIMPed | GIMPed Photos | Other | Contests | Public Domain Images | Isolated Images | Blender
Inkscape
Social:  Say Hello | Anything Goes | Shares | FCSP

Post Reply New Topic
  • Similar Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 20 guests