NodeSocket(bpy_struct)

base class — bpy_struct

subclasses — NodeSocketStandard

class bpy.types.NodeSocket(bpy_struct)

Input or output socket of a node

bl_idname

(default “”, never None)

Type:

str

bl_label

Label to display for the socket type in the UI (default “”, never None)

Type:

str

bl_subtype_label

Label to display for the socket subtype in the UI (default “”, never None)

Type:

str

description

Socket tooltip (default “”, never None)

Type:

str

display_shape

Socket shape (default 'CIRCLE')

Type:

Literal[‘CIRCLE’, ‘SQUARE’, ‘DIAMOND’, ‘CIRCLE_DOT’, ‘SQUARE_DOT’, ‘DIAMOND_DOT’, ‘LINE’, ‘VOLUME_GRID’, ‘LIST’]

enabled

Enable the socket (default True)

Type:

bool

hide

Hide the socket (default False)

Type:

bool

hide_value

Hide the socket input value (default False)

Type:

bool

identifier

Unique identifier for mapping sockets (default “”, readonly, never None)

Type:

str

inferred_structure_type

Best known structure type of the socket. This may not match the socket shape, e.g. for unlinked input sockets (default 'AUTO', readonly)

Type:

Literal[Node Socket Structure Type Items]

is_icon_visible

Socket is drawn as interactive icon in the node editor (default False, readonly)

Type:

bool

is_inactive

Socket is grayed out because it has been detected to not have any effect on the output (default False, readonly)

Type:

bool

is_linked

True if the socket is connected (default False, readonly)

Type:

bool

is_multi_input

True if the socket can accept multiple ordered input links (default False, readonly)

Type:

bool

is_output

True if the socket is an output, otherwise input (default False, readonly)

Type:

bool

is_unavailable

True if the socket is unavailable (default False, readonly)

Type:

bool

label

Custom dynamic defined UI label for the socket. Can be translated if translation is enabled in the preferences (default “”, readonly, never None)

Type:

str

Max number of links allowed for this socket (in [1, 4095], default 0)

Type:

int

name

Socket name (default “”, never None)

Type:

str

node

Node owning this socket (readonly)

Type:

Node

pin_gizmo

Keep gizmo visible even when the node is not selected (default False)

Type:

bool

select

True if the socket is selected (default False, readonly)

Type:

bool

show_expanded

Socket links are expanded in the user interface (default True)

Type:

bool

type

Data type (default 'VALUE')

Type:

Literal[Node Socket Type Items]

List of node links from or to this socket.

Type:

NodeLinks

Note

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

(readonly)

bl_system_properties_get(*, do_create=False)

DEBUG ONLY. Internal access to runtime-defined RNA data storage, intended solely for testing and debugging purposes. Do not access it in regular scripting work, and in particular, do not assume that it contains writable data

Parameters:

do_create (bool) – Ensure that system properties are created if they do not exist yet (optional)

Returns:

The system properties root container, or None if there are no system properties stored in this data yet, and its creation was not requested

Return type:

PropertyGroup

draw(context, layout, node, text)

Draw socket

Parameters:
  • context (Context) – (never None)

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

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

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

draw_color(context, node)

Color of the socket icon

Parameters:
  • context (Context) – (never None)

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

Returns:

Color, (array of 4 items, in [0, 1])

Return type:

bpy_prop_array[float]

classmethod draw_color_simple()

Color of the socket icon. Used to draw sockets in places where the socket does not belong to a node, like the node interface panel. Also used to draw node sockets if draw_color is not defined.

Returns:

Color, (array of 4 items, in [0, 1])

Return type:

bpy_prop_array[float]

classmethod bl_rna_get_subclass(id, default=None, /)
Parameters:
  • id (str) – The RNA type identifier.

  • default (bpy.types.Struct | None) – The value to return when not found.

Returns:

The RNA type or default when not found.

Return type:

bpy.types.Struct

classmethod bl_rna_get_subclass_py(id, default=None, /)
Parameters:
  • id (str) – The RNA type identifier.

  • default (type | None) – The value to return when not found.

Returns:

The class or default when not found.

Return type:

type

Inherited Properties

Inherited Functions

References