Krita is a singleton class that offers the root access to the Krita object hierarchy.
The Krita.instance() is aliased as two builtins: Scripter and Application.
Static methods
Methods
Member documentation
Parameters
name | (no description provided) |
Return
the action that has been registered under the given name, or 0 if no such action exists. |
Return
return a list of all actions for the currently active mainWindow. |
Return
the currently active window or None if there is no window |
Add the given docker factory to the application. For scripts loaded on startup, this means that every window will have one of the dockers created by the factory.
Parameters
factory | The factory object. |
add the given plugin to Krita. There will be a single instance of each Extension in the Krita process.
Parameters
extension | the extension to add. |
load the given profile into the profile registry.
Parameters
profilePath | the path to the profile. |
Return
true if adding the profile succeeded. |
determines whether the script is run in batch mode. If batchmode is true, scripts should now show messageboxes or dialog boxes.
Note that this separate from Document.setBatchmode(), which determines whether export/save option dialogs are shown.
Return
true if the script is run in batchmode |
creates a list with the names of all color depths compatible with the given color model.
Parameters
colorModel | the id of a color model. |
Return
a list of all color depths or a empty list if there is no such color depths. |
creates a list with all color models id's registered.
Return
a list of all color models or a empty list if there is no such color models. |
creates a new document and image and registers the document with the Krita application.
Unless you explicitly call Document::close() the document will remain known to the Krita document registry. The document and its image will only be deleted when Krita exits.
The document will have one transparent layer.
To create a new document and show it, do something like:
Parameters
width | the width in pixels |
height | the height in pixels |
name | the name of the image (not the filename of the document) |
colorModel | A string describing the color model of the image:
|
colorDepth | A string describing the color depth of the image:
|
profile | The name of an icc profile that is known to Krita. If an empty string is passed, the default is taken. |
resolution | the resolution in points per inch. |
Return
the created document. |
return a list with all registered extension objects.
Return
(no description provided) |
construct a Filter object with a default configuration.
Parameters
name | the name of the filter. Use Krita.instance().filters() to get a list of all possible filters. |
Return
the filter or None if there is no such filter. |
Retrieves all installed filter strategies. A filter strategy is used when transforming (scaling, shearing, rotating) an image to calculate the value of the new pixels. You can use th
Return
the id's of all available filters. |
Filters are identified by an internal name. This function returns a list of all existing registered filters.
Return
a list of all registered filters |
Internal only: for use with mikro.py
Parameters
v | (no description provided) |
Return
(no description provided) |
This allows you to get icons from Krita's internal icons.
Parameters
iconName | name of the icon. |
Return
the icon related to this name. |
retrieve the singleton instance of the Application object.
Return
(no description provided) |
Parameters
text | (no description provided) |
Return
(no description provided) |
Parameters
context | (no description provided) |
text | (no description provided) |
Return
(no description provided) |
the Notifier singleton emits signals when documents are opened and closed, the configuration changes, views are opened and closed or windows are opened.
Return
the notifier object |
creates a new Document, registers it with the Krita application and loads the given file.
Parameters
filename | the file to open in the document |
Return
the document |
create a new main window. The window is not shown by default.
Return
(no description provided) |
creates a list with the names of all color profiles compatible with the given color model and color depth.
Parameters
colorModel | A string describing the color model of the image:
|
colorDepth | A string describing the color depth of the image:
|
Return
a list with valid names |
read the given setting value from the kritarc file.
Parameters
group | The group the setting is part of. If empty, then the setting is read from the general group. |
name | The name of the setting |
defaultValue | The default value of the setting |
Return
a string representing the setting. |
return all recent documents registered in the RecentFiles group of the kritarc
Return
(no description provided) |
returns a list of Resource objects of the given type
Parameters
type | Valid types are:
|
Return
(no description provided) |
activates the first view that shows the given document
Parameters
value | the document we want to activate |
sets the batchmode to value; if true, scripts should not show dialogs or messageboxes.
Parameters
value | (no description provided) |
Determine the version of Krita
Usage: print(Application.version ())
Return
the version string including git sha1 if Krita was built from git |
Return
a list of all views. A Document can be shown in more than one view. |
write the given setting under the given name to the kritarc file in the given settings group.
Parameters
group | The group the setting belongs to. If empty, then the setting is written in the general section |
name | The name of the setting |
value | The value of the setting. Script settings are always written as strings. |