Skip to content

node_render_options

node_render_options

Classes

NodeRenderOptions(min_width=100.0, min_plug_rows=1, shared_row_gap_trim=12.0, title_color=(lambda: QtGui.QColor('#FF313131'))(), background_color=(lambda: QtGui.QColor('#E3212121'))(), outline_color=(lambda: QtGui.QColor('#7F000000'))(), selected_outline_color=(lambda: QtGui.QColor('#FFA637'))(), icon_rect=(lambda: QtCore.QRect(8, 6, 16, 16))(), status_icon_rect=(lambda: QtCore.QRect(-7, -7, 14, 14))(), status_icons=(lambda: {NodeExecutionStatus.SUCCESS: ':/icons/green_check.png', NodeExecutionStatus.ERROR: ':/icons/red_error.png'})(), title_offset_x=28.0, subtitle_margin=8.0, edge_roundness=10.0, title_horizontal_padding=4.0, plugs_top_padding=4.0, lower_padding=8.0) dataclass

How the editor draws a node type.

Nodes return them from Node.get_render_options. A node type changes the look of its nodes by taking the default options from its parent class and tweaking them.

Attributes:

Name Type Description
min_width float

smallest width of the node

min_plug_rows int

the node is tall enough for this many plug rows, even with fewer

shared_row_gap_trim float

how much less gap there is between the labels of two plugs sharing a row

title_color QColor

color of the header

background_color QColor

color of the body

outline_color QColor

color of the outline

selected_outline_color QColor

color of the outline of a selected node

icon_rect QRect

where the type icon is drawn in the header

status_icon_rect QRect

where the status icon is drawn, relative to the top right corner of the node

status_icons dict[NodeExecutionStatus, str]

resource path of the icon of each execution status

title_offset_x float

distance of the title from the left side of the node

subtitle_margin float

space between the subtitle and the sides of the node

edge_roundness float

radius of the corners

title_horizontal_padding float

space after the title

plugs_top_padding float

space between the header and the first plug row

lower_padding float

space between the last plug row and the bottom of the node

Attributes
background_color = dataclasses.field(default_factory=(lambda: QtGui.QColor('#E3212121'))) class-attribute instance-attribute
edge_roundness = 10.0 class-attribute instance-attribute
icon_rect = dataclasses.field(default_factory=(lambda: QtCore.QRect(8, 6, 16, 16))) class-attribute instance-attribute
lower_padding = 8.0 class-attribute instance-attribute
min_plug_rows = 1 class-attribute instance-attribute
min_width = 100.0 class-attribute instance-attribute
outline_color = dataclasses.field(default_factory=(lambda: QtGui.QColor('#7F000000'))) class-attribute instance-attribute
plugs_top_padding = 4.0 class-attribute instance-attribute
selected_outline_color = dataclasses.field(default_factory=(lambda: QtGui.QColor('#FFA637'))) class-attribute instance-attribute
shared_row_gap_trim = 12.0 class-attribute instance-attribute
status_icon_rect = dataclasses.field(default_factory=(lambda: QtCore.QRect(-7, -7, 14, 14))) class-attribute instance-attribute
status_icons = dataclasses.field(default_factory=(lambda: {NodeExecutionStatus.SUCCESS: ':/icons/green_check.png', NodeExecutionStatus.ERROR: ':/icons/red_error.png'})) class-attribute instance-attribute
subtitle_margin = 8.0 class-attribute instance-attribute
title_color = dataclasses.field(default_factory=(lambda: QtGui.QColor('#FF313131'))) class-attribute instance-attribute
title_horizontal_padding = 4.0 class-attribute instance-attribute
title_offset_x = 28.0 class-attribute instance-attribute
Functions