[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-kimageshop
Subject: Debugging "activeNode not updated in Python Script"
From: Vita <vita75737 () gmail ! com>
Date: 2024-01-17 16:55:47
Message-ID: CAHLKHu01rUXKgH3_ejprizD4=djhG3yCHKzeApW+o=ZPU+ZFxw () mail ! gmail ! com
[Download RAW message or body]
Hi!
I am debugging an issue where changing a layer within a python script does
not affect the activeNode() until the script is finished executing
<https://krita-artists.org/t/active-layer-not-updated-in-plugin/81240>.
Here's what I found:
Within KisNodeManager::Private::activateNodeImpl, there is code that gets a
shape for the node. In the script, this shape ends up being Null, so the
function fails this assert
<https://github.com/KDE/krita/blob/c237d74b5765896e19e481f47e082bbb6cc9816d/libs/ui/kis_node_manager.cpp#L165>
and never gets to "imageView->setCurrentNode
<https://github.com/KDE/krita/blob/c237d74b5765896e19e481f47e082bbb6cc9816d/libs/ui/kis_node_manager.cpp#L177>
".
I've placed a breakpoint in KisNodeDummiesGraph::addNode
<https://github.com/KDE/krita/blob/c237d74b5765896e19e481f47e082bbb6cc9816d/libs/ui/flake/kis_node_dummies_graph.cpp#L116>
and
found that it gets called when copying a layer manually, but not when it's
done in the script.
Chasing this upstream, I found that the KisNodeDummiesGraph::addNode is
called in response to a QEvent within KisSynchronizedConnectionBase::event
but now I'm getting a little lost.
Any pointers on how I could continue chasing this down?
I don't understand what the "Shape" is and at which point in the flow it is
supposed to be added for a new layer.
[Attachment #3 (text/html)]
<div dir="ltr">Hi!<div><br></div><div>I am debugging an issue where <a \
href="https://krita-artists.org/t/active-layer-not-updated-in-plugin/81240">changing \
a layer within a python script does not affect the activeNode() until the script is \
finished executing</a>.</div><div><br></div><div>Here's what I \
found:</div><div>Within KisNodeManager::Private::activateNodeImpl, there is code \
that gets a shape for the node. In the script, this shape ends up being Null, so the \
function fails <a href="https://github.com/KDE/krita/blob/c237d74b5765896e19e481f47e082bbb6cc9816d/libs/ui/kis_node_manager.cpp#L165">this \
assert</a> and never gets to "<a \
href="https://github.com/KDE/krita/blob/c237d74b5765896e19e481f47e082bbb6cc9816d/libs/ \
ui/kis_node_manager.cpp#L177">imageView->setCurrentNode</a>".</div><div><br></div><div>I've \
placed a breakpoint in <a \
href="https://github.com/KDE/krita/blob/c237d74b5765896e19e481f47e082bbb6cc9816d/libs/ui/flake/kis_node_dummies_graph.cpp#L116">KisNodeDummiesGraph::addNode</a> \
and found that it gets called when copying a layer manually, but not when it's \
done in the script.<br></div><div><br></div><div>Chasing this upstream, I found that \
the KisNodeDummiesGraph::addNode is called in response to a QEvent within \
KisSynchronizedConnectionBase::event but now I'm getting a little \
lost.</div><div><br></div><div>Any pointers on how I could continue chasing this \
down?</div><div>I don't understand what the "Shape" is and at which \
point in the flow it is supposed to be added for a new layer.</div></div>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic