92#include "RNA_prototypes.hh"
105#include <fmt/format.h>
116#define NODE_ZONE_PADDING UI_UNIT_X
117#define ZONE_ZONE_PADDING 0.3f * UI_UNIT_X
118#define EXTRA_INFO_ROW_HEIGHT (20.0f * UI_SCALE_FAC)
172 if (row.tooltip_fn_free_arg) {
174 row.tooltip_fn_free_arg(row.tooltip_fn_arg);
214 if (
id ==
nullptr || ntree ==
nullptr) {
245 else if (
id == &ntree->
id) {
277 for (
bNode *parent =
b->parent; parent; parent = parent->parent) {
300 if (a_active && !b_active) {
303 if (b_active && !a_active) {
306 if (!b_select && (a_active || a_select)) {
309 if (!a_select && (b_active || b_select)) {
320 return a->ui_order < b->ui_order;
324 sort_nodes[
i]->ui_order =
i;
331 if (
nodes.is_empty()) {
335 return a->ui_order < b->ui_order;
343 if (
nodes.is_empty()) {
347 return a->ui_order > b->ui_order;
360 for (
const int i :
nodes.index_range()) {
362 std::string block_name =
"node_" + std::string(node.
name);
365 blocks[node.index()] = block;
401 return node.declaration() && node.declaration()->use_custom_socket_order;
435 if (node.is_muted()) {
444 draw_buttons(&layout, (
bContext *)&
C, &nodeptr);
460 if (socket_short_label.has_value()) {
461 return CTX_IFACE_(socket_translation_context, socket_short_label->c_str());
465 const char *translated_socket_label =
CTX_IFACE_(socket_translation_context,
466 socket_label.
c_str());
470 const int len_prefix = strlen(panel_label);
471 if (
STREQLEN(translated_socket_label, panel_label, len_prefix) &&
472 translated_socket_label[len_prefix] ==
' ')
474 return translated_socket_label + len_prefix + 1;
479 return translated_socket_label;
490 const char *panel_label)
509 params.draw_standard(layout);
516 const char *panel_label,
523 if ((!input_socket || !input_socket->is_visible()) &&
524 (!output_socket || !output_socket->is_visible()))
529 const int topy = locy;
534 const float multi_input_socket_offset = is_multi_input ?
535 std::max(input_socket->
runtime->total_inputs - 2,
539 locy -= multi_input_socket_offset * 0.5f;
551 if (node.is_muted()) {
570 tree_draw_ctx,
C, *row, *input_socket, ntree, node, nodeptr, sockptr, panel_label);
581 tree_draw_ctx,
C, *row, *output_socket, ntree, node, nodeptr, sockptr, panel_label);
599 else if (output_socket) {
608 locy = buty - multi_input_socket_offset * 0.5;
664 return std::visit([](
auto &&
item) {
return item.type; }, this->
item);
671 bool potentially_visible =
false;
674 const bNodeSocket &socket = node.socket_by_decl(*socket_decl);
675 potentially_visible |= socket.is_visible();
680 potentially_visible |= r_result[sub_panel_decl->index];
683 r_result[panel_decl.
index] = potentially_visible;
703 if (!potentially_visible_states[panel_decl.
index]) {
707 r_result[panel_decl.
index] =
true;
709 if (panel_state.is_collapsed()) {
716 node, *sub_panel_decl, potentially_visible_states, r_result);
728 node, *panel_decl, potentially_visible_states, r_result);
740 Array<bool> potentially_visible_states(r_visibility_states.
size(),
false);
751 bNodeSocket &socket = node.socket_by_decl(socket_decl);
752 if (!socket.is_visible()) {
756 if (!prev_socket_decl || !node.socket_by_decl(*prev_socket_decl).is_visible()) {
766 item.
input = &socket;
795 if (!panel_visibility[panel_decl.
index]) {
799 header_item.
decl = &panel_decl;
801 if (panel_input_decl) {
802 header_item.
input = &node.socket_by_decl(*panel_input_decl);
804 r_items.
append({header_item});
807 if (panel_state.is_collapsed()) {
813 if (item_decl == panel_input_decl) {
818 prev_socket_decl = socket_decl;
831 prev_socket_decl =
nullptr;
855 prev_socket_decl = socket_decl;
868 prev_socket_decl =
nullptr;
885 switch (first_item_type) {
907 switch (last_item_type) {
932 const Type prev_type = prev.type();
942 case Type::Separator:
946 case Type::PanelHeader:
948 case Type::PanelContentBegin:
950 case Type::PanelContentEnd:
959 case Type::Separator:
963 case Type::PanelHeader:
965 case Type::PanelContentBegin:
967 case Type::PanelContentEnd:
972 case Type::Separator: {
976 case Type::Separator:
980 case Type::PanelHeader:
982 case Type::PanelContentBegin:
984 case Type::PanelContentEnd:
989 case Type::PanelHeader: {
993 case Type::Separator:
997 case Type::PanelHeader:
999 case Type::PanelContentBegin:
1001 case Type::PanelContentEnd:
1006 case Type::PanelContentBegin: {
1007 switch (next_type) {
1010 case Type::Separator:
1014 case Type::PanelHeader:
1016 case Type::PanelContentBegin:
1018 case Type::PanelContentEnd:
1023 case Type::PanelContentEnd: {
1024 switch (next_type) {
1027 case Type::Separator:
1031 case Type::PanelHeader:
1033 case Type::PanelContentBegin:
1035 case Type::PanelContentEnd:
1047 const int node_left_x,
1061 bNodeSocket &socket = node.socket_by_decl(*socket_decl);
1075 const int node_left_x,
1079 if (panel_state.is_collapsed()) {
1110 for (
int item_i = items.
size() - 1; item_i >= 0; item_i--) {
1112 if (
const auto *panel_item = std::get_if<flat_item::PanelContentEnd>(&item.
item)) {
1113 final_panel = panel_item;
1143 for (
bNodeSocket *socket : node.input_sockets()) {
1146 for (
bNodeSocket *socket : node.output_sockets()) {
1158 for (
const int item_i : flat_items.
index_range()) {
1172 [&](
const auto &item) {
1173 using ItemT = std::decay_t<
decltype(item)>;
1174 if constexpr (std::is_same_v<ItemT, flat_item::Socket>) {
1178 const char *parent_label = panel_decl ? panel_decl->
name.c_str() :
"";
1190 else if constexpr (std::is_same_v<ItemT, flat_item::Layout>) {
1203 if (node.is_muted()) {
1215 else if constexpr (std::is_same_v<ItemT, flat_item::Separator>) {
1228 else if constexpr (std::is_same_v<ItemT, flat_item::PanelHeader>) {
1231 const float panel_header_height =
NODE_DYS;
1232 locy -= panel_header_height / 2;
1234 locy -= panel_header_height / 2;
1241 else if constexpr (std::is_same_v<ItemT, flat_item::PanelContentBegin>) {
1247 else if constexpr (std::is_same_v<ItemT, flat_item::PanelContentEnd>) {
1257 locy -= bottom_margin;
1276 bool add_output_space =
false;
1278 for (
bNodeSocket *socket : node.output_sockets()) {
1283 tree_draw_ctx,
C, ntree, node,
nullptr,
nullptr, socket, block, locx, locy))
1288 add_output_space =
true;
1292 if (add_output_space) {
1297 C, ntree, node, node.
typeinfo->draw_buttons, block, locy);
1299 bool add_input_space =
false;
1302 for (
bNodeSocket *socket : node.input_sockets()) {
1307 tree_draw_ctx,
C, ntree, node,
nullptr, socket,
nullptr, block, locx, locy))
1312 add_input_space =
true;
1317 if (add_input_space || add_button_space) {
1346 node.
runtime->draw_bounds.xmin = loc.x;
1348 node.
runtime->draw_bounds.ymax = loc.y;
1355 node.
runtime->draw_bounds.ymin,
1357 node.
runtime->draw_bounds.ymax);
1365 int totin = 0, totout = 0;
1371 for (
const bNodeSocket *socket : node.input_sockets()) {
1372 if (socket->is_visible()) {
1376 for (
const bNodeSocket *socket : node.output_sockets()) {
1377 if (socket->is_visible()) {
1382 const float dy =
NODE_DY * 0.5f;
1383 const float height = dy * std::max({totin, totout, 2}) +
BASIS_RAD * 2.0f;
1385 const float offset =
NODE_DY * -0.5f;
1387 node.
runtime->draw_bounds.xmin = loc.x;
1389 node.
runtime->draw_bounds.ymax = loc.y + height * 0.5f + offset;
1390 node.
runtime->draw_bounds.ymin = loc.y - height * 0.5f + offset;
1394 const float x = node.
runtime->draw_bounds.xmax;
1395 float y = loc.y + dy *
float(totout - 1) * 0.5f + offset;
1396 for (
bNodeSocket *socket : node.output_sockets()) {
1397 if (socket->is_visible()) {
1398 socket->runtime->location = {
x,
y};
1406 const float x = node.
runtime->draw_bounds.xmin;
1407 float y = loc.y + dy *
float(totin - 1) * 0.5f + offset;
1408 for (
bNodeSocket *socket : node.input_sockets()) {
1409 if (socket->is_visible()) {
1410 socket->runtime->location = {
x,
y};
1420 node.
runtime->draw_bounds.ymin,
1422 node.
runtime->draw_bounds.ymax);
1427 const int nclass = (node.
typeinfo->ui_class ==
nullptr) ? node.
typeinfo->nclass :
1480 for (
const bNodeLink &link : node.internal_links()) {
1490 const int socket_index_in_tree,
1500 location.x -
size.x / 2.0f,
1501 location.y -
size.y / 2.0f,
1515 ntree.ensure_topology_cache();
1516 const bNodeSocket &socket = *ntree.all_sockets()[index_in_tree];
1526 const int socket_type,
1527 float r_outline_color[4])
1542 r_outline_color[3] = 1.0f;
1554 if (sock.
typeinfo->draw_color_simple) {
1565 &
const_cast<ID &
>(ntree.
id), &RNA_NodeSocket, &
const_cast<bNodeSocket &
>(sock));
1577 ntree.ensure_topology_cache();
1578 const bNodeSocket &socket = *ntree.all_sockets()[index_in_tree];
1588 struct SocketTooltipData {
1594 data->ntree = &ntree;
1595 data->socket = &sock;
1600 SocketTooltipData *
data =
static_cast<SocketTooltipData *
>(argN);
1608#define NODE_SOCKET_OUTLINE U.pixelsize
1614 const rctf draw_rect = {
1633#define NODE_TREE_SCALE_SMALL 0.2f
1660 immUniform4f(
"color1", checker_dark, checker_dark, checker_dark, 1.0f);
1661 immUniform4f(
"color2", checker_light, checker_light, checker_light, 1.0f);
1672 float xscale = xrect /
float(preview->
x);
1673 float yscale = yrect /
float(preview->
y);
1677 rctf draw_rect = *prv;
1678 if (xscale < yscale) {
1679 float offset = 0.5f * (yrect -
float(preview->
y) * xscale);
1680 draw_rect.
ymin += offset;
1681 draw_rect.
ymax -= offset;
1685 float offset = 0.5f * (xrect -
float(preview->
x) * yscale);
1686 draw_rect.
xmin += offset;
1687 draw_rect.
xmax -= offset;
1708 float black[4] = {0.0f, 0.0f, 0.0f, 1.0f};
1710 const float outline_width = 1.0f;
1711 draw_rect.
xmin -= outline_width;
1712 draw_rect.
xmax += outline_width;
1713 draw_rect.
ymin -= outline_width;
1714 draw_rect.
ymax += outline_width;
1724 const char *opname = (
const char *)op_argv;
1740 const float shadow_width = 0.4f *
U.widget_unit;
1741 const float shadow_alpha = 0.2f * alpha;
1746 const float color[4] = {0.0f, 0.0f, 0.0f, 0.4f};
1760 const float color[4])
1771 const float shadow_width = 0.2f *
U.widget_unit;
1772 const float shadow_alpha = is_selected ? 0.4f : 0.2f;
1773 const float dim_collapsed = is_collapsed ? 0.2f : 0.0f;
1775 const float outline_width = is_selected ? 1.0f : 0.5f;
1776 float outline_color[4];
1787 const rctf rect_group_front = {
1788 rect.
xmin + offset_x * 4,
1789 rect.
xmax - offset_x * 4,
1790 rect.
ymin - (offset_y * 2) -
U.pixelsize,
1791 rect.
ymin - offset_y + (
U.pixelsize * 2),
1794 const rctf rect_group_front_shadow = {
1795 rect_group_front.
xmin + outline_width,
1796 rect_group_front.
xmax - outline_width,
1797 rect_group_front.
ymin + outline_width,
1798 rect_group_front.
ymax - outline_width,
1802 radius + outline_width,
1808 float fill_color_front[4], outline_color_front[4];
1810 mul_v3_fl(fill_color_front, 0.8f - dim_collapsed);
1812 copy_v4_v4(outline_color_front, outline_color);
1813 mul_v3_fl(outline_color_front, (is_selected ? 0.5f : 1.0f) - dim_collapsed);
1819 outline_color_front,
1826 const rctf rect_group_back = {
1827 rect.
xmin + offset_x * 2,
1828 rect.
xmax - offset_x * 2,
1829 rect.
ymin - offset_y -
U.pixelsize,
1830 rect.
ymin + (
U.pixelsize * 2),
1833 const rctf rect_group_back_shadow = {
1834 rect_group_back.
xmin + outline_width,
1835 rect_group_back.
xmax - outline_width,
1836 rect_group_back.
ymin + outline_width,
1837 rect_group_back.
ymax - outline_width,
1841 radius + outline_width,
1846 float fill_color_back[4], outline_color_back[4];
1848 mul_v3_fl(fill_color_back, 0.9f - dim_collapsed);
1850 copy_v4_v4(outline_color_back, outline_color);
1851 mul_v3_fl(outline_color_back, (is_selected ? 0.7f : 1.1f) - dim_collapsed);
1869 const float outline_thickness,
1870 const bool selected,
1886 socket_location.x - half_width,
1887 socket_location.x + half_width,
1888 socket_location.y - half_height,
1889 socket_location.y + half_height,
1893 &rect, socket_color, outline_color, outline_thickness, sock.
display_shape, aspect);
1896 block, sock.index_in_tree(), socket_location,
float2(2.0f * half_width, 2.0f * half_height));
1909 if (node.input_sockets().is_empty() && node.output_sockets().is_empty()) {
1914 const_cast<ID *
>(&ntree.
id), &RNA_Node,
const_cast<bNode *
>(&node));
1920 for (
const bNodeSocket *sock : node.input_sockets()) {
1921 if (!sock->is_icon_visible()) {
1924 const bool selected = (sock->flag &
SELECT);
1926 C, ntree, node, nodeptr, block, *sock, outline_thickness, selected, snode.
runtime->
aspect);
1930 for (
const bNodeSocket *sock : node.output_sockets()) {
1931 if (!sock->is_icon_visible()) {
1934 const bool selected = (sock->flag &
SELECT);
1936 C, ntree, node, nodeptr, block, *sock, outline_thickness, selected, snode.
runtime->
aspect);
1957 float panel_color[4];
1960 panel_color[3] *= 1.5f;
1961 const rctf &draw_bounds = node.
runtime->draw_bounds;
1966 for (
const int panel_i : node_decl.
panels.index_range()) {
1972 const rctf content_rect = {draw_bounds.
xmin,
1979 final_panel_decl = &panel_decl;
1982 if (final_panel_decl) {
1985 const rctf content_rect = {draw_bounds.
xmin,
1990 const int repeats = final_panel_decl->
depth() + 1;
1991 for ([[maybe_unused]]
const int i :
IndexRange(repeats)) {
2007 if (socket_decl->in_out ==
SOCK_OUT) {
2010 const bNodeSocket &socket = node.socket_by_decl(*socket_decl);
2011 if (!socket.is_inactive()) {
2028 const rctf &draw_bounds = node.
runtime->draw_bounds;
2031 for (
const int panel_i : node_decl.
panels.index_range()) {
2040 const bool panel_is_inactive = node.is_muted() || only_inactive_inputs;
2042 const rctf header_rect = {draw_bounds.
xmin,
2055 header_rect.
xmin + header_but_margin,
2057 std::max(
int(header_rect.
xmax - header_rect.
xmin - 2 * header_but_margin), 0),
2058 header_rect.
ymax - header_rect.
ymin,
2064 toggle_action_but, [&panel_state](
const uiBut &) {
return panel_state.is_collapsed(); });
2071 const int but_size =
U.widget_unit * 0.8f;
2077 panel_state.is_collapsed() ? ICON_RIGHTARROW : ICON_DOWNARROW_HLT,
2086 offsetx += but_size + but_padding;
2091 if (input_socket && !input_socket->is_logically_linked()) {
2093 &ntree.
id, &RNA_NodeSocket, input_socket);
2114 ntree.ensure_topology_cache();
2115 const bNodeSocket &socket = *ntree.all_sockets()[index_in_tree];
2120 if (panel_is_inactive) {
2144 if (panel_is_inactive) {
2152 int highest_priority = 0;
2155 const int priority = node_warning_type_severity(warning.type);
2156 if (priority > highest_priority) {
2157 highest_priority = priority;
2158 highest_priority_type = warning.type;
2161 return highest_priority_type;
2166 std::string complete_string;
2169 complete_string += warning.message;
2172 complete_string +=
'.';
2173 complete_string +=
'\n';
2177 complete_string += warnings.
last().message;
2179 return complete_string;
2182#define NODE_HEADER_ICON_SIZE (0.8f * U.widget_unit)
2188 const char *tooltip =
nullptr)
2231 if (node_log !=
nullptr) {
2260 std::string tooltip;
2263 tooltip +=
error.c_str();
2264 if (
i + 1 < errors.
size()) {
2290 if (tree_log ==
nullptr) {
2291 return std::nullopt;
2293 if (node.is_group_output()) {
2296 if (node.is_frame()) {
2298 std::chrono::nanoseconds run_time{0};
2299 bool found_node =
false;
2301 for (
const bNode *tnode : node.direct_children_in_frame()) {
2302 if (tnode->is_frame()) {
2304 tree_draw_ctx, snode, *tnode);
2305 if (sub_frame_run_time.has_value()) {
2306 run_time += *sub_frame_run_time;
2314 run_time += node_log->execution_time;
2321 return std::nullopt;
2324 return node_log->execution_time;
2326 return std::nullopt;
2351 bool has_any_execution_time =
false;
2353 for (
const bNode *current_node : node.direct_children_in_frame()) {
2358 frame_execution_time += *node_execution_time;
2359 has_any_execution_time =
true;
2363 if (!has_any_execution_time) {
2364 return std::nullopt;
2367 return frame_execution_time;
2376 if (node.is_frame()) {
2386 if (execution_time->count() == 0) {
2387 return std::nullopt;
2389 return *execution_time;
2392 return std::nullopt;
2404 return std::nullopt;
2413 tree_draw_ctx, snode, node);
2415 if (!exec_time.has_value()) {
2416 return std::string(
"");
2420 std::chrono::duration_cast<std::chrono::microseconds>(*exec_time).count();
2423 if (exec_time_us == 0) {
2424 return std::string(
"-");
2426 if (exec_time_us < 100) {
2427 return std::string(
"< 0.1 ms");
2432 if (exec_time_us < 1000) {
2435 else if (exec_time_us < 10000) {
2439 std::stringstream stream;
2440 stream << std::fixed << std::setprecision(precision) << (exec_time_us / 1000.0f);
2441 return stream.str() +
" ms";
2452 fmt::memory_buffer buf;
2453 fmt::format_to(fmt::appender(buf),
"{}",
TIP_(
"Accessed named attributes:"));
2454 fmt::format_to(fmt::appender(buf),
"\n");
2456 struct NameWithUsage {
2463 sorted_used_attribute.
append({item.key, item.value});
2465 std::sort(sorted_used_attribute.
begin(),
2466 sorted_used_attribute.
end(),
2467 [](
const NameWithUsage &a,
const NameWithUsage &
b) {
2468 return BLI_strcasecmp_natural(a.name.c_str(), b.name.c_str()) < 0;
2471 for (
const NameWithUsage &attribute : sorted_used_attribute) {
2474 fmt::format_to(fmt::appender(buf), fmt::runtime(
TIP_(
" \u2022 \"{}\": ")),
name);
2486 fmt::format_to(fmt::appender(buf),
"{}", usages[
i]);
2487 if (
i < usages.
size() - 1) {
2488 fmt::format_to(fmt::appender(buf),
", ");
2491 fmt::format_to(fmt::appender(buf),
"\n");
2493 fmt::format_to(fmt::appender(buf),
"\n");
2496 fmt::runtime(
TIP_(
"Attributes with these names used within the group may conflict with "
2497 "existing attributes")));
2498 return fmt::to_string(buf);
2504 const int attributes_num = usage_by_attribute_name.
size();
2507 row.
text = std::to_string(attributes_num) +
2508 (attributes_num == 1 ?
RPT_(
" Named Attribute") :
RPT_(
" Named Attributes"));
2509 row.
icon = ICON_SPREADSHEET;
2523 if (geo_tree_log ==
nullptr) {
2524 return std::nullopt;
2532 for (
const bNodeSocket *socket : node.input_sockets()) {
2533 if (
STREQ(socket->name,
"Name")) {
2534 if (!socket->is_directly_linked()) {
2535 return std::nullopt;
2542 if (node_log ==
nullptr) {
2543 return std::nullopt;
2546 return std::nullopt;
2556 if (row.
text.empty()) {
2557 return std::nullopt;
2560 "The execution time from the node tree's latest evaluation. For frame and group "
2561 "nodes, the time for all sub-nodes");
2562 row.
icon = ICON_PREVIEW_RANGE;
2573 tree_draw_ctx, snode, node);
2574 if (row.has_value()) {
2575 rows.
append(std::move(*row));
2587 if (node.
typeinfo->get_extra_info) {
2592 if (node.
typeinfo->deprecation_notice) {
2595 row.
icon = ICON_INFO;
2597 rows.
append(std::move(row));
2614 rows.
append(std::move(*row));
2630 tree_draw_ctx, snode, node);
2631 if (row.has_value()) {
2632 rows.
append(std::move(*row));
2641 if (node_log !=
nullptr) {
2645 row.
icon = ICON_INFO;
2646 rows.
append(std::move(row));
2662 const float but_icon_right = but_icon_left + but_icon_width;
2674 extra_info_row.
icon,
2691 const float but_text_left = but_icon_right + 6.0f *
UI_SCALE_FAC;
2692 const float but_text_right = rect.
xmax;
2693 const float but_text_width = but_text_right - but_text_left;
2698 extra_info_row.
text.c_str(),
2701 short(but_text_width),
2716 if (node.is_muted()) {
2726 rctf panel_back_rect = extra_info_rect;
2729 if (node.is_muted()) {
2740 const float outline_width =
U.pixelsize;
2741 BLI_rctf_pad(&panel_back_rect, outline_width, outline_width);
2745 &panel_back_rect,
color,
nullptr, 0.0f, color_outline, outline_width,
BASIS_RAD);
2759 if (preview && !(preview->
x > 0 && preview->
y > 0)) {
2765 if (extra_info_rows.
is_empty() && !preview) {
2770 rctf extra_info_rect;
2772 if (node.is_frame()) {
2786 float preview_height = 0.0f;
2790 if (preview->
x > preview->
y) {
2791 preview_height = (width - 2.0f *
padding) *
float(preview->
y) /
float(preview->
x) +
2797 extra_info_rect.
ymax += preview_height;
2800 preview_height = width;
2801 const float preview_width = (width - 2.0f *
padding) *
float(preview->
x) /
2806 preview_rect.
xmin = extra_info_rect.
xmin +
padding + (width - preview_width) / 2;
2807 preview_rect.
xmax = extra_info_rect.
xmax -
padding - (width - preview_width) / 2;
2808 extra_info_rect.
ymax += preview_height;
2819 extra_info_rect.
ymin += preview_height;
2829 BLI_assert(node.is_type(
"CompositorNodeViewer") || node.is_type(
"GeometryNodeViewer"));
2835 return ICON_EVENT_ONEKEY;
2837 return ICON_EVENT_TWOKEY;
2839 return ICON_EVENT_THREEKEY;
2841 return ICON_EVENT_FOURKEY;
2843 return ICON_EVENT_FIVEKEY;
2845 return ICON_EVENT_SIXKEY;
2847 return ICON_EVENT_SEVENKEY;
2849 return ICON_EVENT_EIGHTKEY;
2851 return ICON_EVENT_NINEKEY;
2865 const char *disabled_hint =
nullptr;
2870 if (node.is_group()) {
2871 const ID *group_tree = node.
id;
2872 if (group_tree ==
nullptr) {
2906 color_header.
a = 1.0f;
2911 if (node.is_muted()) {
2918 return color_header;
2926 const bNode &node = *
static_cast<const bNode *
>(argN);
2927 const std::string description = node.
typeinfo->ui_description_fn ?
2930 if (!description.empty()) {
2936 fmt::format(
"Python: {}", node.
idname),
2940 !description.empty());
2943 &
const_cast<bNode &
>(node),
2964 rctf rect_with_preview = node.
runtime->draw_bounds;
2970 tree_draw_ctx.
bmain,
2972 tree_draw_ctx.
scene,
2992 bool drawn_with_previews =
false;
3000 if (previews_shader) {
3004 drawn_with_previews =
true;
3006 else if (previews_compo) {
3009 C, tree_draw_ctx, snode, node, preview_compositor->ibuf, block);
3010 drawn_with_previews =
true;
3015 if (drawn_with_previews ==
false) {
3022 const float outline_width =
U.pixelsize;
3040 float iconofs = rct.
xmax - 0.35f *
U.widget_unit;
3043 iconofs -= iconbutw;
3069 iconofs -= iconbutw;
3074 is_active ? ICON_HIDE_OFF : ICON_HIDE_ON,
3086 (
void *)
"NODE_OT_preview_toggle");
3090 node.
typeinfo->ui_icon != ICON_NONE)
3092 iconofs -= iconbutw;
3110 iconofs -= iconbutw;
3115 is_active ? ICON_RESTRICT_VIEW_OFF : ICON_RESTRICT_VIEW_ON,
3125 const char *operator_idname = is_active ?
"NODE_OT_deactivate_viewer" :
3126 "NODE_OT_activate_viewer";
3135 iconofs - 1.2 * iconbutw,
3146 if (node.is_type(
"CompositorNodeViewer")) {
3148 iconofs -= iconbutw;
3154 is_active ? ICON_RESTRICT_VIEW_OFF : ICON_RESTRICT_VIEW_ON,
3167 (
void *)
"NODE_OT_activate_viewer");
3173 iconofs - 1.2 * iconbutw,
3196 const int but_size =
U.widget_unit * 0.8f;
3215 (
void *)
"NODE_OT_hide_toggle");
3235 if (node.is_muted()) {
3240 if (node.is_muted()) {
3264 if (node.is_muted()) {
3265 float color_background[4];
3294 const rctf rect_node = {
3295 rct.
xmin - outline_width,
3296 rct.
xmax + outline_width,
3297 rct.
ymin - outline_width,
3298 rct.
ymax + outline_width,
3300 float color_outline[4] = {0.0f, 0.0f, 0.0f, 1.0f};
3309 color_outline[3] = 1.0f;
3328 tree_draw_ctx.
bmain,
3330 tree_draw_ctx.
scene,
3359 if (node.is_muted()) {
3394 const int but_size =
U.widget_unit * 1.0f;
3402 centy - but_size / 2,
3413 (
void *)
"NODE_OT_hide_toggle");
3435 const float outline_width =
U.pixelsize;
3437 rct.
xmin - outline_width,
3438 rct.
xmax + outline_width,
3439 rct.
ymin - outline_width,
3440 rct.
ymax + outline_width,
3444 float color_outline[4];
3452 else if (node.is_muted()) {
3464 if (node.is_muted()) {
3475 float dx = 0.5f *
U.widget_unit;
3477 const float dy = 0.2f *
U.widget_unit;
3504 tree_draw_ctx.
bmain,
3506 tree_draw_ctx.
scene,
3515 if (directions == 0) {
3540 if (ntree ==
nullptr) {
3570 for (
bNode *node : ntree.all_nodes()) {
3571 for (
bNodeSocket *socket : node->input_sockets()) {
3572 if (socket->is_multi_input()) {
3573 socket->runtime->total_inputs = socket->directly_linked_links().size();
3610 frame_layout.
margin = 1.5f *
U.widget_unit;
3615 float room_for_label = 1.5f * frame_layout.
label_height + 0.2f * frame_layout.
margin;
3633 return frame_layout;
3647 if (!node.is_frame()) {
3650 float zone_padding = 0;
3651 float extra_row_padding = 0;
3666 node_bounds.
ymax += std::max(zone_padding, extra_row_padding);
3667 node_bounds.
ymin -= zone_padding;
3685 for (
bNode *child : node.direct_children_in_frame()) {
3713 node.
runtime->draw_bounds = rect;
3722 node.input_socket(0).
runtime->location = loc;
3723 node.output_socket(0).
runtime->location = loc;
3726 node.
width = radius * 2;
3727 node.
runtime->draw_bounds.xmin = loc.x - radius;
3728 node.
runtime->draw_bounds.xmax = loc.x + radius;
3729 node.
runtime->draw_bounds.ymax = loc.y + radius;
3730 node.
runtime->draw_bounds.ymin = loc.y - radius;
3744 for (
const int i :
nodes.index_range()) {
3746 uiBlock &block = *blocks[node.index()];
3747 if (node.is_frame()) {
3752 if (node.is_reroute()) {
3766 for (
bNode *frame : ntree.root_frames()) {
3817 const int y_min = rct.
ymin + frame_layout.
margin;
3825 if (line->line[0]) {
3828 BLF_draw(fontid, line->line, line->len, &info);
3829 y -= line_spacing * info.
lines;
3856 const float alpha =
color[3];
3869 if (depth % 2 == 0) {
3893 bool draw_outline =
false;
3896 draw_outline =
true;
3900 draw_outline =
true;
3924 tree_draw_ctx.
bmain,
3926 tree_draw_ctx.
scene,
3939 tree_draw_ctx.
bmain,
3941 tree_draw_ctx.
scene,
3951 const std::optional<ed::space_node::ObjectAndModifier> object_and_modifier =
3953 if (!object_and_modifier) {
3956 snode.
edittree->ensure_topology_cache();
3959 snode, compute_context_cache);
3960 if (!current_compute_context) {
3968 compute_context_cache,
3969 [&](
const Object &gizmo_object,
3972 const bNode &gizmo_node,
3974 if (&gizmo_object != object_and_modifier->object) {
3977 if (&gizmo_nmd != object_and_modifier->nmd) {
3987 if (compute_context.
hash() == current_compute_context->
hash()) {
3988 sockets_on_gizmo_paths.
add(&socket);
3993 return sockets_on_gizmo_paths;
4003 const bNodeSocket *input_socket = reroute.input_sockets().first();
4004 if (input_socket->directly_linked_links().is_empty()) {
4007 const bNodeLink *input_link = input_socket->directly_linked_links().first();
4009 return from_node->is_reroute() ? from_node :
nullptr;
4017 const bNode &src_reroute)
4021 if (src_reroute.
label[0] !=
'\0') {
4022 return src_reroute.
label;
4031 for (
const bNode *reroute = &src_reroute; reroute;
4034 reroute_path.
append(reroute);
4039 if (reroute->label[0] !=
'\0') {
4040 label = reroute->label;
4044 reroute_auto_labels.
add(reroute,
"");
4048 for (
const bNode *reroute : reroute_path) {
4060 const bool selected)
4067 const_cast<ID *
>(&ntree.
id), &RNA_Node,
const_cast<bNode *
>(&node));
4094 const bool has_label = node.
label[0] !=
'\0';
4098 if (!has_label && !use_auto_label) {
4108 if (
text.is_empty()) {
4112 const short width = 512;
4114 const int y = node.
runtime->draw_bounds.ymax;
4117 &block,
ButType::Label, 0,
text,
x,
y, width,
NODE_DY,
nullptr, 0, 0, std::nullopt);
4142 tree_draw_ctx.
bmain,
4144 tree_draw_ctx.
scene,
4160 tree_draw_ctx.
bmain,
4162 tree_draw_ctx.
scene,
4178 if (node.is_frame()) {
4182 else if (node.is_reroute()) {
4213 if (!
bounds.is_empty()) {
4221 for (
const float2 &
pos : child_bounds) {
4228 const bNode *child_node = snode.
edittree->node_by_id(child_node_id);
4238 const rctf &draw_bounds = input_node->runtime->draw_bounds;
4239 rctf rect = draw_bounds;
4245 const rctf &draw_bounds = output_node->runtime->draw_bounds;
4246 rctf rect = draw_bounds;
4270 convex_indices.
resize(convex_positions_num);
4272 for (
const int i : convex_indices) {
4273 bounds.append(possible_bounds[
i]);
4284 zones = ntree.
runtime->last_valid_zones.get();
4286 const int zones_num = zones ? zones->
zones.size() : 0;
4293 for (
const int zone_i :
IndexRange(zones_num)) {
4297 const Span<float2> boundary_positions = bounds_by_zone[zone_i];
4298 const int boundary_positions_num = boundary_positions.
size();
4299 if (boundary_positions_num < 3) {
4305 const float bounding_box_width = bounding_box.
max.x - bounding_box.
min.x;
4306 bounding_box_width_by_zone[zone_i] = bounding_box_width;
4314 boundary_curve_positions[
i] =
float3(boundary_positions[
i], 0.0f);
4329 float line_width = 1.0f * scale;
4330 float viewport[4] = {};
4333 const auto get_theme_id = [&](
const int zone_i) {
4334 const bNode *node = zones->
zones[zone_i]->output_node();
4342 immVertexFormat(),
"pos", blender::gpu::VertAttrType::SFLOAT_32_32_32);
4344 using ZoneOrNode = std::variant<const bNodeTreeZone *, const bNode *>;
4346 for (
const int zone_i :
IndexRange(zones_num)) {
4349 for (
const bNode *node : ntree.all_nodes()) {
4354 auto get_zone_or_node_width = [&](
const ZoneOrNode &zone_or_node) {
4355 if (
const bNodeTreeZone *
const *zone_p = std::get_if<const bNodeTreeZone *>(&zone_or_node)) {
4357 return bounding_box_width_by_zone[zone.
index];
4359 if (
const bNode *
const *node_p = std::get_if<const bNode *>(&zone_or_node)) {
4360 const bNode &node = **node_p;
4366 std::sort(draw_order.
begin(), draw_order.
end(), [&](
const ZoneOrNode &a,
const ZoneOrNode &
b) {
4368 return get_zone_or_node_width(a) > get_zone_or_node_width(b);
4371 for (
const ZoneOrNode &zone_or_node : draw_order) {
4372 if (
const bNodeTreeZone *
const *zone_p = std::get_if<const bNodeTreeZone *>(&zone_or_node)) {
4374 const int zone_i = zone.
index;
4375 float zone_color[4];
4377 if (zone_color[3] == 0.0f) {
4380 if (!fillet_curve_by_zone[zone_i].has_value()) {
4384 const Span<float3> fillet_boundary_positions = fillet_curve_by_zone[zone_i]->positions();
4390 for (
const float3 &p : fillet_boundary_positions) {
4398 if (
const bNode *
const *node_p = std::get_if<const bNode *>(&zone_or_node)) {
4399 const bNode &node = **node_p;
4407 for (
const ZoneOrNode &zone_or_node : draw_order) {
4408 if (
const bNodeTreeZone *
const *zone_p = std::get_if<const bNodeTreeZone *>(&zone_or_node)) {
4410 const int zone_i = zone.
index;
4411 if (!fillet_curve_by_zone[zone_i].has_value()) {
4415 const Span<float3> fillet_boundary_positions = fillet_curve_by_zone[zone_i]->positions();
4425 get_theme_id(zone_i);
4429 for (
const float3 &p : fillet_boundary_positions) {
4437 if (
const bNode *
const *node_p = std::get_if<const bNode *>(&zone_or_node)) {
4438 const bNode &node = **node_p;
4453 for (
const bNode *node : ntree.nodes_by_type(
"NodeFrame")) {
4466 const float region_padding)
4475 BLI_rctf_pad(&inner_rect, -(region_padding + radius), -(region_padding + radius));
4487 std::array<float2, NODE_LINK_RESOL + 1> link_points;
4490 const float required_socket_distance =
UI_UNIT_X;
4493 const auto cost_function = [&](
const float2 &p) ->
float {
4494 const float distance_to_inner_rect = std::max(
BLI_rctf_length_x(&inner_rect, p.x),
4502 if (distance_to_socket < required_socket_distance) {
4503 return 1e5f + distance_to_center;
4508 std::sqrt(distance_to_center)
4512 + 10.0f * distance_to_inner_rect;
4520 std::optional<float2> best_position;
4521 for (
const int i :
IndexRange(link_points.size() - 1)) {
4523 float2 p1 = link_points[
i + 1];
4528 const float point_distance = 1.0f;
4531 const int points_to_check = std::max(2, 1 +
int(
length / point_distance));
4532 for (
const int j :
IndexRange(points_to_check)) {
4533 const float t =
float(j) / (points_to_check - 1);
4535 const float cost = cost_function(p);
4536 if (!best_position.has_value() || cost < best_cost) {
4542 return best_position;
4561 std::string error_tooltip;
4562 if (errors.
size() == 1) {
4563 error_tooltip = errors[0].tooltip;
4567 error_tooltip += fmt::format(
"\u2022 {}\n",
error.tooltip);
4571 const float bg_radius =
UI_UNIT_X * 0.5f;
4572 const float bg_corner_radius =
UI_UNIT_X * 0.2f;
4574 const float region_padding =
UI_UNIT_X * 0.5f;
4578 region.
v2d, link, bg_radius, region_padding);
4579 if (!draw_position_opt.has_value()) {
4582 const int2 draw_position =
int2(draw_position_opt.value());
4599 draw_position.x - icon_size / 2,
4600 draw_position.y - icon_size / 2,
4608 but, [tooltip = std::move(error_tooltip)](
const uiBut * ) {
return tooltip; });
4619#define USE_DRAW_TOT_UPDATE
4630#ifdef USE_DRAW_TOT_UPDATE
4634 for (
const int i :
nodes.index_range()) {
4635#ifdef USE_DRAW_TOT_UPDATE
4646 for (
const bNodeLink *link : ntree.all_links()) {
4653 for (
const bNodeLink *link : ntree.all_links()) {
4666 for (
const int i :
nodes.index_range()) {
4674 node_draw(
C, tree_draw_ctx, region, snode, ntree, node, *blocks[node.index()], key);
4678 for (
auto &&item : ntree.
runtime->link_errors.items()) {
4679 if (
const bNodeLink *link = item.key.try_find(ntree)) {
4699 const int x = rect->
xmin + padding_x;
4734 for (
const bNode *index_switch_node : ntree.nodes_by_type(
"GeometryNodeIndexSwitch")) {
4735 const bNodeSocket &index_socket = index_switch_node->input_socket(0);
4737 snode, compute_context_cache, index_socket);
4738 if (!compute_context) {
4742 {compute_context, &index_socket}, compute_context_cache);
4746 result.add(index_switch_node, menu_switch->node);
4757 ntree.ensure_topology_cache();
4779 log.ensure_node_warnings(*tree_draw_ctx.
bmain);
4780 log.ensure_execution_times();
4789 C, *snode, compute_context_cache);
4794 &scene->
runtime->compositor.per_node_execution_time;
4805 std::lock_guard
lock(ntree.
runtime->shader_node_errors_mutex);
4812 for (
const int i :
nodes.index_range()) {
4815 C, tree_draw_ctx, *snode, node);
4828 const int max_tree_length = 3;
4829 const float bright_factor = 0.25f;
4836 const int depth =
max_ii(0, clamped_tree_path_length - 1);
4913 float original_proj[4][4];
4974 bool sidebar =
false;
void ED_draw_imbuf(ImBuf *ibuf, float x, float y, bool use_filter, const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings, float zoom_x, float zoom_y)
PointerRNA CTX_data_pointer_get(const bContext *C, const char *member)
WorkSpace * CTX_wm_workspace(const bContext *C)
SpaceNode * CTX_wm_space_node(const bContext *C)
ScrArea * CTX_wm_area(const bContext *C)
wmWindow * CTX_wm_window(const bContext *C)
Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
Main * CTX_data_main(const bContext *C)
ARegion * CTX_wm_region(const bContext *C)
Low-level operations for curves.
void id_us_ensure_real(ID *id)
void BKE_main_ensure_invariants(Main &bmain, std::optional< blender::Span< ID * > > modified_ids=std::nullopt)
#define NODE_CLASS_OUTPUT
#define NODE_CLASS_INTERFACE
#define NODE_CUSTOM_GROUP
#define NODE_CLASS_CONVERTER
#define NODE_CLASS_GEOMETRY
#define NODE_GROUP_OUTPUT
#define NODE_CLASS_DISTORT
#define NODE_CLASS_OP_VECTOR
#define NODE_CLASS_LAYOUT
#define NODE_CLASS_OP_COLOR
#define NODE_CLASS_OP_FILTER
#define NODE_CLASS_ATTRIBUTE
#define NODE_CLASS_TEXTURE
#define NODE_CLASS_SHADER
#define NODE_CLASS_SCRIPT
#define NODE_EVALUATE_CLOSURE
#define GEO_NODE_STORE_NAMED_ATTRIBUTE
#define GEO_NODE_REMOVE_ATTRIBUTE
#define GEO_NODE_FOREACH_GEOMETRY_ELEMENT_OUTPUT
#define GEO_NODE_INPUT_NAMED_ATTRIBUTE
#define GEO_NODE_SIMULATION_OUTPUT
#define CMP_NODE_OUTPUT_FILE
#define GEO_NODE_REPEAT_OUTPUT
General operations, lookup, etc. for blender objects.
bool BKE_scene_uses_shader_previews(const Scene *scene)
void BLF_size(int fontid, float size)
void BLF_enable(int fontid, FontFlags flag)
void BLF_aspect(int fontid, float x, float y, float z)
void BLF_color3ubv(int fontid, const unsigned char rgb[3])
void BLF_clipping(int fontid, int xmin, int ymin, int xmax, int ymax)
void BLF_draw(int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_NONNULL(2)
void BLF_wordwrap(int fontid, int wrap_width, BLFWrapMode mode=BLFWrapMode::Minimal)
float BLF_width(int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2)
void BLF_disable(int fontid, FontFlags flag)
int BLF_height_max(int fontid) ATTR_WARN_UNUSED_RESULT
void BLF_position(int fontid, float x, float y, float z)
#define BLI_assert_unreachable()
int BLI_convexhull_2d(blender::Span< blender::float2 > points, int r_points[])
#define LISTBASE_FOREACH(type, var, list)
int BLI_listbase_count_at_most(const ListBase *listbase, int count_max) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE int round_fl_to_int(float a)
MINLINE int min_ii(int a, int b)
MINLINE float min_ff(float a, float b)
MINLINE int max_ii(int a, int b)
MINLINE void rgba_float_args_set(float col[4], float r, float g, float b, float a)
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void mul_v3_fl(float r[3], float f)
#define BLI_SCOPED_DEFER(function_to_defer)
void BLI_rctf_union(struct rctf *rct_a, const struct rctf *rct_b)
BLI_INLINE float BLI_rcti_cent_x_fl(const struct rcti *rct)
bool BLI_rctf_isect_pt_v(const struct rctf *rect, const float xy[2])
BLI_INLINE float BLI_rctf_cent_y(const struct rctf *rct)
bool BLI_rctf_isect(const struct rctf *src1, const struct rctf *src2, struct rctf *dest)
BLI_INLINE float BLI_rctf_cent_x(const struct rctf *rct)
bool BLI_rctf_clamp_segment(const struct rctf *rect, float s1[2], float s2[2])
float BLI_rctf_length_x(const rctf *rect, float x)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
void BLI_rctf_pad(struct rctf *rect, float pad_x, float pad_y)
bool BLI_rctf_isect_pt(const struct rctf *rect, float x, float y)
BLI_INLINE float BLI_rcti_cent_y_fl(const struct rcti *rct)
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
void BLI_rctf_mul(struct rctf *rect, float factor)
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
void BLI_rctf_init_pt_radius(struct rctf *rect, const float xy[2], float size)
float BLI_rctf_length_y(const rctf *rect, float y)
void BLI_rctf_init_minmax(struct rctf *rect)
#define STRNCPY_UTF8(dst, src)
#define STREQLEN(a, b, n)
#define POINTER_FROM_INT(i)
#define POINTER_AS_INT(i)
#define CTX_IFACE_(context, msgid)
void DEG_id_tag_update(ID *id, unsigned int flags)
#define ID_IS_LINKED(_id)
#define ID_IS_EDITABLE(_id)
@ NODE_VIEWER_SHORCTUT_SLOT_9
@ NODE_VIEWER_SHORCTUT_SLOT_5
@ NODE_VIEWER_SHORCTUT_SLOT_4
@ NODE_VIEWER_SHORCTUT_SLOT_2
@ NODE_VIEWER_SHORCTUT_SLOT_7
@ NODE_VIEWER_SHORCTUT_SLOT_1
@ NODE_VIEWER_SHORCTUT_SLOT_3
@ NODE_VIEWER_SHORTCUT_NONE
@ NODE_VIEWER_SHORCTUT_SLOT_8
@ NODE_VIEWER_SHORCTUT_SLOT_6
@ SN_OVERLAY_SHOW_PREVIEWS
@ SN_OVERLAY_SHOW_REROUTE_AUTO_LABELS
@ SN_OVERLAY_SHOW_TIMINGS
@ SN_OVERLAY_SHOW_OVERLAYS
@ SN_OVERLAY_SHOW_NAMED_ATTRIBUTES
#define USER_EXPERIMENTAL_TEST(userdef, member)
#define NODE_GRID_STEP_SIZE
const rcti * ED_region_visible_rect(ARegion *region)
void ED_region_draw_cb_draw(const bContext *C, ARegion *region, int type)
#define REGION_DRAW_POST_VIEW
#define REGION_DRAW_PRE_VIEW
void GPU_clear_color(float red, float green, float blue, float alpha)
void GPU_framebuffer_bind_no_srgb(blender::gpu::FrameBuffer *fb)
void GPU_matrix_identity_set()
void GPU_matrix_push_projection()
void GPU_matrix_pop_projection()
#define GPU_matrix_projection_get(x)
#define GPU_matrix_projection_set(x)
@ GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR
@ GPU_SHADER_3D_UNIFORM_COLOR
void GPU_scissor_test(bool enable)
void GPU_line_width(float width)
void GPU_line_smooth(bool enable)
void GPU_blend(GPUBlend blend)
void GPU_depth_test(GPUDepthTest test)
void GPU_viewport_size_get_f(float coords[4])
blender::gpu::FrameBuffer * GPU_viewport_framebuffer_overlay_get(GPUViewport *viewport)
Read Guarded memory(de)allocation.
void UI_but_func_set(uiBut *but, std::function< void(bContext &)> func)
void UI_but_func_pushed_state_set(uiBut *but, std::function< bool(const uiBut &)> func)
#define UI_ALPHA_CHECKER_LIGHT
uiBut * uiDefButR(uiBlock *block, ButType type, int retval, std::optional< blender::StringRef > str, int x, int y, short width, short height, PointerRNA *ptr, blender::StringRefNull propname, int index, float min, float max, std::optional< blender::StringRef > tip)
void UI_draw_roundbox_4fv(const rctf *rect, bool filled, float rad, const float col[4])
void ui_draw_dropshadow(const rctf *rct, float radius, float width, float aspect, float alpha)
void UI_block_emboss_set(uiBlock *block, blender::ui::EmbossType emboss)
void UI_but_func_tooltip_custom_set(uiBut *but, uiButToolTipCustomFunc func, void *arg, uiFreeArgFunc free_arg)
uiBlock * UI_block_begin(const bContext *C, ARegion *region, std::string name, blender::ui::EmbossType emboss)
void UI_but_func_tooltip_set(uiBut *but, uiButToolTipFunc func, void *arg, uiFreeArgFunc free_arg)
uiBut * uiDefIconBut(uiBlock *block, uiButTypeWithPointerType but_and_ptr_type, int retval, int icon, int x, int y, short width, short height, void *poin, float min, float max, std::optional< blender::StringRef > tip)
void UI_draw_roundbox_4fv_ex(const rctf *rect, const float inner1[4], const float inner2[4], float shade_dir, const float outline[4], float outline_width, float rad)
void UI_tooltip_text_field_add(uiTooltipData &data, std::string text, std::string suffix, const uiTooltipStyle style, const uiTooltipColorID color_id, const bool is_pad=false)
#define UI_ALPHA_CHECKER_DARK
const uiStyle * UI_style_get_dpi()
void UI_but_drawflag_enable(uiBut *but, int flag)
void UI_draw_roundbox_corner_set(int type)
const uiStyle * UI_style_get()
PointerRNA * UI_but_operator_ptr_ensure(uiBut *but)
void UI_but_drawflag_disable(uiBut *but, int flag)
void UI_block_draw(const bContext *C, uiBlock *block)
void UI_but_operator_set(uiBut *but, wmOperatorType *optype, blender::wm::OpCallContext opcontext, const PointerRNA *opptr=nullptr)
void UI_block_flag_enable(uiBlock *block, int flag)
void UI_draw_roundbox_aa(const rctf *rect, bool filled, float rad, const float color[4])
void UI_block_end_ex(const bContext *C, Main *bmain, wmWindow *window, Scene *scene, ARegion *region, Depsgraph *depsgraph, uiBlock *block, const int xy[2]=nullptr, int r_xy[2]=nullptr)
void UI_block_end(const bContext *C, uiBlock *block)
void UI_but_func_quick_tooltip_set(uiBut *but, std::function< std::string(const uiBut *but)> func)
uiBut * uiDefBut(uiBlock *block, uiButTypeWithPointerType but_and_ptr_type, int retval, blender::StringRef str, int x, int y, short width, short height, void *poin, float min, float max, std::optional< blender::StringRef > tip)
void UI_but_flag_enable(uiBut *but, int flag)
void UI_block_bounds_set_explicit(uiBlock *block, int minx, int miny, int maxx, int maxy)
void UI_block_align_end(uiBlock *block)
void uiLayoutSetTooltipCustomFunc(uiLayout *layout, uiButToolTipCustomFunc func, void *arg, uiCopyArgFunc copy_arg, uiFreeArgFunc free_arg)
void UI_GetThemeColor3fv(int colorid, float col[3])
int UI_GetThemeValueType(int colorid, int spacetype)
void UI_GetThemeColorBlend4f(int colorid1, int colorid2, float fac, float r_col[4])
void UI_GetThemeColorBlendShade4fv(int colorid1, int colorid2, float fac, int offset, float col[4])
void UI_GetThemeColorType4fv(int colorid, int spacetype, float col[4])
void UI_GetThemeColorShadeAlpha4fv(int colorid, int coloffset, int alphaoffset, float col[4])
void UI_GetThemeColor4fv(int colorid, float col[4])
void UI_GetThemeColorShade4fv(int colorid, int offset, float col[4])
void UI_GetThemeColorBlendShade3ubv(int colorid1, int colorid2, float fac, int offset, unsigned char col[3])
void UI_GetColorPtrBlendAlpha4fv(const float cp1[4], const float cp2[4], float fac, float alphaoffset, float r_col[4])
void UI_view2d_scrollers_draw(View2D *v2d, const rcti *mask_custom)
void UI_view2d_view_restore(const bContext *C)
void UI_view2d_center_get(const View2D *v2d, float *r_x, float *r_y)
void UI_view2d_view_ortho(const View2D *v2d)
void UI_view2d_scale_get(const View2D *v2d, float *r_x, float *r_y)
void UI_view2d_region_to_view(const View2D *v2d, float x, float y, float *r_view_x, float *r_view_y) ATTR_NONNULL()
void UI_view2d_center_set(View2D *v2d, float x, float y)
void UI_view2d_dot_grid_draw(const View2D *v2d, int grid_color_id, float min_step, int grid_subdivisions)
@ WM_GIZMOMAP_DRAWSTEP_2D
void ED_annotation_draw_view2d(const bContext *C, bool onlyv2d)
unsigned long long int uint64_t
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
const Value * lookup_ptr(const Key &key) const
constexpr T & first() const
constexpr void copy_from(Span< T > values) const
IndexRange index_range() const
const ComputeContextHash & hash() const
const Value * lookup_ptr(const Key &key) const
bool add_overwrite(const Key &key, const Value &value)
bool add(const Key &key, const Value &value)
constexpr int64_t size() const
constexpr Span drop_back(int64_t n) const
constexpr int64_t size() const
constexpr const T & last(const int64_t n=0) const
constexpr IndexRange index_range() const
constexpr bool is_empty() const
constexpr bool startswith(StringRef prefix) const
constexpr const char * c_str() const
static VArray from_single(T value, const int64_t size)
IndexRange index_range() const
void append(const T &value)
const T & last(const int64_t n=0) const
IndexRange index_range() const
void resize(const int64_t new_size)
MutableSpan< float3 > positions_for_write()
void fill_curve_types(CurveType type)
MutableSpan< int > offsets_for_write()
MutableSpan< bool > cyclic_for_write()
bNodeSocket * input_socket
std::optional< float > header_center_y
std::optional< bNodePanelExtent > content_extent
Vector< int > child_node_ids
bNodeTreeZone * parent_zone
std::optional< int > output_node_id
const bNode * output_node() const
bool contains_node_recursively(const bNode &node) const
std::optional< int > input_node_id
Vector< bNodeTreeZone * > child_zones
const bNode * input_node() const
Vector< bNodeTreeZone * > zones
const bNodeTreeZone * get_zone_by_node(const int32_t node_id) const
std::function< DrawNodeLayoutFn > draw
Vector< PanelDeclaration * > panels
std::optional< std::string > translation_context
Vector< ItemDeclaration * > items
const SocketDeclaration * panel_input_decl() const
std::unique_ptr< CustomSocketDrawFn > custom_draw_fn
bool align_with_previous_socket
GeoTreeLog * get_main_tree_log(const bke::bNodeTreeZone *zone) const
void foreach_tree_log(FunctionRef< void(GeoTreeLog &)> callback) const
Map< StringRefNull, NamedAttributeUsage > used_named_attributes
VectorSet< NodeWarning > warnings
Vector< StringRefNull > debug_messages
static ContextualGeoTreeLogs get_contextual_tree_logs(const SpaceNode &snode)
void ensure_used_named_attributes()
std::chrono::nanoseconds execution_time
Map< int32_t, GeoNodeLog > nodes
void ensure_debug_messages()
float length(VecOp< float, D >) RET
void * MEM_callocN(size_t len, const char *str)
void * MEM_dupallocN(const void *vmemh)
void MEM_freeN(void *vmemh)
static void error(const char *str)
std::unique_ptr< IDProperty, IDPropertyDeleter > create_group(StringRef prop_name, eIDPropertyFlag flags={})
Allocate a new IDProperty of type IDP_GROUP.
const bNodeZoneType * zone_type_by_node_type(const int node_type)
std::string node_label(const bNodeTree &ntree, const bNode &node)
bool node_link_is_selected(const bNodeLink &link)
std::optional< StringRefNull > node_socket_short_label(const bNodeSocket &sock)
const char * node_socket_translation_context(const bNodeSocket &sock)
bNodeType NodeTypeUndefined
bNodeInstanceKey node_instance_key(bNodeInstanceKey parent_key, const bNodeTree *ntree, const bNode *node)
Span< int > all_zone_node_types()
const bNodeInstanceKey NODE_INSTANCE_KEY_NONE
bNodeTree * node_tree_from_id(ID *id)
StringRefNull node_socket_label(const bNodeSocket &sock)
bool node_link_is_hidden(const bNodeLink &link)
std::optional< Bounds< T > > min_max(const std::optional< Bounds< T > > &a, const T &b)
static bool compare_node_depth(const bNode *a, const bNode *b)
void tag_update_id(ID *id)
static rctf calc_node_frame_dimensions(const bContext &C, TreeDrawContext &tree_draw_ctx, const SpaceNode &snode, bNode &node)
static void determine_visible_panels_impl_recursive(const bNode &node, const nodes::PanelDeclaration &panel_decl, const Span< bool > potentially_visible_states, MutableSpan< bool > r_result)
const ComputeContext * compute_context_for_edittree_socket(const SpaceNode &snode, bke::ComputeContextCache &compute_context_cache, const bNodeSocket &socket)
static void add_flat_items_for_panel(bNode &node, const nodes::PanelDeclaration &panel_decl, const Span< bool > panel_visibility, Vector< FlatNodeItem > &r_items)
float node_socket_calculate_height(const bNodeSocket &socket)
rctf node_frame_rect_inside(const SpaceNode &snode, const bNode &node)
static bNodeInstanceKey current_node_instance_key(const SpaceNode &snode, const bNode &node)
int node_get_resize_cursor(NodeResizeDirection directions)
NodeLinkData data[NODELINK_GROUP_SIZE]
static void reroute_node_draw(const bContext &C, TreeDrawContext &tree_draw_ctx, ARegion ®ion, const SpaceNode &snode, bNodeTree &ntree, const bNode &node, uiBlock &block)
static float get_margin_to_bottom(const Span< FlatNodeItem > items)
static void node_socket_outline_color_get(const bool selected, const int socket_type, float r_outline_color[4])
static void mark_sockets_collapsed_recursive(bNode &node, const int node_left_x, const nodes::PanelDeclaration &visible_panel_decl, const nodes::PanelDeclaration &panel_decl)
static const bNode * reroute_node_get_linked_reroute(const bNode &reroute)
void tree_draw_order_update(bNodeTree &ntree)
static void node_add_error_message_button(const TreeDrawContext &tree_draw_ctx, const bNodeTree &ntree, const bNode &node, uiBlock &block, const rctf &rect, float &icon_offset)
static void draw_link_errors(const bContext &C, SpaceNode &snode, const bNodeLink &link, const Span< bke::NodeLinkError > errors, uiBlock &invalid_links_block)
void node_socket_draw(bNodeSocket *sock, const rcti *rect, const float color[4], float scale)
static Map< const bNode *, const bNode * > find_menu_switch_sources_for_index_switch_nodes(const SpaceNode &snode, const bNodeTree &ntree, bke::ComputeContextCache &compute_context_cache)
static void update_collapsed_sockets(bNode &node, const int node_left_x)
static void tag_final_panel(bNode &node, const Span< FlatNodeItem > items)
static void draw_nodetree(const bContext &C, ARegion ®ion, bNodeTree &ntree, bNodeInstanceKey parent_key)
static void frame_node_draw_label(TreeDrawContext &tree_draw_ctx, const bNode &node, const SpaceNode &snode)
static float get_margin_between_elements(const Span< FlatNodeItem > items, const int next_index)
static void reroute_node_draw_body(const bContext &C, const SpaceNode &snode, const bNodeTree &ntree, const bNode &node, uiBlock &block, const bool selected)
static void node_draw_collapsed(const bContext &C, TreeDrawContext &tree_draw_ctx, const View2D &v2d, const SpaceNode &snode, bNodeTree &ntree, bNode &node, uiBlock &block)
static void node_update_nodetree(const bContext &C, TreeDrawContext &tree_draw_ctx, bNodeTree &ntree, Span< bNode * > nodes, Span< uiBlock * > blocks)
static float node_tree_view_scale(const SpaceNode &snode)
static void determine_potentially_visible_panels(const bNode &node, MutableSpan< bool > r_result)
static void frame_node_draw_background(const ARegion ®ion, const SpaceNode &snode, const bNode &node)
static void node_draw_node_group_indicator(const SpaceNode &snode, const bNode &node, const rctf &rect, const float radius, const float color[4])
float2 node_from_view(const float2 &co)
void node_draw_link_bezier(const bContext &C, const View2D &v2d, const SpaceNode &snode, const bNodeLink &link, const int th_col1, const int th_col2, const int th_col3, const bool selected)
static void draw_background_color(const SpaceNode &snode)
static std::optional< std::chrono::nanoseconds > node_get_execution_time(const TreeDrawContext &tree_draw_ctx, const SpaceNode &snode, const bNode &node)
static bool node_update_basis_socket(TreeDrawContext &tree_draw_ctx, const bContext &C, bNodeTree &ntree, bNode &node, const char *panel_label, bNodeSocket *input_socket, bNodeSocket *output_socket, uiBlock &block, const int &locx, int &locy)
static std::optional< std::chrono::nanoseconds > compositor_accumulate_frame_node_execution_time(const TreeDrawContext &tree_draw_ctx, const SpaceNode &snode, const bNode &node)
static void reroute_node_draw_label(TreeDrawContext &tree_draw_ctx, const SpaceNode &snode, const bNode &node, uiBlock &block)
static float get_margin_from_top(const Span< FlatNodeItem > items)
ImBuf * node_preview_acquire_ibuf(bNodeTree &ntree, NestedTreePreviews &tree_previews, const bNode &node)
void nodesocket_batch_start()
std::array< float2, 4 > node_link_bezier_points_dragged(const SpaceNode &snode, const bNodeLink &link)
bNodeSocket * node_find_indicated_socket(SpaceNode &snode, ARegion ®ion, const float2 &cursor, const eNodeSocketInOut in_out)
static void node_draw_panels_background(const bNode &node)
static void find_bounds_by_zone_recursive(const SpaceNode &snode, const bNodeTreeZone &zone, const Span< const bNodeTreeZone * > all_zones, MutableSpan< Vector< float2 > > r_bounds_by_zone)
static std::optional< NodeExtraInfoRow > node_get_accessed_attributes_row(TreeDrawContext &tree_draw_ctx, const bNode &node)
static void node_update_basis(const bContext &C, TreeDrawContext &tree_draw_ctx, bNodeTree &ntree, bNode &node, uiBlock &block)
void node_socket_color_get(const bContext &C, const bNodeTree &ntree, PointerRNA &node_ptr, const bNodeSocket &sock, float r_color[4])
Array< bNode * > tree_draw_order_calc_nodes_reversed(bNodeTree &ntree)
static void node_get_compositor_extra_info(TreeDrawContext &tree_draw_ctx, const SpaceNode &snode, const bNode &node, Vector< NodeExtraInfoRow > &rows)
void node_set_cursor(wmWindow &win, ARegion ®ion, SpaceNode &snode, const float2 &cursor)
void node_draw_link(const bContext &C, const View2D &v2d, const SpaceNode &snode, const bNodeLink &link, const bool selected)
static void node_draw_mute_line(const bContext &C, const View2D &v2d, const SpaceNode &snode, const bNode &node)
static void reroute_node_prepare_for_draw(bNode &node)
static const bNode * find_node_under_cursor(SpaceNode &snode, const float2 &cursor)
static bool is_node_panels_supported(const bNode &node)
static NodeExtraInfoRow row_from_used_named_attribute(const Map< StringRefNull, geo_log::NamedAttributeUsage > &usage_by_attribute_name)
void node_draw_link_dragged(const bContext &C, const View2D &v2d, const SpaceNode &snode, const bNodeLink &link)
static std::optional< std::chrono::nanoseconds > compositor_node_get_execution_time(const TreeDrawContext &tree_draw_ctx, const SpaceNode &snode, const bNode &node)
static void add_flat_items_for_separator(Vector< FlatNodeItem > &r_items)
static void node_toggle_button_cb(bContext *C, void *node_argv, void *op_argv)
static void node_update_collapsed(bNode &node, uiBlock &block)
static Set< const bNodeSocket * > find_sockets_on_active_gizmo_paths(const bContext &C, const SpaceNode &snode, bke::ComputeContextCache &compute_context_cache)
static Array< uiBlock * > node_uiblocks_init(const bContext &C, const Span< bNode * > nodes)
static void add_rect_corner_positions(Vector< float2 > &positions, const rctf &rect)
bool node_is_previewable(const SpaceNode &snode, const bNodeTree &ntree, const bNode &node)
static void node_socket_tooltip_set(uiBlock &block, const int socket_index_in_tree, const float2 location, const float2 size)
static void determine_potentially_visible_panels_recursive(const bNode &node, const nodes::PanelDeclaration &panel_decl, MutableSpan< bool > r_result)
static bool node_update_basis_buttons(const bContext &C, bNodeTree &ntree, bNode &node, blender::FunctionRef< nodes::DrawNodeLayoutFn > draw_buttons, uiBlock &block, int &dy)
const ComputeContext * compute_context_for_edittree(const SpaceNode &snode, bke::ComputeContextCache &compute_context_cache)
void draw_nodespace_back_pix(const bContext &C, ARegion ®ion, SpaceNode &snode, bNodeInstanceKey parent_key)
static void draw_frame_overlays(const bContext &C, TreeDrawContext &tree_draw_ctx, const ARegion ®ion, const SpaceNode &snode, const bNodeTree &ntree, Span< uiBlock * > blocks)
static std::optional< std::chrono::nanoseconds > geo_node_get_execution_time(const TreeDrawContext &tree_draw_ctx, const SpaceNode &snode, const bNode &node)
static bool panel_has_only_inactive_inputs(const bNode &node, const nodes::PanelDeclaration &panel_decl)
static std::string named_attribute_tooltip(bContext *, void *argN, const StringRef)
static void node_draw_basis(const bContext &C, TreeDrawContext &tree_draw_ctx, const View2D &v2d, const SpaceNode &snode, bNodeTree &ntree, const bNode &node, uiBlock &block, bNodeInstanceKey key)
static void node_draw_extra_info_panel_back(const bNode &node, const rctf &extra_info_rect)
static void node_draw_extra_info_panel(const bContext &C, TreeDrawContext &tree_draw_ctx, const SpaceNode &snode, const bNode &node, ImBuf *preview, uiBlock &block)
static void count_multi_input_socket_links(bNodeTree &ntree, SpaceNode &snode)
static void determine_visible_panels(const bNode &node, MutableSpan< bool > r_visibility_states)
static void node_draw_sockets(const bContext &C, uiBlock &block, const SpaceNode &snode, const bNodeTree &ntree, const bNode &node)
static bNodeTree * node_tree_from_ID(ID *id)
void tree_update(const bContext *C)
static std::string node_get_execution_time_label(TreeDrawContext &tree_draw_ctx, const SpaceNode &snode, const bNode &node)
const char * node_socket_get_label(const bNodeSocket *socket, const char *panel_label=nullptr)
static void node_draw_extra_info_row(const bNode &node, uiBlock &block, const rctf &rect, const int row, const NodeExtraInfoRow &extra_info_row)
static void node_draw_preview(const Scene *scene, ImBuf *preview, const rctf *prv)
static void node_draw_nodetree(const bContext &C, TreeDrawContext &tree_draw_ctx, ARegion ®ion, SpaceNode &snode, bNodeTree &ntree, Span< bNode * > nodes, Span< uiBlock * > blocks, bNodeInstanceKey parent_key)
void nodesocket_batch_end()
static short get_viewer_shortcut_icon(const bNode &node)
Array< bNode * > tree_draw_order_calc_nodes(bNodeTree &ntree)
static void draw_socket_layout(TreeDrawContext &tree_draw_ctx, const bContext &C, uiLayout &layout, bNodeSocket &socket, bNodeTree &ntree, bNode &node, PointerRNA &node_ptr, PointerRNA &socket_ptr, const char *panel_label)
static void update_collapsed_sockets_recursive(bNode &node, const int node_left_x, const nodes::PanelDeclaration &panel_decl)
Vector< ui::ContextPathItem > context_path_for_space_node(const bContext &C)
float2 node_to_view(const float2 &co)
static void add_flat_items_for_socket(bNode &node, const nodes::SocketDeclaration &socket_decl, const nodes::PanelDeclaration *panel_decl, const nodes::SocketDeclaration *prev_socket_decl, Vector< FlatNodeItem > &r_items)
void node_select_single(bContext &C, bNode &node)
static std::string node_errors_tooltip_fn(const Span< geo_log::NodeWarning > warnings)
static rctf node_to_rect(const bNode &node)
static Vector< NodeExtraInfoRow > node_get_extra_info(const bContext &C, TreeDrawContext &tree_draw_ctx, const SpaceNode &snode, const bNode &node)
NestedTreePreviews * get_nested_previews(const bContext &C, SpaceNode &snode)
std::optional< ObjectAndModifier > get_modifier_for_node_editor(const SpaceNode &snode)
static std::optional< NodeExtraInfoRow > node_get_execution_time_label_row(TreeDrawContext &tree_draw_ctx, const SpaceNode &snode, const bNode &node)
static nodes::NodeWarningType node_error_highest_priority(Span< geo_log::NodeWarning > warnings)
void node_link_bezier_points_evaluated(const bNodeLink &link, std::array< float2, NODE_LINK_RESOL+1 > &coords)
static Vector< FlatNodeItem > make_flat_node_items(bNode &node)
void build_socket_tooltip(uiTooltipData &tip_data, bContext &C, uiBut *but, const bNodeTree &tree, const bNodeSocket &socket)
static const float virtual_node_socket_outline_color[4]
static std::optional< float2 > find_visible_center_of_link(const View2D &v2d, const bNodeLink &link, const float radius, const float region_padding)
float2 socket_link_connection_location(const bNode &node, const bNodeSocket &socket, const bNodeLink &link)
static void node_draw_socket(const bContext &C, const bNodeTree &ntree, const bNode &node, PointerRNA &node_ptr, uiBlock &block, const bNodeSocket &sock, const float outline_thickness, const bool selected, const float aspect)
static FrameNodeLayout frame_node_layout(const bNode &frame_node)
static void frame_node_draw_outline(const ARegion ®ion, const SpaceNode &snode, const bNode &node)
void snode_set_context(const bContext &C)
static void node_header_custom_tooltip(const bNode &node, uiBut &but)
static void node_socket_add_tooltip_in_node_editor(const bNodeSocket &sock, uiLayout &layout)
static void node_panel_toggle_button_cb(bContext *C, void *panel_state_argv, void *ntree_argv)
NodeResizeDirection node_get_resize_direction(const SpaceNode &snode, const bNode *node, const int x, const int y)
void nodelink_batch_end(const SpaceNode &snode)
static void node_draw(const bContext &C, TreeDrawContext &tree_draw_ctx, ARegion ®ion, const SpaceNode &snode, bNodeTree &ntree, bNode &node, uiBlock &block, bNodeInstanceKey key)
void nodelink_batch_start(const SpaceNode &)
void node_release_preview_ibuf(NestedTreePreviews &tree_previews)
static void node_draw_zones_and_frames(const ARegion ®ion, const SpaceNode &snode, const bNodeTree &ntree)
static void add_flat_items_for_layout(const bNode &node, const nodes::LayoutDeclaration &layout_decl, Vector< FlatNodeItem > &r_items)
static uiBut * add_error_message_button(uiBlock &block, const rctf &rect, const int icon, float &icon_offset, const char *tooltip=nullptr)
void node_to_updated_rect(const bNode &node, rctf &r_rect)
static bool draw_node_details(const SpaceNode &snode)
void node_draw_space(const bContext &C, ARegion ®ion)
static void node_draw_preview_background(rctf *rect)
static void node_draw_panels(bNodeTree &ntree, const bNode &node, uiBlock &block)
static void node_draw_shadow(const SpaceNode &snode, const bNode &node, const float radius, const float alpha)
static uiBlock & invalid_links_uiblock_init(const bContext &C)
static bool node_undefined_or_unsupported(const bNodeTree &node_tree, const bNode &node)
static void node_update_basis_from_declaration(TreeDrawContext &tree_draw_ctx, const bContext &C, bNodeTree &ntree, bNode &node, uiBlock &block, const int locx, int &locy)
static void frame_node_draw_overlay(const bContext &C, TreeDrawContext &tree_draw_ctx, const ARegion ®ion, const SpaceNode &snode, const bNode &node, uiBlock &block)
static void draw_tree_path(const bContext &C, ARegion ®ion)
static float get_margin_empty()
void node_socket_add_tooltip(const bNodeTree &ntree, const bNodeSocket &sock, uiLayout &layout)
static StringRef reroute_node_get_auto_label(TreeDrawContext &tree_draw_ctx, const bNode &src_reroute)
void node_draw_nodesocket(const rctf *rect, const float color_inner[4], const float color_outline[4], float outline_thickness, int shape, float aspect)
static void node_update_basis_from_socket_lists(TreeDrawContext &tree_draw_ctx, const bContext &C, bNodeTree &ntree, bNode &node, uiBlock &block, const int locx, int &locy)
static ColorTheme4f node_header_color_get(const bNodeTree &ntree, const bNode &node, const int color_id)
static int node_get_colorid(TreeDrawContext &tree_draw_ctx, const bNode &node)
static void determine_visible_panels_impl(const bNode &node, const Span< bool > potentially_visible_states, MutableSpan< bool > r_result)
static void snode_setup_v2d(SpaceNode &snode, ARegion ®ion, const float2 ¢er)
bNode * find_geometry_nodes_viewer(const ViewerPath &viewer_path, SpaceNode &snode)
bke::CurvesGeometry fillet_curves_poly(const bke::CurvesGeometry &src_curves, const IndexMask &curve_selection, const VArray< float > &radius, const VArray< int > &counts, bool limit_radius, const bke::AttributeFilter &attribute_filter)
T distance(const T &a, const T &b)
T midpoint(const T &a, const T &b)
T interpolate(const T &a, const T &b, const FactorT &t)
void foreach_socket_on_gizmo_path(const ComputeContext &gizmo_context, const bNode &gizmo_node, const bNodeSocket &gizmo_socket, FunctionRef< void(const ComputeContext &context, const bNodeSocket &socket, const ie::ElemVariant &elem)> fn)
void foreach_active_gizmo(const bContext &C, bke::ComputeContextCache &compute_context_cache, const ForeachGizmoFn fn)
bool node_can_sync_sockets(const bContext &C, const bNodeTree &, const bNode &node)
int node_warning_type_icon(const NodeWarningType type)
std::optional< NodeInContext > find_origin_index_menu_switch(const SocketInContext &src_socket, bke::ComputeContextCache &compute_context_cache)
std::chrono::nanoseconds Nanoseconds
void template_breadcrumbs(uiLayout &layout, Span< ContextPathItem > context_path)
int2 block_layout_resolve(uiBlock *block)
uiLayout & block_layout(uiBlock *block, LayoutDirection direction, LayoutType type, int x, int y, int size, int em, int padding, const uiStyle *style)
VecBase< float, 4 > float4
VecBase< int32_t, 2 > int2
VecBase< float, 2 > float2
ColorTheme4< float > ColorTheme4f
VecBase< float, 3 > float3
#define NODE_HEADER_ICON_SIZE
#define NODE_SOCKET_OUTLINE
#define ZONE_ZONE_PADDING
#define EXTRA_INFO_ROW_HEIGHT
#define NODE_ZONE_PADDING
#define NODE_TREE_SCALE_SMALL
#define NODE_MULTI_INPUT_LINK_GAP
#define NODE_ITEM_SPACING_Y
bool RNA_struct_is_a(const StructRNA *type, const StructRNA *srna)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
ARegionRuntimeHandle * runtime
ColorManagedViewSettings view_settings
SceneRuntimeHandle * runtime
ColorManagedDisplaySettings display_settings
SpaceNode_Runtime * runtime
struct bNodeTree * edittree
struct bNodeTree * nodetree
bNodeSocketRuntimeHandle * runtime
bNodeSocketTypeHandle * typeinfo
struct bNodeTree * nodetree
bNodeInstanceKey parent_key
bNodeTreeRuntimeHandle * runtime
bNodeTypeHandle * typeinfo
bNodePanelState * panel_states_array
bNodeRuntimeHandle * runtime
std::variant< flat_item::Socket, flat_item::Separator, flat_item::PanelHeader, flat_item::PanelContentBegin, flat_item::PanelContentEnd, flat_item::Layout > item
flat_item::Type type() const
std::optional< int > frame_identifier_to_highlight
std::unique_ptr< bNodeLinkDrag > linkdrag
geo_log::ContextualGeoTreeLogs tree_logs
NestedTreePreviews * nested_group_infos
Map< bNodeInstanceKey, timeit::Nanoseconds > * compositor_per_node_execution_time
const bNode * active_geometry_nodes_viewer
Array< Vector< NodeExtraInfoRow > > extra_info_rows_per_node
Map< int32_t, VectorSet< std::string > > shader_node_errors
Map< const bNode *, const bNode * > menu_switch_source_by_index_switch
Map< const bNode *, StringRef > reroute_auto_labels
const nodes::LayoutDeclaration * decl
static constexpr Type type
const nodes::PanelDeclaration * decl
static constexpr Type type
static constexpr Type type
const nodes::PanelDeclaration * decl
static constexpr Type type
static constexpr Type type
const nodes::PanelDeclaration * panel_decl
void alignment_set(blender::ui::LayoutAlign alignment)
void active_set(bool active)
void separator(float factor=1.0f, LayoutSeparatorType type=LayoutSeparatorType::Auto)
void enabled_set(bool enabled)
void context_ptr_set(blender::StringRef name, const PointerRNA *ptr)
uiLayout & row(bool align)
struct wmEvent * eventstate
void WM_cursor_set(wmWindow *win, int curs)
GPUViewport * WM_draw_region_get_viewport(ARegion *region)
void WM_main_add_notifier(uint type, void *reference)
wmOperatorStatus WM_operator_name_call(bContext *C, const char *opstring, blender::wm::OpCallContext context, PointerRNA *properties, const wmEvent *event)
void WM_gizmomap_draw(wmGizmoMap *gzmap, const bContext *C, const eWM_GizmoFlagMapDrawStep drawstep)
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)
void wmOrtho2_pixelspace(const float x, const float y)
void wmOrtho2_region_pixelspace(const ARegion *region)