01-15-2018, 10:14 PM
(01-15-2018, 10:02 PM)Ofnuts Wrote: Most Python scripts just declare parameters and Gimp builds a parameter dialog on the fly when they are called. Those that don't either don't take parameters other than image+layer, or have a whole GUI written in Python. For a standard Python script that uses this autogenerated dialog, see Filters>Render>Cloud>Fog... (in your installation as (lib/gimp/2.0/plug-ins/foggify.py).
That's what I'm doing, I just never heard it described as "auto-generated". Here's my registration function:
Code:
register(
"python-fu-folders",
"Generate an image from directory hierarchy",
"Generate an image from directory hierarchy",
"David Kettle", "David Kettle", "2018",
"Generate from folders ...",
"", # type of image it works on (*, RGB, RGB*, RGBA etc...)
[
(PF_SPINNER, "width", "Width of image in pixels", 600, (1, 262144, 100)),
(PF_SPINNER, "height", "Height of image in pixels", 480, (1, 262144, 100)),
(PF_STRING, "dir", "Directory", "/Dropbox/WordPress/Galleries/Guatemala, 2009"),
(PF_SPINNER, "opacity", "Opacity (0 - 100)", 50, (0, 100, 5)),
(PF_COLOR, "background", "Background color", (255,255,255))
],
[],
folders, menu="<Image>/Python-Fu")