It is currently Mon Apr 15, 2024 8:18 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 46 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: Apply and Save/Load Preset Script for Layer Effects (Experimental)
PostPosted: Fri Dec 14, 2018 4:58 pm  (#1) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
give this script a try
and let me know if it's useful or not.
If it proves to be useful I'll add the rest of the layer effects (provided by layerfx.py)
so that you can create/save and apply presets similarly like the one "bevel and emboss" in the above script.

_________________
TinT


Last edited by trandoductin on Sat Dec 15, 2018 2:39 pm, edited 1 time in total.

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: Apply and Save/Load Preset Script for Bevel and Emboss (Experiment
PostPosted: Sat Dec 15, 2018 2:38 pm  (#2) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
All other layer effects have been added to the script.
Note: For Inner glow and outer glow, using Color works, using Gradient fails to be called from script for some reason.
Similarly with Stroke as well, using Color works, using Gradient or Pattern fails to be called from script.

_________________
TinT


Top
 Post subject: Re: Apply and Save/Load Preset Script for Layer Effects (Experimental)
PostPosted: Sat Dec 15, 2018 2:41 pm  (#3) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
dinasset, have you ever managed to execute python_layerfx_inner_glow with gradient passed in as color?
or python_layerfx_outer_glow
or python_layerfx_stroke?
I can't seem use anything other than color passing in as color. If i try anything else it fails and I don't know why.

_________________
TinT


Top
 Post subject: Re: Apply and Save/Load Preset Script for Layer Effects (Experimental)
PostPosted: Sat Dec 15, 2018 3:20 pm  (#4) 
Offline
GimpChat Member

Joined: Jul 28, 2018
Posts: 1195
I placed the plugin in my directory and it won't activate, it's not on the layer's menu. Help please.

_________________
https://www.deviantart.com/pocholo17
Image


Top
 Post subject: Re: Apply and Save/Load Preset Script for Layer Effects (Experimental)
PostPosted: Sat Dec 15, 2018 3:51 pm  (#5) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
did you put it in GIMP's /plugins/ folder and do you have layerfx.py installed?

_________________
TinT


Top
 Post subject: Re: Apply and Save/Load Preset Script for Layer Effects (Experimental)
PostPosted: Sat Dec 15, 2018 4:40 pm  (#6) 
Offline
GimpChat Member

Joined: Jul 28, 2018
Posts: 1195
Hi trandoductin, the answers is yes and yes.

_________________
https://www.deviantart.com/pocholo17
Image


Top
 Post subject: Re: Apply and Save/Load Preset Script for Layer Effects (Experimental)
PostPosted: Sat Dec 15, 2018 4:41 pm  (#7) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
well then I have no clue why.
It should just show up with other Layer Effects menus.

_________________
TinT


Top
 Post subject: Re: Apply and Save/Load Preset Script for Layer Effects (Experimental)
PostPosted: Sat Dec 15, 2018 4:52 pm  (#8) 
Offline
GimpChat Member

Joined: Jul 28, 2018
Posts: 1195
The only thing that shows on the Layer menu is Layer Effects and the all filters that belong to layerfx.py

_________________
https://www.deviantart.com/pocholo17
Image


Top
 Post subject: Re: Apply and Save/Load Preset Script for Layer Effects (Experimental)
PostPosted: Sat Dec 15, 2018 5:44 pm  (#9) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
are you on linux or windows..on linux you have to change properties of file to executable.
You could try and start GIMP from command line and see if they show any errors related to layerfx_presets.py

_________________
TinT


Top
 Post subject: Re: Apply and Save/Load Preset Script for Layer Effects (Experimental)
PostPosted: Sun Dec 16, 2018 1:11 am  (#10) 
Offline
GimpChat Member

Joined: Jul 28, 2018
Posts: 1195
Sorry for the late reply Trandoductin, my OS is Windows 10 64 bit. I placed the plugin inside my Gimp personal directory:

Image

One more question; Should I delete the pluginrc file, to reset plugins?

_________________
https://www.deviantart.com/pocholo17
Image


Top
 Post subject: Re: Apply and Save/Load Preset Script for Layer Effects (Experimental)
PostPosted: Sun Dec 16, 2018 2:49 am  (#11) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2238
Location: Poland
Hi Tin.

I always wanted to know if it is possible and in what way to save the Python plugin settings (presets).
I never found a solution - and You did it! Thank you very much.
I found only one problem with layerfx_presets.py for Inner Glow using a gradient (for the color works well).
Iner Glow in LayerFX works well (Gimp 2.10.5 Windows Vista 32bit, LayerFX 2.10 http://gimpchat.com/viewtopic.php?f=9&t=16827#p231240)


Attachments:
Error for gradient inner glow layerfx_presets py.png
Error for gradient inner glow layerfx_presets py.png [ 91.27 KiB | Viewed 2015 times ]
Inner Glow LayerFX.png
Inner Glow LayerFX.png [ 180.89 KiB | Viewed 2016 times ]

_________________
Image

Slava
Ukraini!
Top
 Post subject: Re: Apply and Save/Load Preset Script for Layer Effects (Experimental)
PostPosted: Sun Dec 16, 2018 4:07 am  (#12) 
Offline
GimpChat Member
User avatar

Joined: May 10, 2013
Posts: 1389
Location: FInland
Thank you Tran. I can think use for this. Not maybe as much as back with PS and tweaking lot of custom text styles but the possibility to save especially bevel settings is great.
Was just wondering where the settings files are located and found them in home folder.


Top
 Post subject: Re: Apply and Save/Load Preset Script for Layer Effects (Experimental)
PostPosted: Sun Dec 16, 2018 10:29 am  (#13) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
MareroQ wrote:
Hi Tin.

I always wanted to know if it is possible and in what way to save the Python plugin settings (presets).
I never found a solution - and You did it! Thank you very much.
I found only one problem with layerfx_presets.py for Inner Glow using a gradient (for the color works well).
Iner Glow in LayerFX works well (Gimp 2.10.5 Windows Vista 32bit, LayerFX 2.10 http://gimpchat.com/viewtopic.php?f=9&t=16827#p231240)

That's the thing right now I don't know how to call inner glow and outer glow using gradient the documentation just said that you can pass gradient name as color which my script does and it errors out.
and also stroke as well only colors works when i tried calling with gradient or pattern according the docs it also errors out.
I don't know how to successfully call it with gradient.

_________________
TinT


Top
 Post subject: Re: Apply and Save/Load Preset Script for Layer Effects (Experimental)
PostPosted: Sun Dec 16, 2018 12:42 pm  (#14) 
Offline
GimpChat Member
User avatar

Joined: Jan 13, 2011
Posts: 2238
Location: Poland
Just a suggestion: errors only occur when the LayerFX code for parameters contains "/":

layerfx_outer_glow ("color/gradient", color)
layerfx_inner_glow ("color/gradient", color)
layerfx_stroke ("color/gradientdata/patterndata", fill)

There are no such entries in your code - so I suppose that's why the number of parameters does not match.


Attachments:
Error for arguments.png
Error for arguments.png [ 60.71 KiB | Viewed 1996 times ]

_________________
Image

Slava
Ukraini!
Top
 Post subject: Re: Apply and Save/Load Preset Script for Layer Effects (Experimental)
PostPosted: Sun Dec 16, 2018 1:58 pm  (#15) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
It's not my code the code in the layerfx.py that prevents anything other than PDB_COLOR to be passed in.
So I have hacked layerfx.py a little to accept PDB_STRING instead of PDB_COLOR so a gradient can be passed in then inside the procedure before the validation I try to to make it gimpcolor.RGB if it can else leave it as whatever the string is (when it's gradient) or tuples of values that represent gradient or pattern.
So now version 6 of string is also zipped with my altered version layerfx.py which allows gradient/pattern to be used with stroke and gradient to be used with inner_glow and outer_glow now.
Please give version 6 of script and the altered layerfx.py a try.
Thanks for testing/trying out my script.

_________________
TinT


Top
 Post subject: Re: Apply and Save/Load Preset Script for Layer Effects (Experimental)
PostPosted: Sun Dec 16, 2018 4:09 pm  (#16) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
Version 7 uploaded.

Allows for you to apply all presets that have the same name through "Load Preset Apply All" method.
For example if you saved a bevel and emboss, an inner shadow, an outer glow with the same name like "candle": Choosing "candle" from Load Preset Apply All will go through and apply the bevel and emboss, inner shadow, and outer glow with that preset name "candle". This way you can have a combination of presets to run together as a combined effect when you save them with the same name.
Try it out and let me know how it works for you.
This is highly experimental as I hope the order of operation bevel and emboss then inner shadow would produce same effect if you did it it in reverse order.

_________________
TinT


Top
 Post subject: Re: Apply and Save/Load Preset Script for Layer Effects (Experimental)
PostPosted: Sun Dec 16, 2018 4:15 pm  (#17) 
Offline
GimpChat Member
User avatar

Joined: May 10, 2013
Posts: 1389
Location: FInland
Dang...already new version. Just tested gradients with v6 and like it. Will try 7...no there's already v8.

Image

Tested version 8, this will be awesome plugin to save custom LayerFX sets thanks Tran :clap

Image


Top
 Post subject: Re: Apply and Save/Load Preset Script for Layer Effects (Experimental)
PostPosted: Sun Dec 16, 2018 4:42 pm  (#18) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
Thanks for testing Nidhogg. I am glad you like it!

_________________
TinT


Top
 Post subject: Re: Apply and Save/Load Preset Script for Layer Effects (Experimental)
PostPosted: Sun Dec 16, 2018 10:35 pm  (#19) 
Offline
GimpChat Member

Joined: Jul 28, 2018
Posts: 1195
Hi Tim. I am sorry if I'm a "doofus" :gaah when it comes to this plugin that you created, but I cannot make it work. I placed the plugin where it suppose to, I done a bunch of thing to see if it appear as you said. When I go to: Layer> Layer Effects, I have the all the filters there: Bevel and Emboss, Color Overlay, Drop shadow... etc. I don't see the "Apply and Save/Load Preset" options. I want to experiment your improved layerfx definition, help me please. Thank you in advance!

I'm a Windows 10 user.

_________________
https://www.deviantart.com/pocholo17
Image


Top
 Post subject: Re: Apply and Save/Load Preset Script for Layer Effects (Experimental)
PostPosted: Sun Dec 16, 2018 11:22 pm  (#20) 
Offline
Script Coder
User avatar

Joined: May 07, 2014
Posts: 3975
Location: Canada
Hi Pocholo,
I don't know why it's not showing up for you as it's working for others.
Maybe someone else has a clue as to why.

_________________
TinT


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

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts script to load text file and create text layer

6

No new posts Attachment(s) Unable to load an image as layer

16

No new posts Attachment(s) Apply Selection to Layer with LIVE PREVIEW

6

No new posts Watch Folder and load image as layer

1

No new posts Attachment(s) GEGL Jelly - Apply on Duplicate Layer above and use eraser

3



* Login  



Powered by phpBB3 © phpBB Group