https://bugs.kde.org/show_bug.cgi?id=495811

--- Comment #1 from Evan Lee <evan.lee...@gmail.com> ---
I tried to find a workaround with setChildNodes but it resulted in a similar
internal error.

I ran this script on the default document which consists of two layers: "Paint
Layer 1" and "Background".

```python
from krita import *

doc = Krita.instance().activeDocument()
activeNode = doc.activeNode()
parentNode = activeNode.parentNode()
node = doc.createNode('test', 'paintlayer')
childNodes = parentNode.childNodes()
i = childNodes.index(activeNode)
childNodes.insert(i+1, node)
print([node.name() for node in childNodes])
parentNode.setChildNodes([])
parentNode.setChildNodes(childNodes)
doc.setActiveNode(node)
doc.refreshProjection()
```

Krita has encountered an internal error:
SAFE ASSERT (krita): "shape" in file
C:/builds/graphics/krita/libs/ui/kis_node_manager.cpp, line 162

If the node for setActiveNode is different from the one inserted, setActiveNode
is ignored and the active node is set to the top child.

When `parentNode.setChildNodes([])` is commented, we get the below error
followed by the one from above.

Krita has encountered an internal error:
SAFE ASSERT (krita): "!newNode->parent()" in file
C:/builds/graphics/krita/libs/image/kis_node.cpp, line 473

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to