Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
My Gimp 3.0 Plug-in (group_selected_layers)
#4
(Yesterday, 10:33 AM)Ofnuts Wrote: Since you ask:
  • You should test it on 3.00 RC1 (and from my tests with my own code, do_set_i18n() has to return more that False. OTOH you can completely skip the definition, if you don't want to do I18N).
  • Sensitivity should be set to DRAWABLES (not plural) since you want more than one drawable selected
  • <Image>/Filters/Development/Python-Fu/ isn't where you put your script for general use. A much better place would be <Image>/Layer/Stack, or even <Layers> so that it appears in the right click menu of the Layers list. Also note the slight difference between set_menu_label() and add_menu_path() that hints that you can have the plugin in more than one menu (so, in both places mentioned above)(note: I didn't test this, but easy enough to try).
  • 'Run group-selected-layers' as a doc is a bit tautological. Something like Put selected layers in new group would be a bit more useful (same for the menu label...)
  • IMHO you should have a dialog to ask for a group name
  • selected_layers = image.get_selected_layers() is not really useful... all this data is in your n_drawables argument
  • Didn't run your script, but I wonder what happens when all layers are in the top level (parent is image). I think your script would try to insert the image under a group (or pass None as the layer to insert, that could catch the callee off-guard...)
  • print("ERROR: could not get any parents from selected layers") won't be visible to most users (have to be on Linux/OSX with Gimp started from a terminal, or on Windows using gimp-console). How about using Gimp.message()? But then since get_parent() always return something, this code will never be executed unless there are no layer as inputs, in which case see remark #2.
  • Gimp.PlugIn.__init__(self) should be super().__init__()

Wow, really big thanks for taking the time to write these points. This is really good feedback. I will start work on these as soon as I can and update the script. I do have a couple of questions for now though, if you are able to answer them:

I may be misunderstanding this one but I assumed that [ 2.99.19 - commit fe6e1d7 ] was 3.0RC1

I'm using the flatpak version and running 
Code:
flatpak list | grep gimp

gives the following output:
Code:
GNU Image Manipulation Program  org.gimp.GIMP   3.0.0~rc1       master  gnome-nightly   system
I got the version number [ 2.99.19 - commit fe6e1d7 ] from the /help/about menu while using gimp assuming it was a more specific version number while 3.0RC1 represented the broader stage that development was in or something of that sort. I also get the new pink welcome window popup with 3.0RC1 in the bottom right and assumed that meant everything was right and up to date. 

Also, just to make sure, is this the right place for me to share this kind of WIP script for feedback? I was contemplating whether it should go in the Extending-the-GIMP section or here.

Thanks again, 
Newman 

(Yesterday, 11:13 AM)rich2005 Wrote: Just on the basis of, does it work ?  Gimp 3.0RC1 appimage , Some random layers, then a second time inside the new layer group.

Cool, thanks a lot for testing it. Would you say it worked as you would expect it to or did any specific part of it feel unintuitive or any behaviors catch you off guard? 

Thanks, 
Newman
Reply


Messages In This Thread
RE: My Gimp 3.0 Plug-in (group_selected_layers) - by Newman - Yesterday, 12:07 PM

Forum Jump: