Bug 412846 - Expose ways to select/deselect nodes in the Layer docker
Summary: Expose ways to select/deselect nodes in the Layer docker
Status: REPORTED
Alias: None
Product: krita
Classification: Applications
Component: Scripting (show other bugs)
Version: 4.2.7
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-11 11:55 UTC by Larpon
Modified: 2020-08-17 04:33 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Larpon 2019-10-11 11:55:16 UTC
SUMMARY
I'm working on a python plugin (https://github.com/Larpon/krita-bulk-actions) that can trigger actions/functions on multiple nodes at once based on layer name matching.

I'd like to include a way to select and deselect nodes. The reason for this is to have a way to quickly select a group of layers I want to export (currently using "Batch Exporter" from GDQuest but it's useful for all types of operations done on selected layers).

Now, I can't find any calls in the API to toggle the selection state of a Node.

I've found this with help from @tiar-dg on IRC:
https://code.woboq.org/kde/calligra/krita/ui/kis_node_manager.h.html#_ZN14KisNodeManager16setSelectedNodesE5QListI12KisSharedPtrI7KisNodeEE 

My guess is that we'd also need a setDeselectedNodes or setDeselectedAll() function as well - if not already there somewhere.
Comment 1 Tiar 2020-04-07 18:44:40 UTC
The Calligra code is probably very old, the current code is here:
https://invent.kde.org/kde/krita/-/blob/master/libs/ui/kis_node_manager.h
Comment 2 Scott Petrovic 2020-07-31 14:13:17 UTC
The only way I see right now to select nodes is through the document class

see "setActiveNode"
https://api.kde.org/appscomplete-api/krita-apidocs/libs/libkis/html/classDocument.html


It doesn't look like there is a way to select multiple nodes at once. Right now you have to iterate over the nodes to do things with all of them.

de-selecting might be a bit tricky since you must have at least one layer selection. For now it might be better to just set your active selection again if there are changes. We might be able to add a function like this... 

setActiveNodes(QList<Node *value>)

where you could change the active selection to multiple nodes at one time.
Comment 3 Bug Janitor Service 2020-08-15 04:33:13 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 4 Larpon 2020-08-16 07:37:47 UTC
I'll try and see, thanks
Comment 5 Larpon 2020-08-16 07:39:17 UTC
A function setActiveNodes would also be good
Comment 6 Bug Janitor Service 2020-08-17 04:33:11 UTC
Thanks for your comment!

Automatically switching the status of this bug to REPORTED so that the KDE team
knows that the bug is ready to get confirmed.

In the future you may also do this yourself when providing needed information.