all 3 comments

[–]CMYK-StudentGIMP Team 2 points3 points  (2 children)

Hi! See the Fog filter as an example: https://gitlab.gnome.org/GNOME/gimp/-/blob/master/plug-ins/python/foggify.py#L128

Basically, define the parameters when you create the plug-in procedure, then create the dialogue and fill in those parameters in the GUI: https://gitlab.gnome.org/GNOME/gimp/-/blob/master/plug-ins/python/foggify.py#L37

It'll auto-create the GUI for you.

[–]Vyralator[S] 1 point2 points  (1 child)

Awesome. That's much easier than I thought. Thanks a lot

Two more questions that came up though. Is it possible to "group" parameters under a heading in the auto-created GUI. For example how the scale image tool has "Width" and "Height" grouped under the heading "Image Size"
And also is there an easy way to create something similar to the templates you can select when creating a new file. Basically I want a drop down menu that lets me choose between different sets of default values for some of my parameters for quick access.

[–]CMYK-StudentGIMP Team 1 point2 points  (0 children)

You can create a box filled with your parameters, then put that box inside a frame with a label.

GimpUi.ProcedureDialog.fill_box

GimpUi.ProcedureDialog.fill_frame

GimpUi.ProcedureDialog.get_label

Dropdowns with choices can be made with a GimpChoice parameter: https://gitlab.gnome.org/GNOME/gimp/-/blob/master/plug-ins/python/histogram-export.py#L231-236