-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from wojtryb/development
Deploy v1.3.0
- Loading branch information
Showing
65 changed files
with
1,816 additions
and
982 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# SPDX-FileCopyrightText: © 2022-2023 Wojciech Trybus <[email protected]> | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
__version__ = "1.2.2" | ||
__version__ = "1.3.0" | ||
__author__ = "Wojciech Trybus" | ||
__license__ = "GPL-3.0-or-later" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
### Alternative Krita API | ||
Package `api_krita` wraps krita api offering PEP8 compatibility, typings, and docstring documentation. Most of objects attributes are now available as settables properties. | ||
|
||
```python | ||
from .api_krita import Krita | ||
from .api_krita.enums import BlendingMode, Tool, Toggle | ||
|
||
# active tool operations | ||
tool = Krita.active_tool # get current tool | ||
Krita.active_tool = Tool.FREEHAND_BRUSH # set current tool | ||
Tool.FREEHAND_BRUSH.activate() # set current tool (alternative way) | ||
|
||
# operations on a document | ||
document = Krita.get_active_document() | ||
all_nodes = document.get_all_nodes() # all nodes with flattened structure | ||
picked_node = all_nodes[3] | ||
|
||
picked_node.name = "My layer name" | ||
picked_node.visible = True | ||
picked_node.opacity = 50 # remapped from 0-255 go 0-100 [%] | ||
document.active_node = picked_node | ||
document.refresh() | ||
|
||
# Operations on a view | ||
view = Krita.get_active_view() | ||
view.brush_size = 100 | ||
view.blending_mode = BlendingMode.NORMAL # Enumerated blending modes | ||
|
||
# Handling checkable actions | ||
mirror_state = Toggle.MIRROR_CANVAS.state # get mirror state | ||
Toggle.SOFT_PROOFING.state = False # turn off soft proofing | ||
Toggle.PRESERVE_ALPHA.switch_state() # change state of preserve alpha | ||
``` | ||
|
||
Only functionalities that were needed during this plugin development are wrapped, so some of them are not yet available. The syntax can also change over time. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.