| Summary: | setActiveNode activates WRONG node sometimes | ||
|---|---|---|---|
| Product: | [Applications] krita | Reporter: | IPv6 <razinkov> |
| Component: | Scripting | Assignee: | Krita Bugs <krita-bugs-null> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | normal | CC: | tamtamy.tymona |
| Priority: | NOR | ||
| Version First Reported In: | 5.3.2 | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Other | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
IPv6
2026-05-27 18:26:12 UTC
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 *** |