
Let’s take a look at the second link, the Krita class reference. Let’s see how this stuff works in more detail. The end result is that when we import krita and call functions, we’re actually using the C++ methods listed in that documentation. The magic happens because of a Python tool called SIP, which makes it possible for python speak in C++ and talk to Krita. This is because Krita’s API documentation comes from the underlying C++ language that Krita is written in. Those pages may look like a lot of jargon at first.

FISH KRITA TUTORIAL HOW TO
To learn what Krita functions that are available and how to use them, you will want to go for Krita API reference documentation. For that, we will need see what’s hidden behind the asterisk when you import * from Krita. There’s also a step by step guide for How to make a Krita Python plugin here in the manual.īut it’s likely that you need more information. It’s also worth looking through the python plugins, which are located in /share/krita/pykrita.
FISH KRITA TUTORIAL CODE
Over time we expect the community to write all kinds of scripts that you can use simply by pasting them in the scripter.īut what if you want to write new commands for yourself? The best place to start is very simple: search for examples written by other people! You can save a lot of time if someone else has written code that you can base your work on.

Clearly Python gives you quite a lot of control to automate Krita. Input the following in the text area:įrom krita import * d = Krita. The scripter will pop up with a text editor window on top and an output window below. If you don’t see the scripter plugin, make sure you are using an up-to-date version of Krita. If you don’t see it listed, go to Settings ‣ Configure Krita… ‣ Python Plugin Manager and toggle “Scripter” in the list to enable it. To open the scripter, navigate to Tools ‣ Scripts ‣ Scripter. It is a python console, written in python, which can be used to write small scripts and execute them on the fly. The scripter plugin is not necessary to use python, but it is very useful for testing and playing around with python. For that we’ll first start with the basics: How to run Python commands in the scripter.

FISH KRITA TUTORIAL MANUAL
This manual will instead focus on how to use python to automate and extend Krita. However, as python is an extremely popular programming language and great for beginners, there’s tons of learning material around that can be quickly found with a simple ‘learn python’ internet search. It is outside the scope of this manual to teach you python itself. People who work with computer graphics, like VFX and video game artists use python a lot to make things like sprite sheets, automate parts of export and more. With this we can make dockers, perform menial tasks on a lot of different files and even write our own exporters. What python scripting in Krita means is that we added an API to krita, which is a bit of programming that allows python to access to parts of Krita. Python is a scripting language, that can be used to automate tasks. So what exactly is python scripting? What is Python Scripting? ¶ Some people even only picked python and nothing else. When we offered python scripting as one of Kickstarter Stretchgoals we could implement next to vectors and text, it won the backer vote by a landslide.
