Created attachment 170092 [details] assert SUMMARY I have custom addon that replace layer byte data from python after custom processing. It worked well in Krita 5.2.+ and 5.3.0. Today i updated Krita Next to nightly build and it started to show an assert on each action. Tested both on MacOs and Windows - same assert on same action. It worked the same way well in previous nightly builds of 5.3.0 The python code that trigger assert is: activeSel = doc.selection() ... many actions involving erode/dilate of selection ... # restoring initial selection doc.setSelection(activeSel) # causes assert OBSERVED RESULT - Assert in console SAFE ASSERT (krita): "!m_d->parent || !parent" in file /Users/gitlab/ws/builds/GZwHuM5x/0/graphics/krita/libs/image/kis_paint_device.cc, line 1195 - Alert on screen EXPECTED RESULT - no assert SOFTWARE/OS VERSIONS Windows: Windows 11 macOS: Sonoma 14.5 (23F79)
Thank you for the report. Usually, safe asserts are not shown to the users, so they are not a huge deal. But I can confirm the issue.
Hi, IPv6! When you modify the selection, you need to first duplicate the selection with `Selection::duplicate()` and then modify it: ```python from krita import * doc = Krita.instance().activeDocument() activeSel = doc.selection() newSel = activeSel.duplicate() newSel.invert() doc.setSelection(newSel) ``` Please take it into account that the selection should be a **raster** selection for this code to work correctly.