Created attachment 125442 [details] Script to create a mask node This problem was brought to light thanks to Frohman and tiar over at Krita-Artists.org. There's currently a problem with the libkis API where trying to create a mask node of any kind results in an empty/broken layer mask object. The created node always has the name "effect" (kis_effect_mask.cc, line 27) and has no bounds/size. From what I can tell, the problem stems from the method 'createNode' in Document.cpp creating mask nodes somewhat incorrectly, resulting in them being "incomplete". On my system it also leads to a crash when I try to make Krita display the mask (eg. trying to isolate the layer). I've attached a small script that helps reproduce the problem in Krita.
If tiar and frohman can reproduce it, let's mark it as confirmed.
Git commit c1e18cedea1e404bc8b1727f22dbe8282d6e1024 by Boudewijn Rempt. Committed on 15/04/2020 at 14:14. Pushed by rempt into branch 'master'. Create masks from python with the given name The mask itself was fine; but the name wasn't passed through. M +2 -2 libs/image/kis_effect_mask.cc M +1 -1 libs/image/kis_effect_mask.h M +2 -2 libs/image/kis_filter_mask.cpp M +1 -1 libs/image/kis_filter_mask.h M +1 -1 libs/image/kis_image.cc M +1 -1 libs/image/kis_layer_utils.cpp M +2 -2 libs/image/kis_selection_mask.cpp M +1 -1 libs/image/kis_selection_mask.h M +2 -2 libs/image/kis_transform_mask.cpp M +2 -2 libs/image/kis_transform_mask.h M +2 -2 libs/image/kis_transparency_mask.cc M +1 -1 libs/image/kis_transparency_mask.h M +3 -2 libs/image/lazybrush/kis_colorize_mask.cpp M +1 -1 libs/image/lazybrush/kis_colorize_mask.h M +5 -4 libs/libkis/Document.cpp M +1 -1 libs/ui/dialogs/kis_dlg_filter.cpp https://invent.kde.org/kde/krita/commit/c1e18cedea1e404bc8b1727f22dbe8282d6e1024
Git commit b62d9cdb99adc0cb9e21df80afdeeefbd161cd5a by Boudewijn Rempt. Committed on 17/04/2020 at 07:22. Pushed by rempt into branch 'krita/4.3'. Create masks from python with the given name The mask itself was fine; but the name wasn't passed through. (cherry picked from commit c1e18cedea1e404bc8b1727f22dbe8282d6e1024) M +2 -2 libs/image/kis_effect_mask.cc M +1 -1 libs/image/kis_effect_mask.h M +3 -2 libs/image/kis_filter_mask.cpp M +1 -1 libs/image/kis_filter_mask.h M +1 -1 libs/image/kis_image.cc M +1 -1 libs/image/kis_layer_utils.cpp M +2 -2 libs/image/kis_selection_mask.cpp M +1 -1 libs/image/kis_selection_mask.h M +2 -2 libs/image/kis_transform_mask.cpp M +2 -2 libs/image/kis_transform_mask.h M +2 -2 libs/image/kis_transparency_mask.cc M +1 -1 libs/image/kis_transparency_mask.h M +3 -2 libs/image/lazybrush/kis_colorize_mask.cpp M +1 -1 libs/image/lazybrush/kis_colorize_mask.h M +5 -4 libs/libkis/Document.cpp M +1 -1 libs/ui/dialogs/kis_dlg_filter.cpp https://invent.kde.org/kde/krita/commit/b62d9cdb99adc0cb9e21df80afdeeefbd161cd5a