# Python API: bpy.context.selected_nodes gone?

It seems like in the 2.73a version (and 2.74), bpy.context.selected_nodes method is not available despite the documentation showing it up. Does anyone have an idea on what could be happening ?

thanks!

• selected_nodes is only available in the Nodes space context (not the 3D view or any other). Make sure you run that from an operator with the right context from the nodes editor – brita_ Apr 12 '15 at 18:22

## 1 Answer

You might be able to filter on node.select for your application:

mat = bpy.data.materials['checker']
nodes = [ n for n in mat.node_tree.nodes if n.select ]


Although, I'm not entirely sure how that works with node groups (where you have a compound node selected and tab into it and select other nodes).