05-03-2024, 12:11 PM
(05-02-2024, 07:33 AM)Ofnuts Wrote: Just made a tutorial for you: https://www.gimp-forum.net/Thread-Gettin...on-scripts
Thank you so much for doing that. I have seen the method, but yours is a better description of registration.
Unfortunately, my issue would be the need to get the "active" image after the plugin has been registered. Since my plugin is really an integration between two DCC's, the plugin is registered at the beginning of a Gimp session and the "active" image can vary after the plugin has been registered, such as working on more than one image at a time.
An example functionality: when a user has two open images, image_A and image_B, and wants to save a new version (version-up) of image_A to the pipeline (Prism), the user clicks the customs command in the menu. This triggers Prism to create the necessarily directories and sidecar files, and then sends a command back to Gimp passing a new filepath. Gimp then handles the image and creates a thumbnail. It then saves the .xcf using the new filepath. That all works well.
But the need is to "know" that image_A is "active". If the arg[image] is passed when the plugin is registered, that image will always be the one referenced which is not desired.
Enviro Vars are out since Gimp has everything in separate environments - which is probably a good thing. I thought about having the plugin save the image position from gimp.image_list() to a .json each time a command is triggered. But that is a bit ugly, and still have the issue of passing which item in the list is the "active".
Hope that makes sense. I don't mind sharing the code, but it will not really function without Prism installed as well.
J.