Setting up shortcuts conditions and activation flags for a plugin.

Ok, I figured it out. It was my mistake.

As a backup I had an extra .action file inside my plugin’s directory so:
krita/actions/myaction.action
krita/pykrita/myplugin/myaction.action

I was expecting the krita/actions dir to be the main but turns out the .action file inside myplugin’s directory is loaded instead so no changes to krita/actions/myaction.action took any effect.

Activation and condition to tirgger the shortcut is through activationFlags and activationConditions in the action file.

These are in binary format not a decimal or hex.

On iirc dmitriK kindly posted an image with flags from krita’s code so here it is:

I’m leaving this as an answer here just in case someone else gets to troubles setting up the action file since there’s not really any info about it anywhere.
(in the picture the codes are in hex format so convert it to binary if you need to use it)
(this is from kis_action.h - google this through krita keyword to get to the source code in case the codes change in the future)

2 Likes