NodeSocket(bpy_struct)

base class — bpy_struct

subclasses — NodeSocketStandard

class bpy.types.NodeSocket.NodeSocket(bpy_struct)

Input or output socket of a node

bl_idname
Type

string, default “”, (never None)

display_shape

Socket shape

Type

enum in [‘CIRCLE’, ‘SQUARE’, ‘DIAMOND’, ‘CIRCLE_DOT’, ‘SQUARE_DOT’, ‘DIAMOND_DOT’], default ‘CIRCLE’

enabled

Enable the socket

Type

boolean, default False

hide

Hide the socket

Type

boolean, default False

hide_value

Hide the socket input value

Type

boolean, default False

identifier

Unique identifier for mapping sockets

Type

string, default “”, (readonly, never None)

is_linked

True if the socket is connected

Type

boolean, default False, (readonly)

is_output

True if the socket is an output, otherwise input

Type

boolean, default False, (readonly)

label

Custom dynamic defined socket label

Type

string, default “”, (readonly, never None)

link_limit

Max number of links allowed for this socket

Type

int in [1, 4095], default 0

name

Socket name

Type

string, default “”, (never None)

node

Node owning this socket

Type

Node, (readonly)

show_expanded

Socket links are expanded in the user interface

Type

boolean, default False

type

Data type

Type

enum in [‘CUSTOM’, ‘VALUE’, ‘INT’, ‘BOOLEAN’, ‘VECTOR’, ‘STRING’, ‘RGBA’, ‘SHADER’, ‘OBJECT’, ‘IMAGE’, ‘EMITTERS’, ‘EVENTS’, ‘FORCES’, ‘CONTROL_FLOW’], default ‘VALUE’

links

List of node links from or to this socket.

Note

Takes O(len(nodetree.links)) time.

(readonly)

draw(context, layout, node, text)

Draw socket

Parameters
  • layout (UILayout, (never None)) – Layout, Layout in the UI

  • node (Node, (never None)) – Node, Node the socket belongs to

  • text (string, (never None)) – Text, Text label to draw alongside properties

draw_color(context, node)

Color of the socket icon

Parameters

node (Node, (never None)) – Node, Node the socket belongs to

Returns

Color

Return type

float array of 4 items in [0, 1]

classmethod bl_rna_get_subclass(id, default=None)
Parameters

id (string) – The RNA type identifier.

Returns

The RNA type or default when not found.

Return type

bpy.types.Struct subclass

classmethod bl_rna_get_subclass_py(id, default=None)
Parameters

id (string) – The RNA type identifier.

Returns

The class or default when not found.

Return type

type

Inherited Properties

  • bpy_struct.id_data

Inherited Functions

  • bpy_struct.as_pointer

  • bpy_struct.driver_add

  • bpy_struct.driver_remove

  • bpy_struct.get

  • bpy_struct.is_property_hidden

  • bpy_struct.is_property_overridable_library

  • bpy_struct.is_property_readonly

  • bpy_struct.is_property_set

  • bpy_struct.items

  • bpy_struct.keyframe_delete

  • bpy_struct.keyframe_insert

  • bpy_struct.keys

  • bpy_struct.path_from_id

  • bpy_struct.path_resolve

  • bpy_struct.pop

  • bpy_struct.property_overridable_library_set

  • bpy_struct.property_unset

  • bpy_struct.type_recast

  • bpy_struct.values

References

  • CompositorNodeOutputFileFileSlots.new

  • CompositorNodeOutputFileFileSlots.remove

  • CompositorNodeOutputFileLayerSlots.new

  • CompositorNodeOutputFileLayerSlots.remove

  • Node.inputs

  • Node.outputs

  • NodeInputs.new

  • NodeInputs.remove

  • NodeLink.from_socket

  • NodeLink.to_socket

  • NodeLinks.new

  • NodeLinks.new

  • NodeOutputs.new

  • NodeOutputs.remove

  • NodeSocketInterface.from_socket

  • NodeSocketInterface.init_socket

  • UILayout.template_node_link

  • UILayout.template_node_view