This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Python: How to import krita flake?

Tags: None
(comma "," separated)
Hayakuchi0
Registered Member
Posts
2
Karma
0

Python: How to import krita flake?

Fri Oct 19, 2018 5:19 am
Hello.

I'm trying to make python plugin script after tutorial( https://docs.krita.org/en/user_manual/p ... pting.html ).

I will make python script, that is write characters by svg (vertical writing for Ubuntu).
But I can't understand method of import KoSVGTextShape in python.
I thinking the reason, that is KoSVGTextShape in KritaFlake.
How to import KritaFlake's class?

Code: Select all
from krita import KoSVGTextShape


~
krita.scripting: " from krita import KoSVGTextShape"
krita.scripting: "ImportError: cannot import name 'KoSVGTextShape'"
~
User avatar
halla
KDE Developer
Posts
5092
Karma
20
OS
You can only use classes defined in the libkis library: https://api.kde.org/extragear-api/graph ... bkis/html/ -- other C++ classes are not accessible from Python.

You could try to use the VectorLayer class: https://api.kde.org/extragear-api/graph ... Layer.html, but the Shape class currently only has a toSvg, no fromSvg. We would have to extend the API to support what you want to do -- which is something I'm very interested in!
Hayakuchi0
Registered Member
Posts
2
Karma
0
Thank you for ansewering!

I have understood it now.
I will try to make function with VectorLayer class or direct edit C++ Source, until you begin support API.

I'm looking forward it!
If can I help you, please send message to me!


Bookmarks



Who is online

Registered users: abc72656, Bing [Bot], daret, Google [Bot], lockheed, Sogou [Bot], Yahoo [Bot]