Bug 419207 - Document Krita actions for Python plugins
Summary: Document Krita actions for Python plugins
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Scripting (show other bugs)
Version: 4.2.8
Platform: Other Other
: NOR wishlist
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-25 01:31 UTC by keyth_qcfx2
Modified: 2020-08-03 11:58 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description keyth_qcfx2 2020-03-25 01:31:41 UTC
SUMMARY
I am making a color picker in Python and I came across some really hard barriers.

I can't access any mouse/pen events outside the docker I created, being able to have a event where I can access if there was a button press or release in Krita would would not force me to check constantly any change of color inside Krita so I could update my docker only after a possible change like after a event mouse bbutton release for example. but the Best case scenario would be if I could actually detect a color change.

Another issue I have is with the Eraser mode, each time I do a color update and change the color on my docker the eraser turns off automatically. if there would be access to read the state of the eraser, and to set the eraser mode ON or OFF would allow me to not make it go funky constantly as a by product of updating my docker.

Being able to do one of the two would make it viable.

ADDITIONAL INFORMATION
I know it is nothing much but if you guys are curious you can see my addon here: 
https://github.com/EyeOdin/Pigment.O

Thank you in Advance
Comment 1 keyth_qcfx2 2020-03-25 22:00:41 UTC
oh it seems I can ask Krita if the Eraser mode is turned on by doing this:

"""
Application.action("KritaShape/KisToolBrush").trigger()
kritaEraserAction = Application.action("erase_action")
state = kritaEraserAction.isChecked()
if state is False:  # Eraser is OFF
    kritaEraserAction.trigger()
"""

But that does raise the question are there more commands like this? and where can I see them? I really just stumbled upon this on another person addon because there is no where to be read about commands like this that I know of, and I am actively searching for information everywhere.

However I fixed the Eraser but I made it worse with this command forcing a lock on the brush tool and I dont know understand it... I just made a copy paste because there is no acctual info.

Where can I find info about this sort of stuff?
Comment 2 Halla Rempt 2020-03-26 11:44:08 UTC
There are a lot of actions. You can inspect them with the actions() function of the Krita class. They aren't documented, though...
Comment 3 Scott Petrovic 2020-07-31 16:20:25 UTC
There is a new Krita scripting site in the works that is almost launched. There is an action dictionary where you can search all the actions that are available. I think once that site goes live we can close this ticket.
Comment 4 Scott Petrovic 2020-08-03 11:58:04 UTC
I am going to close this for now. You can see all the actions and search them from the scripting site now ...

https://scripting.krita.org/action-dictionary

If anything else comes up we can make a new ticket.