Gimp-Forum.net
Searching for python script islands to layers - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: Extending the GIMP (https://www.gimp-forum.net/Forum-Extending-the-GIMP)
+--- Thread: Searching for python script islands to layers (/Thread-Searching-for-python-script-islands-to-layers)

Pages: 1 2 3 4


RE: Searching for python script islands to layers - Ofnuts - 01-29-2018

You didn't copy verbatim my procedure. You are using old-style registration since you don't use a specific "menu" named parameter, but lump the menu position and submenu item in one parameter  (the variable "menupath"). In the new-style registration, there is one variable for the menu, and one that is just used for the menu item (the desc* variables in my code, that also serves other purposes). And when using old-style, the behavior of the default parameters (image/drawable) is different.

Otherwise:
  • I use variables for the parameters because I register several functions and many parameters are identical, so this avoids repetition. However, the function for each plugin is guaranteed to be different, so there is no point in having a "function" variable for this. In fact, in Python, the function name is a variableSmile
  • The copyright is a copyright, not a licence. This field is really meant to be the copyright owner (usually, but not always, the same as the author).
  • It can be a nice ego boost to have a submenu in Filters bearing you name, but it doesn't help users finding your script. IMHO it should go in <Layer>
  • The output of "print" statements is invisible to most users (on Windows, it is even worse, it is invisible and can freeze the script),  use gimp.message() to issue messages to the user.