Plugin improvment

Hi,

From this post: Calling Filter dialog in Python Script

I open a new topic to not pollute the original topic :slight_smile:

I don’t really know how it was “before” but I have to admit that current way plugins are managed doesn’t incite to develop and use them:

  • Installing a plugin is very complicated:
    – First of all, to find plugins, you need to go to #develop:plugins section or Krita resource page documentation (I have to update it with my plugins :sweat_smile:)
    – Download and unzip manually and/or use the Python Plugin Importer (if you’re lucky, plugin developer has provided a how-to, otherwise good luck…)
    – And then go to settings > configure > Python Plugin Manager
    – And then need to activate the plugin
    – And then need to restart Krita
    None of this is intuitive

  • Using plugins is not really attractive; apart from the installation process:
    – The Tools > Scripts menu is not intuitive
    – The Tools > Scripts sub-menu is really discouraging (I hate going in this menu, it’s like a mess)

  • Plugins proposed by default are, sorry, not really attractive about what you can really do
    I’m trying to create plugins with attractive interface because for most users (I think) it’s important to have something that is visually attractive (just look how active is the topic Krita UI Redesign started by @fullerhill_art and how people are interested by UI design)
    Also @EyeOdin and @Kapyia made plugins with attractive visual which provides good examples of what can be done (when I discovered their attractive plugins, it made me want to create my own plugins, before that…)

  • And the most important I think, the pure developer point of view:
    – It’s currently very hard for a new comer (I don’t imagine for a beginner) to understand how to create a plugin (it took me time to create the first one)
    – PyKrita API has a good base, but there’s too much thing that don’t work or that don’t work as expected
    I don’t want to critique anything because I know all the work made behind to provide the API (I already took a look to C++ source…) and I know there’s more important priority before improvement of API…

But to get more plugin for Krita, with more users looking for them and more [potential] developers looking for them, here some idea to improve it:

  1. Rename Tools menu by Plugins, it will be more attractive and easier to understand for everyone
  2. Remove Scripts sub-menu and propose a predefined list of sub-menu to categorize the plugins (developers, utilities, filters, layer management, user interface, …)
  3. Review entirely the plugin installation process
    3.1. Remove it from settings
    3.2. Create a dedicated window in Plugins menu (Plugins > Manage plugins)
    3.3. Review the interface and include natively in to this window the Python Plugin Importer feature
    — create a list of available plugins for download, with a button Install
    — once downloaded and installed, the plugin is checked as Active
    — avoid restart of Krita when a plugin is installed/activated/de-activated/de-installed
  4. Review current proposed plugins (yes, they’re not attractive!)
  5. Write a documentation easier and more complete
  6. Improve PyKrita API (I know that some developers ask for better API but I’m not sure that’s the most important for now)

There’s no urgency about all of this, but this is things I started to think about some time ago, and @tiar comment decide me to start a topic.
There’s might be more idea to develop and clarify before starting anything, and determinate if the subject is really interesting or not…
(I unfortunately don’t have all the time I want to currently participate more, I’m still stucking with git and made me :exploding_head:)

Grum999

3 Likes

I agree for sure but as you said priorities :expressionless:

I kinda think there are not many Python addons around just because how hard it is to implement it and mostly lack of documentation to know what is available when you start. The way I learnt most stuff was literally by openning others scripts and see how they did it. I always felt I was stealing going this route.

Considering how few addons are around it means you don’t always find what you need as a reference. So you just have to download every possible addon because you might get lucky that one of them will respond to your question some time in the future.

If I had to vote of what I think is more important for Python and their users to use them I would say:

  • Having to restart Krita after activating it - Very disruptive for the user as they feel they are actively going back on what they are doing. Gimp had the same thing and I really disliked it. in Krita it seems less distressful I don’t know why, maybe the loading screen or something, but it is still a full stop.

I always thought something more than “Scripts” would appear in this menu over time.
I do agree if nothing else would be added there besides Plugins.

I agree there for sure…
The only ones I like are “Hello World” (good starting point learn even though I made a different style later), “Python Plugin Importer” and “Scripter”. The rest I tend to deactivate if I make a new installation of Krita.
There is also “Python API Reference” Script from @rbreu (not sure if it is her nick in this forum) that I appreciate alot and I think should be almost as the same level as other starting scripts:

The other scripting needs I had, where the things I did. But I know people do use the other scripts especially those related to brushes.

One thing I might add just because I find peculiar, is the holy trinity of Krita Python:
1- Python (language)
2- PyQt5
3- Krita API
they are like the 3 gates you need to pass to implement something.
ex: you might be able to do something in Python but if PyQt5 has the same option it will be negated. And if you can do something in PyQt5 but Krita does not like it, it will be negated too.
This can happen to commands or even on code ordering.
It is like a balance to walk and pass through all 3 gates and some times the only solution to implement something feels unabalanced from certain perspectives.

Yes… I had to analyze code of other plugin to understand how to build mine…
But, maybe as now we are more comfortable with plugin, we can take time to write a documentation. I don’t really know how to write this and what we need to write… may be a complete how-to to create a basic plugin rather than a theoretical documentation… :thinking:

Technically from what I saw, python and plugins are loaded at Krita startup and it might be difficult to reload all of this on the ‘fly’…
I don’t know the underlying technical method.
It seems that python library is loaded and create a python session, in which all plugins are loaded.
This means that all plugins are loaded in the same workspace, as all libraries.

To let a plugin manager being able to load/unload plugin on the ‘fly’, solutions could be:

  • Completely stop/start the python session (may be the easiest way) but may have on impact on current loaded/running plugins
  • Run each plugin in it’s own python session, but it might be resource consuming and I’m not sure that it will be easier to connect plugins to Krita interface
  • Implement a standardized way of writing plugins and declare them, to allow plugin engine being able to load/unload them on the ‘fly’ (I’m currently using importlibto be able to reload entirely plugin when I’m doing some dev with scripter plugin) so mybe it could be a way to explore…

It make sense :slight_smile:
Plugins with a plugin manager.

Yes sorry, I didn’t list all plugins and authors (even if list is short) :sweat_smile:

Yes, but I don’t see how it can be made differently :thinking:

Grum999