New Krita Scripting website feedback

I have been working on a new Python scripting site to help people with a few various things:

  • What areas can be scripted with Krita
  • Focus on simple examples explaining a topic
  • Action dictionary to more easily find available actions
  • Icon library to help people see and use icons that come with Krita
  • Some references to help with building plugins and API references

Here is the WIP site.
https://amazing-elion-61c814.netlify.app/

This will eventually be a new URL under krita.org. I was seeing if people could take a look at it and provide feedback. I am particularly interested in topics that might be good to cover that I missed, or if people want me to go deeper in specific topics.

12 Likes

Thanks a lot for this! I was actually thinking of writing some scripts to automate a lot of repetitive actions, and this is massively helpful to get started.

I just skimmed a couple of sections (for now) and I think I found one mistake: the code snippet in the “Removing layers and performing more actions” subsection of the “layers” section is duplicating the layer instead of deleting it (I guess it was a bad copy-paste, as the same snippet appears earlier).

Also, something that I feel may need more clarification is the plugin location. For linux it states that they are placed under ~/.local/share/krita/pykrita, but I assume that this is not true for snap/flatpak installations. It think would be helpful to also mention the location for these alternate installation methods, even if they are community maintained.

I’ll try to do a more in depth read later this week, and come back if I find something.

1 Like

One thing is for sure: such resource was really missing!

1 Like

it looks so Awesome!!!

1 Like

This is amazing, really helpful for people who want to learn scripting in krita. Here is some feedback for it:

  1. In the “Dialog and Buttons”, “Dockers” and “Menu” session I think some images showing the expected results for the script would be good, since these sessions deal with the user interface i think they are the most critical areas to show the final result.

  2. I dont know if I missed it but i think a link to the krita api page would be good.

other than that looks great!

1 Like

Thanks for the feedback. I originally had some of that layers code in the document section, then moved it once I thought it would be better to have Layers have its own lesson. I can clean that up.

I might have to ask about the flatpak or appimages. I didn’t think those were stored in a different location. The stuff in the local folder are just user related files, so I thought flatpak also stored things there. I can do a bit of digging.

That is a good idea of adding a few more screenshots with results. A lot of these simple examples just print something out in the output, so it didn’t seem that useful for many of examples. The examples that have a UI would probably be good to show the results though.

3 posts were split to a new topic: Fill button doesn’t work

Looking through the API a bit more, I am noticing there are a few areas I could add to the site

  1. Resources API - How to change brush presets, and properties like the brush size, opacity, and flow. This also includes things like getting and setting foreground and background colors
  2. Selections API - How to create selections, modify them, and remove them
  3. Krita Widgets - Custom UI componenets you can use in your scripts like the preset chooser, color palettes, and the scratchpad

I love the idea of this :slight_smile: It’s cool.

Personally I think more examples in the future would be good just to give people more things to learn from.

The major part I think that would be cool is a a big chapter about how to work with Krita documentation (I did see the pyq and krita api parts at the bottom) as that will be the biggest hurdle for anyone trying to get into this. It’s not really made for humans who are not working on Krita or more involved in this kind of thing.

Well, at least I think having thorough read on that can alleviate a lot of pain and help people not to give up or at least I assume this is focused not just on veteran programmers but also on people who are trying to use Krita and maybe tinker something for it on while they might not be python or C++ specialists by a trade? :smiley: , and not just pain but showing how to get things done working together with documentation will make things easier on you as a creator and maintainer of this project (how is it about that fishing rod and the fish? Give fish and you feed, teach fishing and you can relax while they bring the fish? ;0)

I don’t know if this is part of the project scope or not I just, when learning new APIs, libs, languages, really appreciate if the devs/or someone else shows projects/code when they bluntly show/describe how to get to that together with documentation as that makes it more straightforward and much quicker to get me get comfortable in anything I would try to create or would try to study (I’m sure you know how it is, you as a dev know where to find what, what things mean but a new person even if given a link will be wondering how would I decide this is the part I needed or what this means and so on).

(I don’t know if my idea got across, is the description to difficult to understand, sorry I’d love to describe it better)

Definitely nice that your are putting together something that can get people going with scripting in krita keep going at this it’s a great work!

I think the biggest issue when starting out with scripting is people don’t even know what areas you can script - which I am trying to go over with all the basic sections. API pages are for developers. I think linking to an API page is not a good way to teach people when starting off. It is definitely a more advanced thing that I am trying to be careful referencing.

For the start of this site, I was going to see what type of scripts and plugins people are making…and where they might be struggling. Then expand on the areas where people are having a hard time. This isn’t a learn how to program site, so I am not sure how knowledge people have with basic concept like variables and “if” statement. I am sure I could have a primer if there a lot of people who aren’t understanding more general programming concepts.

I certainly didn’t mean it as a “learn programming” source if it sounded like that. I just think that if someone is supposed to put together a project of their own then having examples is always great but what are they going to do when they want to do something different. It’s nice to either have a solid docs like what MDN does with javascript or what PHP has as a manual, so as you started it with concepts that have a general use in most if not all plugins possible for Krita which is great there will be a time for all these plugins when the creator will have to write down some part which is related to functionality he is trying to achieve.

Here might be where the misunderstanding came from? I did not mean by this to give a 101 programming class just a chapter or hints how to use the documentation which is just generated by a script rather than in a readable format for someone new to this (they can very well be programmers but the docs don’t necessarily have to be much help to them anyway or a be a huge headache ;-)).
So I again I did not mean to go through programming concepts, basics or anything like that, just to maybe show in some separate chapter, hint blocks, … how you got that piece of code you showed in a lesson (doesn’t have to be with all the code, could very well be showed on one example at the end or something).

But that’s just how I see it, you might not need docs at lesson one but no matter how you look at it you will probably need docs and work with it after the last lesson, won’t you? :wink:

Maybe it’s not needed at all, maybe not at the beginning, I just wanted to put up a suggestion nothing more.

Either way I’m looking forward to seeing this when you feel it’s finished and ready to fully send out to the world :nerd_face:

Take a look through the current PyQt and Krita API pages on the new scripting site. What questions do you still have after looking through those pages? That lists everything that is available, much more than what I am covering.

Those API pages are designed to help you navigate through the API pages to learn things outside the main concepts. I am sure there are more things I could elaborate or clarify in those.

Answering this question “how you get that piece of code” has multiple answers.

  1. I know some parts of the code and know where to look in the API
  2. I don’t know the code and have to look at the API
  3. I cannot figure it out in the API, so do internet search on it.
  4. If nothing comes back up on the internet, I might ask the developers directly or post here

Maybe I could explain my personal process for how to do research when doing programming projects. This would be a bit more general advice. The topic of how to do research might be something newer programmers don’t realize programmers constantly have to do…regardless of their skill level.

1 Like

maybe a copy and paste selection example? simple stuff like that