It is currently 13 Apr 2021, 06:28

• Featuring Members' Works (Image Attachments) •
1: member
2: member
3: member
4: member
5: member

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

Apply and Save/Load Preset Script for Layer Effects (Experimental)

Share your Python Fu Scripts/plug-ins for GIMP here
tim
GL Blogger

Apply and Save/Load Preset Script for Layer Effects (Experimental)

Post#1 by tim » 12 Dec 2018, 22:19


This script won't allow you to load a preset and change it before applying
But it does allow you apply an effect for example: a bevel and emboss (part of layerfx.py) and save that as a preset name by calling "Apply and Save Preset Bevel and Emboss".
Then later you can apply a preset by calling "Load Preset Bevel and Emboss" and choosing the preset name you've previously saved.
Also version 7 and up allows you to apply all layer effects presets with the same name.
For example if you have saved a preset bevel and emboss called "candle" and an inner shadow called "candle" (same name) you can apply both in one go by calling "Load Preset Apply All" and choosing "candle".

See also Layer Effects Presets Collection for presets to be used with this plug-in/script.
layerfx_presets.py #
put in your GIMP's /plug-ins/ folder
(5.92 KiB) Downloaded 150 times
layerfx_presets(2).zip #
version 2. converts color to 3 item tuple so that it doesn't error out when changing shadow layer mode
(2.31 KiB) Downloaded 126 times
layerfx_presets(3).zip #
version 3. defaults highlightmode to screen and shadowmode to dividive like the bevel and emboss defaults (this is wrong see next version)
(2.31 KiB) Downloaded 124 times
layerfx_presets(4).zip #
version 4. defaults highllightmode to SCREEN and shadowmode to MULTIPLY like defaults of bevel and emboss defaults
also added UNUSED 2 mode which is unused but keeps all modes after it indexed correctly
(2.35 KiB) Downloaded 131 times
layerfx_presets(5).zip #
version 5. has Apply and Save and Load Presets for all layer effects provided by layerfx.py
(5.68 KiB) Downloaded 140 times
layerfx_presets(6)_and_altered_layerfx.zip #
version 6 along with altered layerfx.py which allows gradient selection for inner_glow and outer_glow and gradient/pattern selection for stroke
(36.63 KiB) Downloaded 132 times
layerfx_presets(7)_and_altered_layerfx.zip #
version 7 along with altered layerfx.py.
Added "Load Preset Apply All" method which allows you to apply all layer_effects with the same preset name (so that more than one layer effect can be applied at the same time)
(37.08 KiB) Downloaded 128 times
layerfx_presets(8)_and_altered_layerfx.zip #
version 8. Sorts all preset names shown to "Load Preset Apply All" in alphabetical order as this list could get large
(37.13 KiB) Downloaded 132 times
layerfx_presets(9)_and_altered_layerfx.zip #
version 9 along with altered layerfx.py.
Allows Apply and Save to change layer modes to new layer modes in addition to legacy modes to save and apply presets so Load will successfully call these presets as well.
(37.63 KiB) Downloaded 127 times
layerfx_presets(10)_and_altered_layerfx.zip #
version 10.
When "Load Preset Apply All" run based on the layer name so that when presets are set to merge with layer it doesn't error out because it's a new layer pointer.
(37.73 KiB) Downloaded 200 times
Plug-in Menu locations:
multiple entries under Layer/Layer Effects
for example for Bevel and Emboss it's under
Layer/Layer Effects/Apply and Save Preset Bevel and Emboss
Layer/Layer Effects/Load Preset Bevel and Emboss

Settings files are saved as .txt files under the working folder (wherever you execute GIMP from).
For example, for bevel and emboss settings it's saved under "bevel_and_emboss.txt".
They're just text file that has each setting on a line starting with preset name followed by the pipe (|) character then followed by parameters used. So if you wanted to share these settings you can by just copying whatever lines you like to corresponding .txt file or rename the preset name by just changing the text in front of the pipe.
aka Tin

         

Krikor
Forum Member

Post#2 by Krikor » 13 Dec 2018, 20:23


Hi tim
I'm not sure if I'm using this script right, but anyway, the first attempt I've got this error:
Error: Illegal value for argument 12.
Traceback (most recent call last):
   File "C: \ Users \ ... \ GimpPortableSamj \ GimpEval-2.10-Win \ 64bit \ lib \ gimp \ 2.0 \ python / gimpfu.py", line 740, in response
     dialog.res = run_script (params)
   File "C: \ Users \ ... \ GimpPortableSamj \ GimpEval-2.10-Win \ 64bit \ lib \ gimp \ 2.0 \ python / gimpfu.py", line 361, in run_script
     return apply (function, params)
   File "C: \ Users \ ... \ GimpPortableSamj \ GimpEval-2.10-Win \ 64bit \ lib \ gimp \ 2.0 \ plugins \ layerfx_presets.py", line 73, in python_tt_bevel_and_emboss
     pdb.python_layerfx_bevel_emboss (image, layer, style, depth, direction, size, soften, angle, altitude, glosscontour, highlightcolor, highlightmode, highlightopacity, shadowcolor, shadowmode, shadowopacity, surfacecontour, usetexture, pattern, texturescale, texturedepth, patterninvert, mergewithlayer)
RuntimeError: execution error
Attachments
ErrorLayerFxBevelEmboss0001.png
Krikor0040 LayerFx BevelEmbossPreset
ErrorLayerFxBevelEmboss0001.png # (45.59 KiB) Viewed 5733 times (Thumbnail | Recognize | Sq Tile)
"I feel that in both art and music, it's not the success that matters but the pleasure it gives you. Focus on the pleasure and the learning will come naturally." - Brian Weston

tim
GL Blogger

Post#3 by tim » 13 Dec 2018, 22:05


That is odd, not sure why it's erroring out let's see if others are getting this error.
I wonder if it's just the Portable SamJ version that erroring out.
aka Tin

         

tim
GL Blogger

Post#4 by tim » 13 Dec 2018, 22:49


argument 12 looks like highlightmode, did you try changing the highlight mode.
I only tested with Normal Mode.
aka Tin

         

Krikor
Forum Member

Post#5 by Krikor » 14 Dec 2018, 13:10


tim wrote:
13 Dec 2018, 22:49
argument 12 looks like highlightmode, did you try changing the highlight mode.
I only tested with Normal Mode.
I believe I used Screen Mode in Highlight Mode.
Screen mode is the default in Bevel and Emboss.

But I've tested again now, and used Normal mode for highlight mode. It resulted in the same error message given earlier.
Attachments
ErrorLayerFxBevelEmboss0002.png
Krikor0041 LayerFx BevelEmbossPreset
ErrorLayerFxBevelEmboss0002.png # (35.86 KiB) Viewed 5697 times (Thumbnail | Recognize | Sq Tile)
"I feel that in both art and music, it's not the success that matters but the pleasure it gives you. Focus on the pleasure and the learning will come naturally." - Brian Weston

tim
GL Blogger

Post#6 by tim » 14 Dec 2018, 15:04


Anyone else getting error that Krikor is getting?
I can't seem to know why this error is happening
aka Tin

         

Krikor
Forum Member

Post#7 by Krikor » 14 Dec 2018, 15:38


I have now tried with Portable Samj version 2.10.6.
But ... no changes, same errors are generated.

Version 2.10.8 according to Samj herself, has problems, isn't reliable.
I'll wait for version 2.10.9. But for now, I still prefer version 2.10.1
"I feel that in both art and music, it's not the success that matters but the pleasure it gives you. Focus on the pleasure and the learning will come naturally." - Brian Weston

tim
GL Blogger

Post#8 by tim » 14 Dec 2018, 16:00


Do you have regular GIMP (not SamJ's portable) maybe give that a try.
aka Tin

         

Dionísio
Forum Member

Post#9 by Dionísio » 14 Dec 2018, 17:34


Tim, I had the same error but I managed to apply the plugin and make the preset this way:
If I change the parameters of the script, it shows the same bug Krikor had. In my tests, the error seems to be in the layer mode - it only crashes if the layer mode not on normal mode. Changing the others parameters don't seem to replicate the error.
I'm also using SamJ 2.10.6 portable version - couldn't make the Partha 2.10.8 work on my computer...

tim
GL Blogger

Post#10 by tim » 14 Dec 2018, 18:10


That's so odd because it's working for me for other layer modes as well.
aka Tin

         


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 18 guests