![]() |
Migrating Python plug-in from Gimp 2.10 - 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) +---- Forum: Scripting questions (https://www.gimp-forum.net/Forum-Scripting-questions) +---- Thread: Migrating Python plug-in from Gimp 2.10 (/Thread-Migrating-Python-plug-in-from-Gimp-2-10) |
Migrating Python plug-in from Gimp 2.10 - nerudaj - 05-27-2025 Hi, I'd appreciate some help with the migration of one of my Python-based Gimp 2.10 plugins to Gimp 3. I've already managed to write two unrelated plugins that do some import/export shenanigans so I am able to add new plugin, debug it somewhat etc. However, I have three issues: 1) It seems that not all Procedure::add_xy_argument work or at least they don't behave as intended. My understanding is that calling: Code: dialog = GimpUi.ProcedureDialog.new(procedure, config, plug_in_name) 2) It seems that I am not able to simply add widgets to ProcedureDialog, I can only refer to id's added to the procedure during do_create_procedure. Therefore, I can't for example add buttons with callback actions or a dropdown that would list all layer groups but not regular layers. Is there any workaround for this? 3) I didn't find a way to disable a bunch of default buttons that render for each plugin, namely these: [attachment=13516] Is it possible to hide all of these? Now why am I asking? Here's a plugin demo I have for 2.10: ![]() As you can see, this plugin is only a preview with its own rendering canvas to which I copy layers selected in the dropdown menus. I am attempting to port it to Gimp3, but I don't know how to interface with Gtk3 directly so I can add whatever widgets I need during plugin run and not during initialization (not to mention I can't add buttons). Source for the 2.10 plugin is here: gimp-pixel-art-utils/tile-preview/tile-preview.py at main · nerudaj/gimp-pixel-art-utils Any ideas how to achieve the same result in Gimp3? RE: Migrating Python plug-in from Gimp 2.10 - Ofnuts - 05-28-2025 1) AFAIK not all argument types have existing selectors in current Gimp3 versions (for instance, image and paths) so when they are used as arguments, there is nothing for them in the auto-generated dialog 2) you can generate you own complete dialog. AFAIK you can add GimpUI elements in a regular pyGTK script. 3) see 2) RE: Migrating Python plug-in from Gimp 2.10 - nerudaj - 05-28-2025 (05-28-2025, 07:42 AM)Ofnuts Wrote: 1) AFAIK not all argument types have existing selectors in current Gimp3 versions (for instance, image and paths) so when they are used as arguments, there is nothing for them in the auto-generated dialog Thanks for your response. I didn't realize I can just ignore ProcedureDialog and create my own window with Gtk. If anybody else stumbles upon this thread, here's a minimal Python plugin that opens its own window: Code: #!/usr/bin/env python3 |