I have been playing with scripting for last few weeks. And even with what already exposed to python you can do a lot of stuff which makes me happy.
What I (as a plugin developer) would like to have in the future is ability to develop plugins without me requiring to know Krita source code.
In general on topic of things, that would be nice to see is following:
Connect to events
An ability to connect to certain events. Examples:
- Selection added
- Selection changed (moved, resized, edited, etc)
- Layer added
There might be more useful events. I think other event can be brainstormed. These are the ones I would personally like to have.
Notifier class is a good candidate for that.
Make class representation for default dockers
We already have
Palette class. It would be good to have a class for “Grid and Guides” for instance, to be able to manipulate grid and guides directly. Possibly other dockers can use class equivalent in Python API
Every action has a “completed” slot
The arguments of this slot contain all required settings for this action. For instance, the end of selection action would have a selection object as argument (or something like that). For the transform tool the values of translation, rotation, scale would be passed and so on.
This will add the flexibility to the plugin to trigger after user did something.
Disclaimer, I know that Krita uses QAction behind the scene and this request will probably require create your custom Action class.
Scripter window improvements
Some improvements (mainly usability) would be nice to see:
- Better text editor. I can make a separate list of things upon request. But in general it could see a better user experience in code writing.
- Better font for output panel. Sometimes for better debugging some tables can be rendered. It would be nice to have all characters constant size (including space) so that formatting with print can lead a good readable output. (I guess it can be solved just by setting another font [ship with krita to make sure])
- Do not close scripter with ‘ESC’ button. The scripter seems to be a popup window and can be closed with ESC key. However when debugging and working with tools that involve ESC key for cancel (such as transform tool) also leads to closing the window (which is annoying). At least let people configure this behavior in settings.
Make access to blending modes the same way as with actions and filters
I saw a TODO to make names as enumeration, maybe when it is done the list of blending modes also can be retrieved with a function.
Overall API unification
There are things that looks inconsistent. For instance
View.selectedNodes produce a node or list of them. Though completely different classes to work with.
Script operation as atomic operation
Join set of commands from script to single operation to undo by single Ctrl+Z.
In other words if the script copy the node then rotates it then moves it than transforms it, user should cancel this operation with single undo operation. At least maybe let the plugin developer manually define that following set of operations will be treated as one. Maybe by calling functions like
Better debug output for forum support
Krita already has a window to show all the system information that can be included in bug report.
Maybe for scripting would be good to have something like that too. Some sort of a helper function to print everything the dev would need to know about document, krita, window, etc. to give proper support on scripting matter.
P.S. Again, these things are just from my point of view. Please treat it as a suggestion, rather then call to immediate action. I fully understand that devs have limited resources