1 # SPDX-FileCopyrightText: 2010-2022 Blender Foundation
3 # SPDX-License-Identifier: GPL-2.0-or-later
8 Display the number of selected and total nodes on the compositor. On the
9 Compositing Nodes Editor.
15 def node_stats(self
, context
):
16 if context
.scene
.node_tree
:
17 tree_type
= context
.space_data
.tree_type
18 nodes
= context
.scene
.node_tree
.nodes
19 nodes_total
= len(nodes
.keys())
23 nodes_selected
= nodes_selected
+ 1
25 if tree_type
== 'CompositorNodeTree':
27 row
= layout
.row(align
=True)
28 row
.label(text
="Nodes: %s/%s" % (nodes_selected
, str(nodes_total
)))
32 bpy
.types
.NODE_HT_header
.append(node_stats
)
36 bpy
.types
.NODE_HT_header
.remove(node_stats
)