blendersynth.blender.nodes.node_group

Custom node groups

class blendersynth.blender.nodes.node_group.CompositorNodeGroup(name, node_tree)[source]

Node Group for use in the compositor

class blendersynth.blender.nodes.node_group.NodeGroup(name, node_tree)[source]

Generic Node Group

__init__(name, node_tree)[source]

A generic NodeGroup class

Parameters:
  • name (str) – Name of node group

  • node_tree (NodeTree) – NodeTree to add group to

add_node(key)[source]

Create a new node in the group by name

Return type:

Node

add_socket(socket_type, name, in_out)[source]

Create a new socket, compatible with Blender <4

Parameters:
  • socket_type (str) – Type of socket

  • name (str) – Name of socket

  • in_out (str) – INPUT or OUTPUT

input(name)[source]

Get input socket by name

Return type:

NodeSocket

property inputs: dict

Input sockets

Link two sockets in the group

Parameters:
  • from_socket (NodeSocket) – Socket to link from

  • to_socket (NodeSocket) – Socket to link to

Return type:

NodeLink

output(name)[source]

Get output socket by name

Return type:

NodeSocket

property outputs: dict

Output sockets

save_image(loc, image_data)[source]

Save an image to a location. Will also reload any node reference to the image.

Parameters:

loc (str) – Location to save image to

class blendersynth.blender.nodes.node_group.ShaderNodeGroup(name, node_tree)[source]

Node Group for use in the shader editor

blendersynth.blender.nodes.node_group.tree_add_socket(tree, socket_type, name, in_out)[source]

Create a new socket, compatible with Blender <4

Parameters:
  • tree (NodeTree) – NodeTree to add socket to

  • socket_type (str) – Type of socket

  • name (str) – Name of socket

  • in_out (str) – INPUT or OUTPUT