PyNodes: get active node tree from context in Blender 2.72 I'm working on a custom nodetree-based addon for scientific analysis. My code requires knowledge of the active nodetree in the current context (or alternatively the parent nodetree of a selected node) which I haven't been able to obtain yet.

I noticed the addition of a "get_from_context" NodeTree class method in the 2.72 API changelog (http://www.blender.org/documentation/blender_python_api_2_72_release/bpy.types.NodeTree.html#bpy.types.NodeTree.get_from_context) which would be perfect. However when I try to call it from either bpy.types.NodeTree or an existing NodeTree object I get an attribute not found error.

What is the correct way to call this method from the NodeTree class directly? Or does anyone else have this issue? I'm quite new to Blender python dev so it could be a stupid mistake.

Alternatively, does anyone know of a way to obtain a node's parent nodetree?
To get the parent of any node:

node.parent


To get the node, you can get it from the context active_node, if you can access the Nodes context, or, from the global context, get the scene and then the node from the correct node tree.

The function get_from_context you mention is a part of the NodeTree class. You would have to show your code for me to know what is the problem.