Summary: | Canvas is not updated when Node::setVisible() is called from python script | ||
---|---|---|---|
Product: | [Applications] krita | Reporter: | Aurélien Da Campo <aurelien.dacampo> |
Component: | Scripting | Assignee: | Krita Bugs <krita-bugs-null> |
Status: | RESOLVED WORKSFORME | ||
Severity: | normal | CC: | halla |
Priority: | NOR | ||
Version: | 4.0 pre-alpha | ||
Target Milestone: | --- | ||
Platform: | Microsoft Windows | ||
OS: | Microsoft Windows | ||
Latest Commit: | Version Fixed In: | ||
Attachments: | This image shows the inconsitency between the canvas & the layers docker |
You should call doc.refreshProjection() after adding a node to update the view. We made that a separate step because updating the projection after adding a node can take a lot of time. So, I'm not sure whether this really is a bug that should be fixed... Thanks a lot it makes a lot of sense. So yes indeed that's not a bug in my sense. Just me being lazy to figure it out or simply a lack of documentation regarding this specific thing. I actually looked for Document/Node::updateXXX, Document/Node::invalidate() or Document/Node::validate() but didn't find the Document::refreshXXX() one ;) It works fine. Okay, then we can close this? I'll try to figure out how to improve the dox; right now, the example for this is with cerateFillLayer |
Created attachment 111241 [details] This image shows the inconsitency between the canvas & the layers docker When layers are hidden from the "Scripter" extension the canvas is not updated. However, the "Layer" docker is updated. Note: This happens on krita-nightly-x64-v4.0.0.51-594-gba8550543c Here is a simple sample code to reproduce this issue: --- from krita import * doc = Krita.instance().activeDocument() if doc is not None: for node in doc.topLevelNodes(): node.setVisible(False) else: print("No active document.") ---