I’m not sure the Python API provides a way to do this, but a way to quickly sample the canvas to create temporary RGBA bush tips would be nice, I think it would pretty much replicate the mixer brush in PS then.
So you would click on the canvas and the plugin would sample whatever is in the current brush stamp’s footprint ( or bounding box? Not sure which would be better) and dump that into an RGBA brushtip, which would then get overwritten the next time something was sampled.
Thank you for this! I am happy that it was possible to map it to a key
The only problem is that it duplicates everything behind it each time, and ends up messier for each duplicate. I am very happy that you shared such a great script though! This is probably a limitation with Krita?
Photoshop (Alt + Dragging it around leaving duplicates):
You probably just want to use “Paste” later instead of “Copy and Paste”.
Ok, considering the guys from the topic are not yet familiar with scripting, it might be a good idea to go through the list and point out items that are not really suitable for a plugin…
It’s all based on my own knmowledge, I guess there might be some tricks to make some of those happen, so if you disagree, please do tell me.
This is a good suggestion and can be made into a plugin.
That’s not good for a plugin, unfortunately. Which is a pity because what we learned from that experience is that everyone wants their own way for an eraser mode
I don’t think this is possible as a plugin either, unless with messing around with events, which is not really a way I’d go about making a plugin.
Some of that would be possible as a docker if you try hard enough, but some (better syncing with animation), not really. Sound really needs to be done in c++. Cutting sound I guess could be in a docker, but then, it’s probably a somewhat large task.
It kinda should be possible but it wouldn’t be temporary, I think there should be a MR to make it possible to add the brush tips temporarily. There is a way in c++ but I don’t think there is one in Python yet.
I don’t think this is good for a plugin, it would be better as a c++ MR.
Basically, a good rule of thumb for what can be and what cannot be (or qould require various input/events cheating) a Python plugin is this:
plugins can do stuff
plugins can react to your shortcuts (shortcuts made specifically for that plugin)
plugins have only very limited info about what is happening, so making a plugin that does something in reaction to something happening is more difficult/impossible. You can see here what events Krita can inform the Python plugin about: libs/libkis/Notifier.h · master · Graphics / Krita · GitLab
It is possible to some extent, just you would have to play some tricks. Such as when the selection tool is picked. You can either set a timer to check for selection, filter out the mouse release event, or do your own selection overlay.
A simpler way though is that a selection mask is created when you do a selection. So monitor the layer list events and when you see a selection mask being created, you know there is a selection
Edit: Simple example:
from krita import *
from PyQt5 import QtWidgets
qwin = Krita.instance().activeWindow().qwindow()
layerBox = qwin.findChild(QtWidgets.QDockWidget, "KisLayerBox")
layerList = layerBox.findChild(QtWidgets.QTreeView,"listLayers")
doc = Krita.instance().activeDocument()
if doc.selection() is not None:
print ("NO SELECTION")
I have always been looking for some kind of menu that was customizable, with the possibility of assigning to each key a krita function, without limitations, that is to say, that supports any action.
Something similar to the menus that comes with the Wacom driver for Windows, but for Linux users. The ideal would be a floating panel, which can be fixed or hidden, at the user’s choice. The closest I have found is Gnome Pie, directly from the repositories, or a plugin that I like but still somewhat limited, such as Pie menu. I also don’t like the circular shape, I would like a row or column of buttons, and something that is important to me, that the plugin works in “canvas only” mode.
This topic on erasers has many people insisting on their own opinions, but they all agree that they are not satisfied with the status quo.
The reason this topic didn’t work out is probably because we had to unify our opinions to try to implement it as an official feature of Krita. I don’t see a problem with implementing any one of the ideas as an external plugin. (I’m thinking changing the color of the cursor with a pen in eraser mode would be a good idea.
Or is it difficult to implement any of the ideas in this topic by Python script? I’m a beginner in programming, so I don’t know much about it…
Most of idea here might be implemented as native Krita’s functionality:
Python API are not evolved enough to let Python plugin developer to implement things that will interact with canvas
Python is a slow interpreted language and the risk is, if API are opened to let a Python plugin to interact with canvas, to slow down Krita’s performances; and you can be sure in this case that users will complain about Krita and not about the plugin…
After, with Qt, it’s still possible to tweak things, but tweaks are tweaks and:
are source of bugs and unwanted behavior
can be not functional anymore at any time (especially if something change in Krita’s UI)
@tiar already gave an answer about which plugins can be (easily) made in Python.
Can add this one:
Not possible to do through a Python plugin.
There’s too much missing API
And can also add this one:
This one can be done.
There’s already a similar plugin ([plugin] Pie Menu v0.4) even if it’s not exactly what is asked here (especially because of “I also don’t like the circular shape”)