Bug 390818

Summary: Get selected nodes or check if node is selected
Product: [Applications] krita Reporter: Andreas <andreasesau>
Component: ScriptingAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: wishlist CC: halla
Priority: NOR    
Version: 4.0.0-beta.1   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:

Description Andreas 2018-02-20 21:56:22 UTC
This is a small feature wish.

Having the possibility to see if a node(layer) is selected in the scripting API. Or getting a list of all selected nodes would be very handy.
That way operations can be executed only on selected nodes.
Comment 2 Halla Rempt 2018-02-22 08:40:03 UTC
Git commit 1a5a68a0b437e250d47308e887342ea93543649d by Boudewijn Rempt.
Committed on 21/02/2018 at 09:39.
Pushed by rempt into branch 'master'.

Scripting: add View::selectedNodes

This returns a list of nodes selected in the given View. Note
that it is possible for different views to have a different
set of selected nodes, so being selected is not a property of
the node.

This also adds a utility class for libkis, so we can share
some common code that doesn't need to be public.

M  +2    -0    libs/libkis/CMakeLists.txt
A  +81   -0    libs/libkis/LibKisUtils.cpp     [License: LGPL (v2+)]
A  +34   -0    libs/libkis/LibKisUtils.h     [License: LGPL (v2+)]
M  +5    -27   libs/libkis/Node.cpp
M  +14   -1    libs/libkis/View.cpp
M  +18   -1    libs/libkis/View.h
M  +2    -0    plugins/extensions/pykrita/sip/krita/View.sip

https://commits.kde.org/krita/1a5a68a0b437e250d47308e887342ea93543649d