Skip to content

Commit 83b5cb1

Browse files
authored
Update and rename GroupSVGsThenMerge.PY to __init__.py
1 parent 17a0472 commit 83b5cb1

File tree

2 files changed

+24
-56
lines changed

2 files changed

+24
-56
lines changed

GroupSVGsThenMerge.PY

Lines changed: 0 additions & 56 deletions
This file was deleted.

__init__.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
from krita import Extension, Krita
2+
from PyQt5.QtWidgets import QAction, QFileDialog
3+
from .merge_svg_layers import merge_all_vector_layers_and_export
4+
5+
class MergeSvgExtension(Extension):
6+
""" Krita Extension to merge vector layers and export as an SVG """
7+
8+
def __init__(self, parent):
9+
super().__init__(parent)
10+
11+
def setup(self):
12+
""" Setup the extension (no special setup needed). """
13+
pass
14+
15+
def createActions(self, window):
16+
""" Adds a menu action to Krita. """
17+
action = window.createAction("merge_svg_layers", "Merge & Export SVG", "tools/scripts")
18+
action.triggered.connect(self.run_script)
19+
20+
def run_script(self):
21+
""" Runs the main script when the menu action is clicked. """
22+
merge_all_vector_layers_and_export()
23+
24+
Krita.instance().addExtension(MergeSvgExtension(Krita.instance()))

0 commit comments

Comments
 (0)