[plugin] Pie Menu v0.4

If you could please check the newer version of the beta and if the problem still retains can you please try the ucrrent stable 4.4.1 version?

I’ve tried the beta2 (4.4.2) right now and everything worked just fine.

It might be related to linux or the beta on linux or something in your system maybe?

After you let me know how it works for you with 4.4.2beta2 and 4.4.1 I’ll see what I can do on my end since right now I’m not sure where to look - I’m not related to krita dev so I don’t know whare the current problems of beta. I do plan to do testing for 4.4.2 but after its release.
(then again at least on windows everything works as it should even with the latest beta release).

I’ll be checking this thread so don’t worry about anything and just let me know :wink:

Could you point me out, where can I find beta-2? I see no official post on krita website about this version, and can’t see any links in beta-1 post.
I’ve checked 4.4.1 though, and it works the same way (mouse confirms by releasing the LMB, no crash - stylus needs a click on the action box, otherwise it crashes or is not picking the tool at all).

Later I’ll check out windows version to see how it should work to make sure. Maybe it’s just a kubuntu thing.

1 Like

Actually, I think it’s just the beta1, the beta2 I think there’s some udpate or somethign and I don’t know why in my brain it got registered as beta2 :100:

I’d would be really great to see if it works fine for you on your device with windows compared to the linux.

It would definitely make things at least a bit simpler when it comes to tracing down the source problem.

Right now it works for me just fine on 2 different systems but I’ll try a different linux distribution just to see what happens.

Btw what device (tablet/display/pen) you have please?

1 Like

Ok, I can confirm that it’s distro-specific issue. On the same device but on windows (dual boot) the plugin works well. My tablet is intuos pro L (the old one), but it shouldn’t make a difference once I know it works fine on windows.

I’ll be reading the code more carefully anyway, so if I manage to find what’s going wrong, I’ll fix that. But I woudn’t expect that to be too soon :smiley: Probably some differences in how events are occurring.

1 Like

Well I just gave it a try on linux (Fedora) and it worked exactly the same as on windows so the problem might be specific to Kubuntu or your configuration itself.

1 Like

Here it comes @wojtryb

I gave the kubunto 20.04.1 a try.
It’s probably a Kubuntu thing, I know which part in the code it is specifically. Kubuntu is treating qt events in a weird way for one part (comparing it to other systems which all treat it the same way it seems).

But there’s more.

I’m not entirely sure if I should work this out with a fix since it could be a bit hacky and pose a problem for all other systems. Still checking out my options here.

That was the bad news.

The good news is that this only applies to appimage. Since KUbuntu soudns like a derivate of Ubunut (which apparantely has been giving krita problems since forever - at least someone told me so) I went to krita.org, download section and instead of appimage downloaded it through PPA (the link for linux derivates of Ubuntu - sounds like that’s the version I should install on KUbuntu anyway, doesn’t it?).

The good news is that if you install through PPA everything works just fine.
The unfortunate ones is that PPA downloaded for me the 4.4.0 version, I don’t know how to get to newer versions through it but I’m no a linux guy so if you or anyone else knows please let me know.

Now this introduces a new question, 4.4.0 vs 4.4.1 vs 4.4.2beta is there a difference that makes the plugin work in 4.4.0?
Again I tested appimage 4.4.0 vs PPA 4.4.0 and turns out what works is the PPA and not the appimage on KUbuntu so it’s not 4.4.0 vs 4.4.1 but AppImage vs PPA.

Thus if you use the PPA you should hopefully get a normal funcitonality.

Would you please mind and giving it a quick test to see if PPA works on your system or if the problem persists?

Thank you!

Hi

Can you provide us more information about this?

Kubuntu is based on Ubuntu, himself build on Debian
And many popular distro are based on Ubuntu or on Debian

There’s no reason for which krita won’t run properly on Ubuntu compared to other distro, except if the package in repository doesn’t respect excepted dependencies (ie: wrong Qt/PyQt version)

I’ll try to take a look on it tonight.

For me, it’s more a bad new than a good news because appimage is the most simple way to have an up-to-date krita version on Linux, and it’s the recommended way I think to use Krita on Linux.
And it’s build by Krita’s team.

I don’t think, but you have to be more precise about how the problem occurs with Qt event.

appimage => you have an embedded version of Qt/PyQt officially supported by Krita
PPA=> you have version of Qt/PyQt installed on system, and it may not match version supported by Krita

Grum999

I see. I know that appimage is the most optimal way but I don’t know why it works differently in KUbuntu but for example not in Fedora. I think I’ll check some other linux distributions to see if Fedora is the one out of bounds but if it’s not then I really don’t see into this too deep.

For now it seems in Kubuntu (appimage) the event I get is tabletrelease but not mouserelease but it gave the event multiple times for some reason.

Now why it works with the PPA again I don’t really use linux much so I don’t understand the differences here that much but the PPA behaves for me the same as windows, fedora and the other I forgot the name of (I tested this linux version qutie a while ago).

I’ll give it a few mroe testing and then I might update the code and work with both mouserelease and tablet release and reduce it with a boolean to just one call and ignore the rest.

(When it comes to the ubuntu note, that’s just what someone told me some time ago when I was deciding which linux to test krita on, I was told to avoid ubuntu for some reason so I stayed away from it no details on my side sorry)

Though this makes me wonder how MacOS handles this plugin, I’ll need to ask just in case someone thought this behaviour was intended.
(What a pain to work with so many different systems xDD)

Version 0.3 works great on macOS, and is very useful in fullscreen mode, no clutter on screen at all :+1:t2:

Are you going to add more hooks to kritas features?
If so, I’d miss the ability to switch layers up or down from your pie menu
Best with a quick and small notification message of the name of the layer to which we switched, so we’re aware to be on the right layer.

2 Likes

I already have a pretty solid list.

Layer functionality for that I have big plans no info for now but it’s definitely in works, you might ditch the dockers altogether one day hehe xD (just a joke … but almost true).

Right now I’ll be adding animation actions and a category, the last few layer additions (not all layer types can be accessed through the pie menu at this very moment but in a few days - hell maybe even today)

But just to be clear I don’t want to promise anything right now. It’s Christmas tomorrow so I’d like to get through that day without working too much if possible xD.

But yeah there’s quite a number of new action hooks I’ll be adding.

There’s also quite a few interesting custom features I’ll be adding but these will take a bit more time to develop so definitely not in the next few days. (again, layer functionality is something I really really want to work on so it’s very high on my list). :wink:

Thanks a lot for letting me know that it’s ok on MacOS.

1 Like

No worries, we should going to prepare the Christmas tree and what else
:gift:You made our day already. At least mine :joy:thanks! And

Happy Christmas :christmas_tree:

1 Like

I took a quick look

The following code:

from PyQt5.Qt import *

print("Qt version:", QT_VERSION_STR)
print("PyQt version:", PYQT_VERSION_STR)

return 5.13.1 on Linux appimage 4.4.2b1 for PyQt
return 5.13.1 on Linux appimage 4.4.1 for PyQt
return 5.13.1 on Windows for PyQt
version 5.12.9 is returned for all environments for Qt version

import sys

print(sys.version)

On both environment, I retrieve 3.8.1
On Linux appimage 4.4.2b1, it’s dated from 2020/11/20
On Linux appimage 4.4.1, it’s dated from 2020/10/26
And on windows 2019/12/18

So, there’s some difference between libraries, not sure about impact between Qt/PyQt version

Concerning the plugin, I’ve made some quick test.

I had the bug one time, but was not possible to reproduce it…
(using appimage 4.4.2 on Debian)

I’ll install a kubuntu later to test if there’s a difference

I have one other bug:

  File "/home/grum/.local/share/krita/pykrita/kritapluginpiemenu/MenuArea.py", line 347, in getCurrentPosition
    return QPoint(position.x() - screen.geometry().x(), position.y() - screen.geometry().y())
AttributeError: 'NoneType' object has no attribute 'geometry'

When cursor reach bound of monitor, returned screen is None and then script return an error
=> everywhere you use screen = QGuiApplication.screenAt() you should check if returned screen is set or not before using it

Possible improvements
In menu interface, depending of current tool used, when the menu is displayed, there’s no visible cursor (occurs with brush tool)
Maybe force cursor to be visible when menu is displayed, can be useful especially when you work with a mouse :slight_smile:

In settings, when you decide to change number of menu (set from 3 to 4, or 4 to 3 for example) you loose the current configuration (here, there’s a reset on the first 3 configuration slot)
It’s boring to redefine everything :wink:

Also, when creating a sub-menu, let user define name of menu rather having a tool’s name could be a good thing

Grum999

Well, luckily I already have a fix for the problem @wojtryb is having, I’ve tested it on linux, now I want to give it a check on windows but it shouldn’t affect anything other than the occassions where you have the issues (I hope at least xD).

Right now I’m trying to figure out how the other issues @wojtryb was happens. I can replicate it if I go wild but it’s weird it looks like although I set an object to be deleted and remove the reference to it in python, at a later time if it’s just a split second difference between the end of key release and new keypress (kria action to open the pie menu) the code somehow still access it although there shouldn’t be any references to it any more (I mean I even create a new class instead of it so I can’t see how it’s currently possible). Eghh this will take me some time to figure out :frowning:

Your problem with non-existent screen that’s honestly quite something. How is it possible that it says you don’t have a screen? :slight_smile:
I’ll add the check but I wonder if the menu will appear at a wrong place then?

I’ve tried to reproduce it (I have 3 screens so 3 bounds, technically 4 in between different screens plus the edges) but I can’t, I tried to reproduce it in linux mint and win 10 and so far nothing.
This will be quite tricky since I’m not sure how the screen can be missing. I only had it once in fedora when I didn’t use appimage and had to install pyqt on my own first but then again since pyqt was missing I had a lot more other problems anyway :smiley:

Just to be clear, I test everything with 4.4.1 (the exception was above to figure out where the problem was in @wojtryb case) not the beta version, I have no idea what changed in the beta or what’s currently broken so I want to avoid using it for testing since it can give me errors which are not related to the menu at all one day and the other it can be alright simply with a new update of krita.

Interface
Heh, I actually didn’t notice until today when I started testing on various linux distros. In win 10 I have a small circle as the reticle so it didn’t even occur to me that the cursor is missing until I spent half of the day with in in linux today heh.
I’ll definitely need to figure something out there but for now I’ll set it as a papercut the screen thingy and the other bug I mentioned earlier are currently higher priority.

Settings reload, yeah I definitely agree, I was glad I managed to get the settings work so I though hey why not leave it like this. But I’ll put on my list, after setting the menu 20times for that video I was missing it too.

When it comes to submenus here it’s a little bit different though. The section which triggers the submenu can still be used to do something (for example I have the outline selection tool which opens a submenu with select all, deselect, select opaque, and other select tools; since I use the outline the most I can reach it with just a quick short movement right away and if I need more I just go through the submenu. So changing the name could make it difficult to know what tool you have there.
But yesterday when I added category support I’ve been thinking that I might add categories as options (they don’t trigger anything but you can open the submenu through it) or something similar as a blank.

Well there’s a lot of things to do, who would have thought one menu and it can grow up so much as a project. heh

Thanks for letting me know.

1 Like

yes kubuntu

Are you using the appimage or not and just in case can you download it again and start krita from there? https://krita.org/en/download/krita-desktop/

1 Like

in this moment aim using ppa version 4.4.0
im trying to use it with the step you marked but its not working. im readeing all the coments

i have download api 4.4.1
now i can access to pie menu, but when i press the shortcut nothing happen, and when i press the shortcut + right click appear this:
AttributeError
Python 3.8.1: /usr/bin/python3
Wed Dec 23 19:20:03 2020

A problem occurred in a Python script. Here is the sequence of
function calls leading up to the error, in the order they occurred.

/home/chancho/.local/share/krita/pykrita/kritapluginpiemenu/MenuArea.py in eventFilter(self=<kritapluginpiemenu.MenuArea.EventController object>, source=<PyQt5.QtGui.QWindow object>, event=<PyQt5.QtGui.QMouseEvent object>)
96 elif event.type() == QEvent.MouseButtonRelease:
97 self.mouseButtonPress = False
98 self.deleteEventFilter(source, event)
99 return True
100
self = <kritapluginpiemenu.MenuArea.EventController object>
self.deleteEventFilter = <bound method EventController.deleteEventFilter …tapluginpiemenu.MenuArea.EventController object>>
source = <PyQt5.QtGui.QWindow object>
event = <PyQt5.QtGui.QMouseEvent object>

/home/chancho/.local/share/krita/pykrita/kritapluginpiemenu/MenuArea.py in deleteEventFilter(self=<kritapluginpiemenu.MenuArea.EventController object>, source=<PyQt5.QtGui.QWindow object>, event=<PyQt5.QtGui.QMouseEvent object>)
126 self.controllerOwner.eventController.deleteLater()
127
128 self.eventObj.eventHandler(event, self.controllerOwner.keyReleased)
129
130 class PieMenu(QWidget):
self = <kritapluginpiemenu.MenuArea.EventController object>
self.eventObj = <kritapluginpiemenu.MenuArea.PieMenu object>
self.eventObj.eventHandler = <bound method PieMenu.eventHandler of <kritapluginpiemenu.MenuArea.PieMenu object>>
event = <PyQt5.QtGui.QMouseEvent object>
self.controllerOwner = <kritapluginpiemenu.MenuArea.MenuArea object>
self.controllerOwner.keyReleased = False

/home/chancho/.local/share/krita/pykrita/kritapluginpiemenu/MenuArea.py in eventHandler(self=<kritapluginpiemenu.MenuArea.PieMenu object>, event=<PyQt5.QtGui.QMouseEvent object>, keyReleased=False)
223 return
224
225 if self.distance == None:
226 return
227
self = <kritapluginpiemenu.MenuArea.PieMenu object>
self.distance undefined
AttributeError: ‘PieMenu’ object has no attribute ‘distance’
cause = None
class = <class ‘AttributeError’>
context = None
delattr = <method-wrapper ‘delattr’ of AttributeError object>
dict = {}
dir =
doc = ‘Attribute not found.’
eq = <method-wrapper ‘eq’ of AttributeError object>
format =
ge = <method-wrapper ‘ge’ of AttributeError object>
getattribute = <method-wrapper ‘getattribute’ of AttributeError object>
gt = <method-wrapper ‘gt’ of AttributeError object>
hash = <method-wrapper ‘hash’ of AttributeError object>
init = <method-wrapper ‘init’ of AttributeError object>
init_subclass =
le = <method-wrapper ‘le’ of AttributeError object>
lt = <method-wrapper ‘lt’ of AttributeError object>
ne = <method-wrapper ‘ne’ of AttributeError object>
new =
reduce =
reduce_ex =
repr = <method-wrapper ‘repr’ of AttributeError object>
setattr = <method-wrapper ‘setattr’ of AttributeError object>
setstate =
sizeof =
str = <method-wrapper ‘str’ of AttributeError object>
subclasshook =
suppress_context = False
traceback =
args = ("‘PieMenu’ object has no attribute ‘distance’",)
with_traceback =

The above is a description of an error in a Python program. Here is
the original traceback:

Traceback (most recent call last):
File “/home/chancho/.local/share/krita/pykrita/kritapluginpiemenu/MenuArea.py”, line 98, in eventFilter
self.deleteEventFilter(source, event)
File “/home/chancho/.local/share/krita/pykrita/kritapluginpiemenu/MenuArea.py”, line 128, in deleteEventFilter
self.eventObj.eventHandler(event, self.controllerOwner.keyReleased)
File “/home/chancho/.local/share/krita/pykrita/kritapluginpiemenu/MenuArea.py”, line 225, in eventHandler
if self.distance == None:
AttributeError: ‘PieMenu’ object has no attribute ‘distance’

if you downloaded the plugi nrecently please go to (in krita) settings - manage resources - open resource folder
There find 2 directories:
pykrita and actions

In pykrita directory find:
kritapluginpiemenu (directory)
kritapluginpiemenu.desktop (file)

In actions find:
kritapluginpiemenu.action

Delete them. I’ve accidentally during transferring to a new development platform managed to push wrong code to the plugin.

I’ve just now uploaded corrected files. Try to download it again please.

Also can you please show what this code gives you:
(In Krita go to Tools - Scripts - Scripter, paste the code here and press the run button - if nothing happens first inside the Scripter save the file and then run it)

from PyQt5.Qt import *
print("Qt version:", QT_VERSION_STR)
print("PyQt version:", PYQT_VERSION_STR)
1 Like

I forgot, I had this error at the first startup too…

Fixed it in MenuArea.py file, class PieMenu, method __init__, before line 167, insert this:

self.distance = None

It will fix the problem

@nickgeneratorfailed this problem occurs when eventHandler is triggered before the first call to initNewMenuAt method (the variable doesn’t exists yet)

In general, in python, all variables declaration at class level (self.xxxx) are declared in init constructor; doing declaration in constructor allows to ensure that variable is always defined in class
I saw you did it for other variable, here it might be a mistake :wink:

Grum999

2 Likes

Egh, kick me twice and once more. Heh I forgot to add it back after I undo it one day. What a day today.
Thanks for letting me know. I’ll up it in a moment, I just need to figure out what happened to my git…