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

VanishingPointAssistant::adjustPosition via Pyhton

Tags: None
(comma "," separated)
junshiozawa
Registered Member
Posts
10
Karma
0
OS
Can Krita access VanishingPointAssistant::adjustPosition via Pyhton?

https://api.kde.org/extragear-api/graph ... 94a65081c8

Two vanishing points must be aligned horizontally(pixel coordinates) for 3-point perspective(eyelevel) and 2-point perspective(eyelevel), but Krita can not.

Krita cannot move the vanishing point by numerical input(pixel coordinates).

Can I access the function of moving the vanishing point by numerical input(pixel coordinates) via Python?

Or do I have to hack C++ code and merge request?
NMaghfurUsman
Registered Member
Posts
2
Karma
0
Hi! May I know if python scripting is necessary for what you are trying to achieve? I also wanted to be able to specify the exact positions of assistants, but I opted for a C++ solution and implemented a coordinates display in the Tool Options, it shows the coordinates of the currently selected assistant, and it accepts numeric input.

Image
Image

I haven't tried submitting this into Krita it yet, but if you're interested I'll try to have the code cleaned up soon so its presentable for a merge request in future versions.
junshiozawa
Registered Member
Posts
10
Karma
0
OS
Dear NMaghfurUsman,

Your C++ code is what I wanted.

Does it accept numeric input from numeric keys on PC keyboard?

Please merge request your C++ code on Krita's Git"L"ab.
NMaghfurUsman
Registered Member
Posts
2
Karma
0
junshiozawa wrote:Does it accept numeric input from numeric keys on PC keyboard?


It uses the KisDoubleParseSpinBox class, which means it can do numeric input and operators like addition, subtraction, divide, multiply that you have on your numpad, along with whatever else this widget class provides. If you are capable of compiling Krita on your system, you can checkout my code from here https://invent.kde.org/nmaghfurusman/kr ... rds-widget and in the meantime I'll try to submit a merge request for review later this weekend.

I've also made an attempt at a Python API for assistants over here https://invent.kde.org/nmaghfurusman/kr ... stants-api So far it's only good for getting the current set of Assistant objects on the canvas, and getting/setting the X,Y coordinates of the AssistantHandle's that belong to each Assistant object. From python scripts that is.
junshiozawa
Registered Member
Posts
10
Karma
0
OS
Dear NMaghfurUsman,

NMaghfurUsman wrote:
I'll try to submit a merge request for review later this weekend.


I appreciate you.

NMaghfurUsman wrote:
I've also made an attempt at a Python API for assistants


I am grateful to you.

I am trying to create Japanese comic(manga) Extension for Krita(Python) now.
User avatar
kamathraghavendra
Registered Member
Posts
234
Karma
4
OS
+1 for this, thanks for working on this


junshiozawa
Registered Member
Posts
10
Karma
0
OS
Nabil Maghfur Usman.
I'd like to ask you for a merge request as soon as possible.
I need this feature for a 3 point perspective.
Your code is great.

NMaghfurUsman wrote:
junshiozawa wrote:Does it accept numeric input from numeric keys on PC keyboard?


It uses the KisDoubleParseSpinBox class, which means it can do numeric input and operators like addition, subtraction, divide, multiply that you have on your numpad, along with whatever else this widget class provides. If you are capable of compiling Krita on your system, you can checkout my code from here https://invent.kde.org/nmaghfurusman/kr ... rds-widget and in the meantime I'll try to submit a merge request for review later this weekend.

I've also made an attempt at a Python API for assistants over here https://invent.kde.org/nmaghfurusman/kr ... stants-api So far it's only good for getting the current set of Assistant objects on the canvas, and getting/setting the X,Y coordinates of the AssistantHandle's that belong to each Assistant object. From python scripts that is.


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Evergrowing, Google [Bot], rblackwell