This is just an inquiry for something I've wondered about for a long time. I've only ever scripted in scheme and am not familiar with the internal workings of pythonfu.
In regular scm files, it seems to be standard practice to set up a full undo for the script, but I don't see this done in plugins, aka pythonfu. I did look over the documentation a bit and found this.
image.enable_undo()
Enables undo for image. You might use these commands round a plugin, so that the plug-in's actions can be undone in a single step.I guess I'm more focused on plugins dealing with paths, but they all seem to require a zillion undo steps if you decide to try that, and some will never remove the path it created. Of course you can manually remove the path which is the same thing, but it just made me wonder if there was something about pythonfu, or in particular plugins dealing with paths, that there isn't a way to do a full undo?
Anyway, on another note, I downloaded a plugin today that had the coolest feature I've ever seen! When you start gimp after installing
this plugin, it prompts you for a menu location, plugin name, and it's defaults. (Only one default setting in this plugin, but of course it could be more.)
This is just fantastic and wish this could be incorporated as standard practice for every script or plugin. The only problem with it, is if you make a mistake, it directs you to delete the generated menu_path file so you can adjust it again. Unfortunately this doesn't work because it has been registered in the pluginrc file. The only way I was able to fully reset it's menu location is to remove it from the pluginrc file. Of course most people could just delete their pluginrc file, but mine is customized to to get the menu structure I want for binary plugins that the menu location can't be changed.
Anyway, this seems to be a huge leap forward in what gimp scripts and plugins could be like in the future. It would be great if more people could use this code and make it standard practice. I've personally spent days getting my menus the way I want and it would be trivial if you could answer a few questions upon first run of the script to have it exactly the way you want.
Cheers,
akovia