DESCRIPTION I have addon that selects layer with python API ``` doc.setActiveNode(layerNode) doc.waitForDone() ``` With Recent 5.3.2 activating layer via API activates wrong Node sometimes, not the one in layerNode. It happens sporadically, the console prints a warning: "WARNING: TimelineFramesModel::slotCurrentNodeChanged: node not found!" When this warning happens - wrong node is selected. Node is perfectly valid, not a None, it is found by doc.nodeByUniqueID before call with some extra logic. I failed to create reproducible KRA file. Probably the reason my KRA is really heavy on hierarchy (many different layers with clones, filters, groups, some groups closed etc) It worked flawlessly in 5.3.1 SOFTWARE/OS VERSIONS OS: macOS 26.5 Krita Version: 5.3.2 (git 7d1ae74) Qt Version (loaded): 5.15.7
Code used to find layer before activation roughly: ``` def lfind(layerName, parentLayer): for layer in reversed(parentLayer.childNodes()): if layerName == layer.name(): return layer if len(layer.childNodes()) > 0: returned = lfind(layerName, layer) if returned is not None: return returned return None from krita import Krita app = Krita.instance() doc = app.activeDocument() layerNode = lfind("Background", doc.rootNode()) doc.setActiveNode(layerNode) doc.waitForDone() ```
Related or duplicate of bug 478763. I don't think it worked flawlessly in 5.3.1, because I had the exact same issues in my plugin Life Drawing Session for a while now.
I switched back to 5.3.1.1 (since the bug is really annoying with addon i need regularly) - and for me activation code works without issues again, at least for my files. Using krita on MacOs and Windows, can cofirm 5.3.1 is fine for my usecase. Regarding 5.3.2 what I noticed - it may work several first times after file open - and then stop to work until file is reloaded. Then can work again. Could be also somehow related to selecting layer inside several nested closed groups with disabled visibility (again, my frequent usecase)
In that case, could you please test MR https://invent.kde.org/graphics/krita/-/merge_requests/2803 (instruction: https://krita-artists.org/t/how-to-test-a-merge-request-or-a-new-unfinished-feature-instruction/120134 - you gotta choose this pipeline: https://invent.kde.org/graphics/krita/-/pipelines/1250132 and then choose your OS and find the executable in "Artifacts" folder). If it also works correctly, then this bug report is a duplicate of bug 520744, I think.
(In reply to Tiar from comment #4) > In that case, could you please test MR > https://invent.kde.org/graphics/krita/-/merge_requests/2803 I downloaded MacOs artifact from here - https://invent.kde.org/graphics/krita/-/jobs/4476126 - and seems both issues (setActiveNode and active layer on open) are fixed! At least first tests - everything as it is in 5.3.1. Will continue to use it, hope this pesky commit was the base reason for all that fuzz :) Sys data of now-working krita: Krita Version: 5.4.0-prealpha (git 9362fb4), Qt version compiled: 5.15.7, loaded: 5.15.7. Process ID: 98765
Setting as duplicate, then. Please reopen if you do see issues. *** This bug has been marked as a duplicate of bug 520744 ***