Get the latest Blender, older versions, or experimental builds.
Stay up-to-date with the new features in the latest Blender releases.
Access production assets and knowledge from the open movies.
Documentation on the usage and features in Blender.
Latest development updates, by Blender developers.
Guidelines, release notes and development docs.
A platform to collect and share results of the Blender Benchmark.
The yearly event that brings the community together.
Support core development with a monthly contribution.
Perform a single donation with more payment options available.
import bpy
from collections import namedtuple
from . base import BaseTree
FunctionInput = namedtuple("FunctionInput",
["data_type", "name", "identifier"])
FunctionOutput = namedtuple("FunctionOutput",
class FunctionTree(bpy.types.NodeTree, BaseTree):
bl_idname = "FunctionTree"
bl_icon = "MOD_DATA_TRANSFER"
bl_label = "Function Nodes"
def iter_function_inputs(self):
node = self.get_input_node()
if node is None:
return
for socket in node.outputs[:-1]:
yield FunctionInput(
socket.data_type,
socket.name,
socket.identifier)
def iter_function_outputs(self):
node = self.get_output_node()
for socket in node.inputs[:-1]:
yield FunctionOutput(
def get_input_node(self):
for node in self.nodes:
if node.bl_idname == "fn_FunctionInputNode":
return node
return None
def get_output_node(self):
if node.bl_idname == "fn_FunctionOutputNode":
def iter_dependency_trees(self):
if node.bl_idname == "fn_CallNode":
if node.function_tree is not None:
yield node.function_tree