95#include "RNA_prototypes.hh"
108#include <fmt/format.h>
109#include <fmt/ranges.h>
121#define NODE_ZONE_PADDING UI_UNIT_X
122#define ZONE_ZONE_PADDING 0.3f * UI_UNIT_X
123#define EXTRA_INFO_ROW_HEIGHT (20.0f * UI_SCALE_FAC)
175 if (row.tooltip_fn_free_arg) {
177 row.tooltip_fn_free_arg(row.tooltip_fn_arg);
208 bool a_select = a->is_selected(), b_select =
b->is_selected();
223 if (parent->is_selected()) {
227 for (
bNode *parent =
b->parent; parent; parent = parent->parent) {
236 if (parent->is_selected()) {
241 if (a->is_frame() && !
b->is_frame()) {
244 if (
b->is_frame() && !a->is_frame()) {
249 if (a_active && !b_active) {
252 if (b_active && !a_active) {
255 if (!b_select && (a_active || a_select)) {
258 if (!a_select && (b_active || b_select)) {
271 sort_nodes[i]->ui_order = i;
278 if (
nodes.is_empty()) {
281 std::ranges::sort(
nodes,
289 if (
nodes.is_empty()) {
292 std::ranges::sort(
nodes,
305 for (
const int i :
nodes.index_range()) {
307 std::string block_name =
"node_" + std::string(
node.name);
310 blocks[
node.index()] = block;
346 return node.declaration() &&
node.declaration()->use_custom_socket_order;
380 if (
node.is_muted()) {
389 draw_buttons(layout,
const_cast<bContext *
>(&
C), &nodeptr);
391 block_align_end(&block);
405 if (socket_short_label.has_value()) {
406 return CTX_IFACE_(socket_translation_context, socket_short_label->c_str());
410 const char *translated_socket_label =
CTX_IFACE_(socket_translation_context,
411 socket_label.
c_str());
415 const int len_prefix = strlen(panel_label);
416 if (
STREQLEN(translated_socket_label, panel_label, len_prefix) &&
417 translated_socket_label[len_prefix] ==
' ')
419 return translated_socket_label + len_prefix + 1;
424 return translated_socket_label;
450 const char *panel_label)
476 const char *panel_label,
483 if ((!input_socket || !input_socket->is_visible()) &&
484 (!output_socket || !output_socket->is_visible()))
489 const int topy = locy;
495 const float multi_input_socket_offset = is_multi_input ?
500 locy -= multi_input_socket_offset * 0.5f;
512 if (
node.is_muted()) {
531 tree_draw_ctx,
C, *row, *input_socket, ntree,
node, nodeptr, sockptr, panel_label);
542 tree_draw_ctx,
C, *row, *output_socket, ntree,
node, nodeptr, sockptr, panel_label);
560 else if (output_socket) {
564 block_align_end(&block);
569 locy = buty - multi_input_socket_offset * 0.5;
625 return std::visit([](
auto &&
item) {
return item.type; }, this->
item);
632 bool potentially_visible =
false;
636 potentially_visible |= socket.is_visible();
641 potentially_visible |= r_result[sub_panel_decl->index];
644 r_result[panel_decl.
index] = potentially_visible;
664 if (!potentially_visible_states[panel_decl.
index]) {
668 r_result[panel_decl.
index] =
true;
670 if (panel_state.is_collapsed()) {
677 node, *sub_panel_decl, potentially_visible_states, r_result);
689 node, *panel_decl, potentially_visible_states, r_result);
701 Array<bool> potentially_visible_states(r_visibility_states.
size(),
false);
713 if (!socket.is_visible()) {
717 if (!prev_socket_decl || !
node.socket_by_decl(*prev_socket_decl).is_visible()) {
727 item.
input = &socket;
756 if (!panel_visibility[panel_decl.
index]) {
760 header_item.
decl = &panel_decl;
762 if (panel_input_decl) {
763 header_item.
input = &
node.socket_by_decl(*panel_input_decl);
765 r_items.
append({header_item});
768 if (panel_state.is_collapsed()) {
774 if (item_decl == panel_input_decl) {
779 prev_socket_decl = socket_decl;
792 prev_socket_decl =
nullptr;
806 const int panels_num =
node.num_panel_states;
816 prev_socket_decl = socket_decl;
829 prev_socket_decl =
nullptr;
846 switch (first_item_type) {
868 switch (last_item_type) {
893 const Type prev_type = prev.type();
903 case Type::Separator:
907 case Type::PanelHeader:
909 case Type::PanelContentBegin:
911 case Type::PanelContentEnd:
920 case Type::Separator:
924 case Type::PanelHeader:
926 case Type::PanelContentBegin:
928 case Type::PanelContentEnd:
933 case Type::Separator: {
937 case Type::Separator:
941 case Type::PanelHeader:
943 case Type::PanelContentBegin:
945 case Type::PanelContentEnd:
950 case Type::PanelHeader: {
954 case Type::Separator:
958 case Type::PanelHeader:
960 case Type::PanelContentBegin:
962 case Type::PanelContentEnd:
967 case Type::PanelContentBegin: {
971 case Type::Separator:
975 case Type::PanelHeader:
977 case Type::PanelContentBegin:
979 case Type::PanelContentEnd:
984 case Type::PanelContentEnd: {
988 case Type::Separator:
992 case Type::PanelHeader:
994 case Type::PanelContentBegin:
996 case Type::PanelContentEnd:
1008 const int node_left_x,
1013 node.runtime->panels[visible_panel_decl.
index];
1036 const int node_left_x,
1040 if (panel_state.is_collapsed()) {
1071 for (
int item_i = items.
size() - 1; item_i >= 0; item_i--) {
1073 if (
const auto *panel_item = std::get_if<flat_item::PanelContentEnd>(&item.
item)) {
1074 final_panel = panel_item;
1119 for (
const int item_i : flat_items.
index_range()) {
1133 [&](
const auto &item) {
1134 using ItemT = std::decay_t<
decltype(item)>;
1135 if constexpr (std::is_same_v<ItemT, flat_item::Socket>) {
1139 const char *parent_label = panel_decl ? panel_decl->
name.
c_str() :
"";
1151 else if constexpr (std::is_same_v<ItemT, flat_item::Layout>) {
1164 if (
node.is_muted()) {
1173 block_align_end(&block);
1176 else if constexpr (std::is_same_v<ItemT, flat_item::Separator>) {
1189 else if constexpr (std::is_same_v<ItemT, flat_item::PanelHeader>) {
1192 const float panel_header_height =
NODE_DYS;
1193 locy -= panel_header_height / 2;
1195 locy -= panel_header_height / 2;
1202 else if constexpr (std::is_same_v<ItemT, flat_item::PanelContentBegin>) {
1208 else if constexpr (std::is_same_v<ItemT, flat_item::PanelContentEnd>) {
1221 locy -= bottom_margin;
1240 bool add_output_space =
false;
1246 if (socket->is_visible() && add_output_space) {
1250 tree_draw_ctx,
C, ntree,
node,
nullptr,
nullptr, socket, block, locx, locy))
1252 add_output_space =
true;
1257 C, ntree,
node,
node.typeinfo->draw_buttons, block, locy);
1259 bool add_input_space =
false;
1260 const bool add_before_first_input = add_output_space && !add_button_space;
1267 if (socket->is_visible() && (add_input_space || add_before_first_input)) {
1271 tree_draw_ctx,
C, ntree,
node,
nullptr, socket,
nullptr, block, locx, locy))
1273 add_input_space =
true;
1278 if (add_output_space || add_input_space || add_button_space) {
1307 node.runtime->draw_bounds.xmin = loc.x;
1309 node.runtime->draw_bounds.ymax = loc.y;
1314 block_bounds_set_explicit(&block,
1316 node.runtime->draw_bounds.ymin,
1318 node.runtime->draw_bounds.ymax);
1326 int totin = 0, totout = 0;
1333 if (socket->is_visible()) {
1338 if (socket->is_visible()) {
1343 const float dy =
NODE_DY * 0.5f;
1344 const float height = dy * std::max({totin, totout, 2}) +
BASIS_RAD * 2.0f;
1346 const float offset =
NODE_DY * -0.5f;
1348 node.runtime->draw_bounds.xmin = loc.x;
1350 node.runtime->draw_bounds.ymax = loc.y + height * 0.5f + offset;
1351 node.runtime->draw_bounds.ymin = loc.y - height * 0.5f + offset;
1355 const float x =
node.runtime->draw_bounds.xmax;
1356 float y = loc.y + dy *
float(totout - 1) * 0.5f + offset;
1358 if (socket->is_visible()) {
1359 socket->runtime->location = {
x,
y};
1367 const float x =
node.runtime->draw_bounds.xmin;
1368 float y = loc.y + dy *
float(totin - 1) * 0.5f + offset;
1370 if (socket->is_visible()) {
1371 socket->runtime->location = {
x,
y};
1379 block_bounds_set_explicit(&block,
1381 node.runtime->draw_bounds.ymin,
1383 node.runtime->draw_bounds.ymax);
1388 const int nclass = (
node.typeinfo->ui_class ==
nullptr) ?
node.typeinfo->nclass :
1446 link.
tosock = internal_link.out;
1448 if (internal_link.in->is_multi_input()) {
1449 for (
const bNodeLink *connected_link : internal_link.in->directly_linked_links()) {
1450 if (!connected_link->fromnode->is_dangling_reroute()) {
1465 const int socket_index_in_tree,
1474 location.x - size.x / 2.0f,
1475 location.y - size.y / 2.0f,
1483 button_func_tooltip_custom_set(
1489 ntree.ensure_topology_cache();
1490 const bNodeSocket &socket = *ntree.all_sockets()[index_in_tree];
1500 const int socket_type,
1501 float r_outline_color[4])
1516 r_outline_color[3] = 1.0f;
1539 &
const_cast<ID &
>(ntree.
id), RNA_NodeSocket, &
const_cast<bNodeSocket &
>(sock));
1545 uiLayoutSetTooltipCustomFunc(
1551 ntree.ensure_topology_cache();
1552 const bNodeSocket &socket = *ntree.all_sockets()[index_in_tree];
1562 struct SocketTooltipData {
1568 data->ntree = &ntree;
1569 data->socket = &sock;
1571 uiLayoutSetTooltipCustomFunc(
1574 SocketTooltipData *
data =
static_cast<SocketTooltipData *
>(argN);
1582#define NODE_SOCKET_OUTLINE U.pixelsize
1588 const rctf draw_rect = {
1607#define NODE_TREE_SCALE_SMALL 0.2f
1634 immUniform4f(
"color1", checker_dark, checker_dark, checker_dark, 1.0f);
1635 immUniform4f(
"color2", checker_light, checker_light, checker_light, 1.0f);
1646 float xscale = xrect /
float(preview->
x);
1647 float yscale = yrect /
float(preview->
y);
1651 rctf draw_rect = *prv;
1652 if (xscale < yscale) {
1653 float offset = 0.5f * (yrect -
float(preview->
y) * xscale);
1654 draw_rect.
ymin += offset;
1655 draw_rect.
ymax -= offset;
1659 float offset = 0.5f * (xrect -
float(preview->
x) * yscale);
1660 draw_rect.
xmin += offset;
1661 draw_rect.
xmax -= offset;
1682 float black[4] = {0.0f, 0.0f, 0.0f, 1.0f};
1684 const float outline_width = 1.0f;
1685 draw_rect.
xmin -= outline_width;
1686 draw_rect.
xmax += outline_width;
1687 draw_rect.
ymin -= outline_width;
1688 draw_rect.
ymax += outline_width;
1698 const char *opname =
static_cast<const char *
>(op_argv);
1711 const rctf &rct =
node.runtime->draw_bounds;
1714 const float shadow_width = 0.4f *
U.widget_unit;
1715 const float shadow_alpha = 0.2f * alpha;
1720 const float color[4] = {0.0f, 0.0f, 0.0f, 0.4f};
1734 const float color[4])
1741 const bool is_selected =
node.is_selected();
1745 const float shadow_width = 0.2f *
U.widget_unit;
1746 const float shadow_alpha = is_selected ? 0.4f : 0.2f;
1747 const float dim_collapsed = is_collapsed ? 0.2f : 0.0f;
1749 const float outline_width = is_selected ? 1.0f : 0.5f;
1750 float outline_color[4];
1761 const rctf rect_group_front = {
1762 rect.
xmin + offset_x * 4,
1763 rect.
xmax - offset_x * 4,
1764 rect.
ymin - (offset_y * 2) -
U.pixelsize,
1765 rect.
ymin - offset_y + (
U.pixelsize * 2),
1768 const rctf rect_group_front_shadow = {
1769 rect_group_front.
xmin + outline_width,
1770 rect_group_front.
xmax - outline_width,
1771 rect_group_front.
ymin + outline_width,
1772 rect_group_front.
ymax - outline_width,
1776 radius + outline_width,
1782 float fill_color_front[4], outline_color_front[4];
1784 mul_v3_fl(fill_color_front, 0.8f - dim_collapsed);
1786 copy_v4_v4(outline_color_front, outline_color);
1787 mul_v3_fl(outline_color_front, (is_selected ? 0.5f : 1.0f) - dim_collapsed);
1793 outline_color_front,
1800 const rctf rect_group_back = {
1801 rect.
xmin + offset_x * 2,
1802 rect.
xmax - offset_x * 2,
1803 rect.
ymin - offset_y -
U.pixelsize,
1804 rect.
ymin + (
U.pixelsize * 2),
1807 const rctf rect_group_back_shadow = {
1808 rect_group_back.
xmin + outline_width,
1809 rect_group_back.
xmax - outline_width,
1810 rect_group_back.
ymin + outline_width,
1811 rect_group_back.
ymax - outline_width,
1815 radius + outline_width,
1820 float fill_color_back[4], outline_color_back[4];
1822 mul_v3_fl(fill_color_back, 0.9f - dim_collapsed);
1824 copy_v4_v4(outline_color_back, outline_color);
1825 mul_v3_fl(outline_color_back, (is_selected ? 0.7f : 1.1f) - dim_collapsed);
1843 const float outline_thickness,
1844 const bool selected,
1860 socket_location.x - half_width,
1861 socket_location.x + half_width,
1862 socket_location.y - half_height,
1863 socket_location.y + half_height,
1867 &rect, socket_color, outline_color, outline_thickness, sock.
display_shape, aspect);
1870 block, sock.index_in_tree(), socket_location,
float2(2.0f * half_width, 2.0f * half_height));
1883 if (
node.input_sockets().is_empty() &&
node.output_sockets().is_empty()) {
1888 const_cast<ID *
>(&ntree.
id), RNA_Node,
const_cast<bNode *
>(&
node));
1895 if (!sock->is_icon_visible()) {
1898 const bool selected = (sock->flag &
SELECT);
1900 C, ntree,
node, nodeptr, block, *sock, outline_thickness, selected, snode.
runtime->
aspect);
1905 if (!sock->is_icon_visible()) {
1908 const bool selected = (sock->flag &
SELECT);
1910 C, ntree,
node, nodeptr, block, *sock, outline_thickness, selected, snode.
runtime->
aspect);
1931 float panel_color[4];
1934 panel_color[3] *= 1.5f;
1935 const rctf &draw_bounds =
node.runtime->draw_bounds;
1940 for (
const int panel_i : node_decl.
panels.index_range()) {
1946 const rctf content_rect = {draw_bounds.
xmin,
1953 final_panel_decl = &panel_decl;
1956 if (final_panel_decl) {
1958 node.runtime->panels[final_panel_decl->
index];
1959 const rctf content_rect = {draw_bounds.
xmin,
1964 const int repeats = final_panel_decl->
depth() + 1;
1965 for ([[maybe_unused]]
const int i :
IndexRange(repeats)) {
1981 if (socket_decl->in_out ==
SOCK_OUT) {
1985 if (!socket.is_inactive()) {
2002 const rctf &draw_bounds =
node.runtime->draw_bounds;
2005 for (
const int panel_i : node_decl.
panels.index_range()) {
2014 const bool panel_is_inactive =
node.is_muted() || only_inactive_inputs;
2016 const rctf header_rect = {draw_bounds.
xmin,
2024 ui::Button *toggle_action_but = uiDefIconBut(
2028 header_rect.
xmin + header_but_margin,
2030 std::max(
int(header_rect.
xmax - header_rect.
xmin - 2 * header_but_margin), 0),
2031 header_rect.
ymax - header_rect.
ymin,
2037 button_func_pushed_state_set(toggle_action_but, [&panel_state](
const ui::Button &) {
2038 return panel_state.is_collapsed();
2040 button_func_set(toggle_action_but,
2046 const int but_size =
U.widget_unit * 0.8f;
2049 uiDefIconBut(&block,
2051 panel_state.is_collapsed() ? ICON_RIGHTARROW : ICON_DOWNARROW_HLT,
2060 offsetx += but_size + but_padding;
2065 if (input_socket && !input_socket->is_logically_linked()) {
2067 ui::Button *panel_toggle_but = uiDefButR(&block,
2080 button_func_tooltip_custom_set(
2086 ntree.ensure_topology_cache();
2087 const bNodeSocket &socket = *ntree.all_sockets()[index_in_tree];
2092 if (panel_is_inactive) {
2102 const float left_padding = (input_socket ==
nullptr) ? 40.0f : 60.0f;
2116 if (panel_is_inactive) {
2122template<
typename WarningsRange>
2125 int highest_priority = 0;
2127 for (
const auto &warning : warnings) {
2129 if (priority > highest_priority) {
2130 highest_priority = priority;
2131 highest_priority_type = warning.type;
2134 return highest_priority_type;
2139 std::string complete_string;
2142 complete_string += warning.message;
2145 complete_string +=
'.';
2146 complete_string +=
'\n';
2150 complete_string += warnings.
last().message;
2152 return complete_string;
2155#define NODE_HEADER_ICON_SIZE (0.8f * U.widget_unit)
2161 const char *tooltip =
nullptr)
2203 if (node_log !=
nullptr) {
2215 button_func_quick_tooltip_set(
2233 button_func_quick_tooltip_set(but, [errors = *errors](
const ui::Button * ) {
2236 std::string message = error.message;
2237 if (message.empty()) {
2240 if (!message.ends_with(
".")) {
2243 tooltip_lines.
append(std::move(message));
2245 return fmt::format(
"{}", fmt::join(tooltip_lines,
"\n"));
2255 return std::nullopt;
2270 if (tree_log ==
nullptr) {
2271 return std::nullopt;
2273 if (
node.is_group_output()) {
2276 if (
node.is_type(
"CompositorNodeViewer"_ustr)) {
2279 return std::nullopt;
2281 if (
node.is_frame()) {
2283 std::chrono::nanoseconds run_time{0};
2284 bool found_node =
false;
2286 for (
const bNode *tnode :
node.direct_children_in_frame()) {
2287 if (tnode->is_frame()) {
2289 tree_draw_ctx, snode, *tnode);
2290 if (sub_frame_run_time.has_value()) {
2291 run_time += *sub_frame_run_time;
2299 run_time += node_log->execution_time;
2306 return std::nullopt;
2309 return node_log->execution_time;
2311 return std::nullopt;
2319 tree_draw_ctx, snode,
node);
2321 if (!exec_time.has_value()) {
2322 return std::string(
"");
2326 std::chrono::duration_cast<std::chrono::microseconds>(*exec_time).count();
2329 if (exec_time_us == 0) {
2330 return std::string(
"-");
2332 if (exec_time_us < 100) {
2333 return std::string(
"< 0.1 ms");
2338 if (exec_time_us < 1000) {
2341 else if (exec_time_us < 10000) {
2345 std::stringstream stream;
2346 stream << std::fixed << std::setprecision(precision) << (exec_time_us / 1000.0f);
2347 return stream.str() +
" ms";
2358 fmt::memory_buffer buf;
2359 fmt::format_to(fmt::appender(buf),
"{}",
TIP_(
"Accessed named attributes:"));
2360 fmt::format_to(fmt::appender(buf),
"\n");
2362 struct NameWithUsage {
2369 sorted_used_attribute.
append({item.key, item.value});
2371 std::ranges::sort(sorted_used_attribute, [](
const NameWithUsage &a,
const NameWithUsage &
b) {
2375 for (
const NameWithUsage &
attribute : sorted_used_attribute) {
2378 fmt::format_to(fmt::appender(buf), fmt::runtime(
TIP_(
" \u2022 \"{}\": ")), name);
2390 fmt::format_to(fmt::appender(buf),
"{}", usages[i]);
2391 if (i < usages.
size() - 1) {
2392 fmt::format_to(fmt::appender(buf),
", ");
2395 fmt::format_to(fmt::appender(buf),
"\n");
2397 fmt::format_to(fmt::appender(buf),
"\n");
2400 fmt::runtime(
TIP_(
"Attributes with these names used within the group may conflict with "
2401 "existing attributes")));
2402 return fmt::to_string(buf);
2408 const int attributes_num = usage_by_attribute_name.
size();
2411 row.
text = std::to_string(attributes_num) +
2412 (attributes_num == 1 ?
RPT_(
" Named Attribute") :
RPT_(
" Named Attributes"));
2413 row.
icon = ICON_SPREADSHEET;
2427 if (geo_tree_log ==
nullptr) {
2428 return std::nullopt;
2437 if (
STREQ(socket->name,
"Name")) {
2438 if (!socket->is_directly_linked()) {
2439 return std::nullopt;
2446 if (node_log ==
nullptr) {
2447 return std::nullopt;
2450 return std::nullopt;
2460 if (row.
text.empty()) {
2461 return std::nullopt;
2464 "The execution time from the node tree's latest evaluation. For frame and group "
2465 "nodes, the time for all sub-nodes");
2466 row.
icon = ICON_PREVIEW_RANGE;
2477 tree_draw_ctx, snode,
node);
2478 if (row.has_value()) {
2479 rows.
append(std::move(*row));
2491 if (
node.typeinfo->get_extra_info) {
2493 node.typeinfo->get_extra_info(params);
2496 if (
node.typeinfo->deprecation_notice) {
2499 row.
icon = ICON_STATUS_INFO;
2501 rows.
append(std::move(row));
2518 rows.
append(std::move(*row));
2532 node.is_type(
"GeometryNodeClosureToList"_ustr) ||
2533 node.is_type(
"GeometryNodeCombineList"_ustr) ||
2534 node.is_type(
"GeometryNodeFilterList"_ustr) ||
2535 node.is_type(
"GeometryNodeListGetItem"_ustr) ||
2536 node.is_type(
"GeometryNodeFieldToList"_ustr) ||
2537 node.is_type(
"GeometryNodeListLength"_ustr)))
2540 tree_draw_ctx, snode,
node);
2541 if (row.has_value()) {
2542 rows.
append(std::move(*row));
2551 if (node_log !=
nullptr) {
2555 row.
icon = ICON_STATUS_INFO;
2556 rows.
append(std::move(row));
2572 const float but_icon_right = but_icon_left + but_icon_width;
2583 extra_info_row.
icon,
2596 button_func_tooltip_set(
2600 const float but_text_left = but_icon_right + 6.0f *
UI_SCALE_FAC;
2601 const float but_text_right = rect.
xmax;
2602 const float but_text_width = but_text_right - but_text_left;
2607 extra_info_row.
text.c_str(),
2610 short(but_text_width),
2622 button_func_tooltip_set(but_text, extra_info_row.
tooltip_fn, tooltip_arg,
nullptr);
2625 if (
node.is_muted()) {
2635 rctf panel_back_rect = extra_info_rect;
2638 if (
node.is_muted()) {
2649 const float outline_width =
U.pixelsize;
2650 BLI_rctf_pad(&panel_back_rect, outline_width, outline_width);
2654 &panel_back_rect,
color,
nullptr, 0.0f, color_outline, outline_width,
BASIS_RAD);
2661 const ImBuf *preview,
2668 if (preview && !(preview->
x > 0 && preview->
y > 0)) {
2674 if (extra_info_rows.
is_empty() && !preview) {
2678 const rctf &rct =
node.runtime->draw_bounds;
2679 rctf extra_info_rect;
2681 if (
node.is_frame()) {
2695 float preview_height = 0.0f;
2699 if (preview->
x > preview->
y) {
2700 preview_height = (width - 2.0f *
padding) *
float(preview->
y) /
float(preview->
x) +
2706 extra_info_rect.
ymax += preview_height;
2709 preview_height = width;
2710 const float preview_width = (width - 2.0f *
padding) *
float(preview->
x) /
2715 preview_rect.
xmin = extra_info_rect.
xmin +
padding + (width - preview_width) / 2;
2716 preview_rect.
xmax = extra_info_rect.
xmax -
padding - (width - preview_width) / 2;
2717 extra_info_rect.
ymax += preview_height;
2728 extra_info_rect.
ymin += preview_height;
2738 BLI_assert(
node.is_type(
"CompositorNodeViewer"_ustr) ||
node.is_type(
"GeometryNodeViewer"_ustr));
2739 switch (
node.custom1) {
2742 return node.typeinfo->ui_icon;
2744 return ICON_EVENT_ONEKEY;
2746 return ICON_EVENT_TWOKEY;
2748 return ICON_EVENT_THREEKEY;
2750 return ICON_EVENT_FOURKEY;
2752 return ICON_EVENT_FIVEKEY;
2754 return ICON_EVENT_SIXKEY;
2756 return ICON_EVENT_SEVENKEY;
2758 return ICON_EVENT_EIGHTKEY;
2760 return ICON_EVENT_NINEKEY;
2763 return node.typeinfo->ui_icon;
2774 const char *disabled_hint =
nullptr;
2775 if (!
node.typeinfo->poll(
node.typeinfo, &node_tree, &disabled_hint)) {
2779 if (
node.is_group()) {
2780 const ID *group_tree =
node.id;
2781 if (group_tree ==
nullptr) {
2803 const float alpha = 0.55f + color_alpha.
a * (1.0f - 0.55f);
2811 TH_REDALERT, color_id, 1.0f - color_alert.
a, -60, color_header);
2812 color_header.
a = alpha;
2819 color_header.
a = alpha;
2823 if (
node.is_selected()) {
2824 color_header.
a = 1.0f;
2829 if (
node.is_muted()) {
2834 color_header, color_background, 0.6f, -0.2f, color_header);
2837 return color_header;
2842 button_func_tooltip_custom_set_cpp(
2844 const std::string description =
node.typeinfo->ui_description_fn ?
2846 TIP_(
node.typeinfo->ui_description);
2847 const bool have_description = !description.empty();
2848 if (have_description) {
2849 tooltip_text_field_add(
2854 const_cast<ID *
>(&ntree.
id), RNA_Node,
const_cast<bNode *
>(&
node));
2855 tooltip_text_field_add(
data,
2856 fmt::format(
"Python: {}\n{}",
2883 rctf rect_with_preview =
node.runtime->draw_bounds;
2889 tree_draw_ctx.
bmain,
2891 tree_draw_ctx.
scene,
2903 const rctf &rct =
node.runtime->draw_bounds;
2904 float color[4], color_alert[4];
2912 bool drawn_with_previews =
false;
2917 if (previews_shader) {
2921 drawn_with_previews =
true;
2928 if (node_log->image_preview) {
2930 C, tree_draw_ctx, snode,
node, node_log->image_preview, block);
2931 drawn_with_previews =
true;
2937 if (drawn_with_previews ==
false) {
2944 const float outline_width =
U.pixelsize;
2962 float iconofs = rct.
xmax - 0.35f *
U.widget_unit;
2965 iconofs -= iconbutw;
2981 PointerRNA *opptr = button_operator_ptr_ensure(but);
2990 iconofs -= iconbutw;
2994 is_active ? ICON_HIDE_OFF : ICON_HIDE_ON,
3005 button_func_set(but,
3008 (
void *)(
"NODE_OT_preview_toggle"));
3012 node.typeinfo->ui_icon != ICON_NONE)
3014 iconofs -= iconbutw;
3016 uiDefIconBut(&block,
3018 node.typeinfo->ui_icon,
3031 iconofs -= iconbutw;
3035 is_active ? ICON_RESTRICT_VIEW_OFF : ICON_RESTRICT_VIEW_ON,
3045 const char *operator_idname = is_active ?
"NODE_OT_deactivate_viewer" :
3046 "NODE_OT_activate_viewer";
3051 uiDefIconBut(&block,
3054 iconofs - 1.2 * iconbutw,
3065 if (
node.is_type(
"CompositorNodeViewer"_ustr)) {
3067 iconofs -= iconbutw;
3072 is_active ? ICON_RESTRICT_VIEW_OFF : ICON_RESTRICT_VIEW_ON,
3082 button_func_set(but,
3085 (
void *)(
"NODE_OT_activate_viewer"));
3087 uiDefIconBut(&block,
3090 iconofs - 1.2 * iconbutw,
3104 if (
node.is_selected()) {
3113 const int but_size =
U.widget_unit * 0.8f;
3130 button_func_set(but,
3133 (
void *)(
"NODE_OT_hide_toggle"));
3152 if (
node.is_muted()) {
3157 if (
node.is_muted()) {
3176 if (
node.is_selected()) {
3182 if (
node.is_muted()) {
3183 float color_background[4];
3212 const rctf rect_node = {
3213 rct.
xmin - outline_width,
3214 rct.
xmax + outline_width,
3215 rct.
ymin - outline_width,
3216 rct.
ymax + outline_width,
3218 float color_outline[4] = {0.0f, 0.0f, 0.0f, 1.0f};
3219 if (
node.is_selected()) {
3224 color_outline[3] = 1.0f;
3228 color_outline[3] = 1.0f;
3247 tree_draw_ctx.
bmain,
3249 tree_draw_ctx.
scene,
3253 block_draw(&
C, &block);
3264 const rctf &rct =
node.runtime->draw_bounds;
3278 if (
node.is_muted()) {
3304 if (
node.is_selected()) {
3311 const rctf header_rect = {
3318 float iconofs = rct.
xmax - 0.35f *
U.widget_unit;
3323 const int but_size = 0.8f *
U.widget_unit;
3330 centy - but_size / 2,
3340 button_func_set(but,
3343 (
void *)(
"NODE_OT_hide_toggle"));
3364 const float outline_width =
U.pixelsize;
3366 rct.
xmin - outline_width,
3367 rct.
xmax + outline_width,
3368 rct.
ymin - outline_width,
3369 rct.
ymax + outline_width,
3373 float color_outline[4];
3375 if (
node.is_selected()) {
3380 color_outline[3] = 1.0f;
3382 else if (
node.is_muted()) {
3394 if (
node.is_muted()) {
3401 tree_draw_ctx.
bmain,
3403 tree_draw_ctx.
scene,
3407 block_draw(&
C, &block);
3412 if (directions == 0) {
3437 if (ntree ==
nullptr) {
3469 if (socket->is_multi_input()) {
3470 socket->runtime->total_inputs = socket->directly_linked_links().size();
3507 frame_layout.
margin = 1.5f *
U.widget_unit;
3512 float room_for_label = 1.5f * frame_layout.
label_height + 0.2f * frame_layout.
margin;
3530 return frame_layout;
3544 if (!
node.is_frame()) {
3547 float zone_padding = 0;
3548 float extra_row_padding = 0;
3563 node_bounds.ymax += std::max(zone_padding, extra_row_padding);
3582 for (
bNode *child :
node.direct_children_in_frame()) {
3610 node.runtime->draw_bounds = rect;
3619 node.input_socket(0).runtime->location = loc;
3620 node.output_socket(0).runtime->location = loc;
3623 node.width = radius * 2;
3624 node.runtime->draw_bounds.xmin = loc.x - radius;
3625 node.runtime->draw_bounds.xmax = loc.x + radius;
3626 node.runtime->draw_bounds.ymax = loc.y + radius;
3627 node.runtime->draw_bounds.ymin = loc.y - radius;
3673 bottom_y = loc.y - but_h;
3692 block_align_end(&block);
3696 const float icon_pad = 0.15f *
U.widget_unit;
3697 float height = std::max<float>(is_edit || !
text.trim().is_empty() ? loc.y - bottom_y : 0,
3700 node.runtime->draw_bounds.xmin = loc.x;
3702 node.runtime->draw_bounds.ymin = loc.y - height;
3703 node.runtime->draw_bounds.ymax = loc.y;
3705 if (!is_edit &&
node.is_selected()) {
3738 for (
const int i :
nodes.index_range()) {
3741 if (
node.is_frame()) {
3746 if (
node.is_reroute()) {
3749 else if (
node.is_type(
"NodeComment"_ustr)) {
3763 for (
bNode *frame : ntree.root_frames()) {
3776 for (
const bNode *parent =
node.parent; parent; parent = parent->parent) {
3779 if (depth % 2 == 0) {
3790 float text_color_rgb[3];
3793 float text_color_hsl[3];
3798 text_color_hsl[2] = 0.05f;
3802 text_color_hsl[2] = 0.95f;
3830 uchar text_color[3];
3836 const rctf &rct =
node.runtime->draw_bounds;
3856 const int y_min = rct.
ymin + frame_layout.
margin;
3868 y -= line_spacing * info.
lines;
3894 float temp_theme_color[4];
3896 const float alpha = temp_theme_color[3];
3904 const rctf &rct =
node.runtime->draw_bounds;
3914 const rctf &rct =
node.runtime->draw_bounds;
3920 bool draw_outline =
false;
3923 draw_outline =
true;
3926 else if (
node.is_selected()) {
3927 draw_outline =
true;
3951 tree_draw_ctx.
bmain,
3953 tree_draw_ctx.
scene,
3966 tree_draw_ctx.
bmain,
3968 tree_draw_ctx.
scene,
3972 block_draw(&
C, &block);
3978 const std::optional<ed::space_node::ObjectAndModifier> object_and_modifier =
3980 if (!object_and_modifier) {
3983 snode.
edittree->ensure_topology_cache();
3986 snode, compute_context_cache);
3987 if (!current_compute_context) {
3995 compute_context_cache,
3996 [&](
const Object &gizmo_object,
3999 const bNode &gizmo_node,
4001 if (&gizmo_object != object_and_modifier->object) {
4004 if (&gizmo_nmd != object_and_modifier->nmd) {
4014 if (compute_context.
hash() == current_compute_context->
hash()) {
4015 sockets_on_gizmo_paths.
add(&socket);
4020 return sockets_on_gizmo_paths;
4030 const bNodeSocket *input_socket = reroute.input_sockets().first();
4031 if (input_socket->directly_linked_links().is_empty()) {
4034 const bNodeLink *input_link = input_socket->directly_linked_links().first();
4036 return from_node->is_reroute() ? from_node :
nullptr;
4044 const bNode &src_reroute)
4048 if (src_reroute.
label[0] !=
'\0') {
4049 return src_reroute.
label;
4058 for (
const bNode *reroute = &src_reroute; reroute;
4061 reroute_path.
append(reroute);
4066 if (reroute->label[0] !=
'\0') {
4067 label = reroute->label;
4071 reroute_auto_labels.
add(reroute,
"");
4075 for (
const bNode *reroute : reroute_path) {
4087 const bool selected)
4094 const_cast<ID *
>(&ntree.
id), RNA_Node,
const_cast<bNode *
>(&
node));
4121 const bool has_label =
node.label[0] !=
'\0';
4125 if (!has_label && !use_auto_label) {
4135 if (
text.is_empty()) {
4139 const short width = 512;
4144 &block,
ui::ButtonType::Label,
text,
x,
y, width,
NODE_DY,
nullptr, 0, 0, std::nullopt);
4148 if (use_auto_label && !
node.is_selected()) {
4161 const rctf &rct =
node.runtime->draw_bounds;
4169 tree_draw_ctx.
bmain,
4171 tree_draw_ctx.
scene,
4183 const bool selected =
node.is_selected();
4187 tree_draw_ctx.
bmain,
4189 tree_draw_ctx.
scene,
4193 block_draw(&
C, &block);
4203 const rctf &rct =
node.runtime->draw_bounds;
4211 tree_draw_ctx.
bmain,
4213 tree_draw_ctx.
scene,
4233 tree_draw_ctx.
bmain,
4235 tree_draw_ctx.
scene,
4239 block_draw(&
C, &block);
4261 if (
node.is_frame()) {
4265 else if (
node.is_type(
"NodeComment"_ustr)) {
4268 else if (
node.is_reroute()) {
4299 if (!
bounds.is_empty()) {
4307 for (
const float2 &pos : child_bounds) {
4314 const bNode *child_node = snode.
edittree->node_by_id(child_node_id);
4324 const rctf &draw_bounds = input_node->runtime->draw_bounds;
4325 rctf rect = draw_bounds;
4331 const rctf &draw_bounds = output_node->runtime->draw_bounds;
4332 rctf rect = draw_bounds;
4356 convex_indices.
resize(convex_positions_num);
4358 for (
const int i : convex_indices) {
4359 bounds.append(possible_bounds[i]);
4372 const int zones_num = zones ? zones->
zones.size() : 0;
4379 for (
const int zone_i :
IndexRange(zones_num)) {
4383 const Span<float2> boundary_positions = bounds_by_zone[zone_i];
4384 const int boundary_positions_num = boundary_positions.
size();
4385 if (boundary_positions_num < 3) {
4391 const float bounding_box_width = bounding_box.
max.x - bounding_box.
min.x;
4392 bounding_box_width_by_zone[zone_i] = bounding_box_width;
4399 for (
const int i : boundary_positions.
index_range()) {
4400 boundary_curve_positions[i] =
float3(boundary_positions[i], 0.0f);
4415 float line_width = 1.0f *
scale;
4416 float viewport[4] = {};
4419 const auto get_theme_id = [&](
const int zone_i) {
4430 using ZoneOrNode = std::variant<const bNodeTreeZone *, const bNode *>;
4432 for (
const int zone_i :
IndexRange(zones_num)) {
4435 for (
const bNode *
node : ntree.all_nodes()) {
4436 if (
node->is_frame()) {
4440 auto get_zone_or_node_width = [&](
const ZoneOrNode &zone_or_node) {
4441 if (
const bNodeTreeZone *
const *zone_p = std::get_if<const bNodeTreeZone *>(&zone_or_node)) {
4443 return bounding_box_width_by_zone[zone.
index];
4445 if (
const bNode *
const *node_p = std::get_if<const bNode *>(&zone_or_node)) {
4452 std::ranges::sort(draw_order, [&](
const ZoneOrNode &a,
const ZoneOrNode &
b) {
4454 return get_zone_or_node_width(a) > get_zone_or_node_width(
b);
4457 for (
const ZoneOrNode &zone_or_node : draw_order) {
4458 if (
const bNodeTreeZone *
const *zone_p = std::get_if<const bNodeTreeZone *>(&zone_or_node)) {
4460 const int zone_i = zone.
index;
4461 float zone_color[4];
4463 if (zone_color[3] == 0.0f) {
4466 if (!fillet_curve_by_zone[zone_i].has_value()) {
4470 const Span<float3> fillet_boundary_positions = fillet_curve_by_zone[zone_i]->positions();
4476 for (
const float3 &p : fillet_boundary_positions) {
4484 if (
const bNode *
const *node_p = std::get_if<const bNode *>(&zone_or_node)) {
4493 for (
const ZoneOrNode &zone_or_node : draw_order) {
4494 if (
const bNodeTreeZone *
const *zone_p = std::get_if<const bNodeTreeZone *>(&zone_or_node)) {
4496 const int zone_i = zone.
index;
4497 if (!fillet_curve_by_zone[zone_i].has_value()) {
4501 const Span<float3> fillet_boundary_positions = fillet_curve_by_zone[zone_i]->positions();
4511 get_theme_id(zone_i);
4515 for (
const float3 &p : fillet_boundary_positions) {
4523 if (
const bNode *
const *node_p = std::get_if<const bNode *>(&zone_or_node)) {
4539 for (
const bNode *
node : ntree.nodes_by_type(
"NodeFrame"_ustr)) {
4552 const float region_padding)
4561 BLI_rctf_pad(&inner_rect, -(region_padding + radius), -(region_padding + radius));
4573 std::array<float2, NODE_LINK_RESOL + 1> link_points;
4576 const float required_socket_distance =
UI_UNIT_X;
4579 const auto cost_function = [&](
const float2 &p) ->
float {
4580 const float distance_to_inner_rect = std::max(
BLI_rctf_length_x(&inner_rect, p.x),
4588 if (distance_to_socket < required_socket_distance) {
4589 return 1e5f + distance_to_center;
4594 std::sqrt(distance_to_center)
4598 + 10.0f * distance_to_inner_rect;
4606 std::optional<float2> best_position;
4607 for (
const int i :
IndexRange(link_points.size() - 1)) {
4608 float2 p0 = link_points[i];
4609 float2 p1 = link_points[i + 1];
4614 const float point_distance = 1.0f;
4617 const int points_to_check = std::max(2, 1 +
int(
length / point_distance));
4618 for (
const int j :
IndexRange(points_to_check)) {
4619 const float t =
float(j) / (points_to_check - 1);
4621 const float cost = cost_function(p);
4622 if (!best_position.has_value() || cost < best_cost) {
4628 return best_position;
4647 std::string error_tooltip;
4648 if (errors.
size() == 1) {
4649 error_tooltip = errors[0].tooltip;
4653 error_tooltip += fmt::format(
"\u2022 {}\n", error.tooltip);
4657 const float bg_radius =
UI_UNIT_X * 0.5f;
4658 const float bg_corner_radius =
UI_UNIT_X * 0.2f;
4660 const float region_padding =
UI_UNIT_X * 0.5f;
4664 region.
v2d, link, bg_radius, region_padding);
4665 if (!draw_position_opt.has_value()) {
4668 const int2 draw_position =
int2(draw_position_opt.value());
4676 alert_color.
a = std::min(alert_color.
a + 0.4f, 0.8f);
4685 ui::Button *but = uiDefIconBut(&invalid_links_block,
4687 ICON_STATUS_WARNING_FILLED,
4688 draw_position.x - icon_size / 2,
4689 draw_position.y - icon_size / 2,
4696 button_func_quick_tooltip_set(
4697 but, [tooltip = std::move(error_tooltip)](
const ui::Button * ) {
return tooltip; });
4708#define USE_DRAW_TOT_UPDATE
4718#ifdef USE_DRAW_TOT_UPDATE
4722 for (
const int i :
nodes.index_range()) {
4723#ifdef USE_DRAW_TOT_UPDATE
4734 for (
const bNodeLink *link : ntree.all_links()) {
4741 for (
const bNodeLink *link : ntree.all_links()) {
4754 for (
const int i :
nodes.index_range()) {
4756 if (
node.is_frame()) {
4766 if (
const bNodeLink *link = item.key.try_find(ntree)) {
4772 block_end(&
C, &invalid_links_block);
4773 block_draw(&
C, &invalid_links_block);
4786 const int x = rect->
xmin + padding_x;
4798 block_end(&
C, block);
4799 block_draw(&
C, block);
4827 for (
const bNode *index_switch_node : ntree.nodes_by_type(
"GeometryNodeIndexSwitch"_ustr)) {
4828 const bNodeSocket &index_socket = index_switch_node->input_socket(0);
4830 snode, compute_context_cache, index_socket);
4831 if (!compute_context) {
4835 {compute_context, &index_socket}, compute_context_cache);
4839 result.add(index_switch_node, menu_switch->node);
4847 ntree.ensure_topology_cache();
4868 log.ensure_node_warnings(*tree_draw_ctx.
bmain);
4869 log.ensure_execution_times();
4870 log.ensure_node_image_previews();
4883 C, *snode, compute_context_cache);
4901 for (
const int i :
nodes.index_range()) {
4904 C, tree_draw_ctx, *snode,
node);
4999 if (show_render_region) {
5000 int render_size_x, render_size_y;
5003 BLI_rcti_init(&render_region, 0, render_size_x, 0, render_size_y);
5016 float original_proj[4][4];
5060 int text_info_y_offset = 0;
5079 if (show_text_info) {
5080 int render_size_x, render_size_y;
5086 int yoffset = rect->
ymax - (0.4f *
UI_UNIT_Y) - text_info_y_offset;
5088 int viewer_size_x = 0;
5089 int viewer_size_y = 0;
5095 viewer_size_x = ibuf->
x;
5096 viewer_size_y = ibuf->
y;
5101 render_size_x, render_size_y, viewer_size_x, viewer_size_y, xoffset, yoffset);
5109 bool sidebar =
false;
Low-level operations for curves.
#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.
#define BLI_SCOPED_DEFER(function_to_defer)
#define STRNCPY_UTF8(dst, src)
#define CTX_IFACE_(context, msgid)
#define ID_IS_LINKED(_id)
#define ID_IS_EDITABLE(_id)
#define USER_EXPERIMENTAL_TEST(userdef, member)
#define NODE_GRID_STEP_SIZE
#define REGION_DRAW_POST_VIEW
#define REGION_DRAW_PRE_VIEW
Read Blender memory allocation and freeing.
#define UI_ALPHA_CHECKER_LIGHT
#define UI_ALPHA_CHECKER_DARK
#define BLI_assert_unreachable()
#define BLI_assert_unreachable_static_t(T)
#define STREQLEN(a, b, n)
#define POINTER_FROM_INT(i)
#define POINTER_AS_INT(i)
IndexRange index_range() const
const ComputeContextHash & hash() const
constexpr IndexRange()=default
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
bool contains(const Key &key) 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 const char * c_str() const
const char * c_str() const
StringRefNull ref() const
static VArray from_single(T value, const int64_t size)
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()
MutableSpan< int > offsets_for_write()
void fill_curve_types(CurveType type)
MutableSpan< bool > cyclic_for_write()
bNodeSocket * input_socket
std::optional< float > header_center_y
std::optional< bNodePanelExtent > content_extent
const nodes::SocketDeclaration * declaration
MultiValueMap< NodeLinkKey, NodeLinkError > link_errors
Set< const bNodeSocket * > sockets_on_active_gizmo_paths
Set< int > invalid_zone_output_node_ids
std::shared_ptr< bNodeTreeZones > last_valid_zones
Map< int32_t, VectorSet< nodes::NodeWarning > > shader_node_errors
Mutex shader_node_errors_mutex
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
constexpr bool startswith(StringRef prefix) const
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
NodeTreeLog * get_main_tree_log(const bke::bNodeTreeZone *zone) const
void foreach_tree_log(FunctionRef< void(NodeTreeLog &)> callback) const
Map< StringRefNull, NamedAttributeUsage > used_named_attributes
VectorSet< NodeWarning > warnings
Vector< StringRefNull > debug_messages
std::chrono::nanoseconds execution_time
void ensure_debug_messages()
void ensure_used_named_attributes()
NodeLog * find_node_log(int32_t identifier) const
static ContextualNodeTreeLogs get_contextual_tree_logs(const SpaceNode &snode)
#define storage(slot, qualifiers)
float length(VecOp< float, D >) RET
float3x3 scale(float3x3 mat, float2 scale)
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
Span< int > all_zone_node_types()
const bNodeInstanceKey NODE_INSTANCE_KEY_NONE
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)
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)
static void node_draw_sockets(const bContext &C, ui::Block &block, const SpaceNode &snode, const bNodeTree &ntree, const bNode &node)
static void reroute_node_draw_label(TreeDrawContext &tree_draw_ctx, const SpaceNode &snode, const bNode &node, ui::Block &block)
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)
static bool node_update_basis_buttons(const bContext &C, bNodeTree &ntree, bNode &node, FunctionRef< nodes::DrawNodeLayoutFn > draw_buttons, ui::Block &block, int &dy)
rctf node_frame_rect_inside(const SpaceNode &snode, const bNode &node)
int node_get_resize_cursor(NodeResizeDirection directions)
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)
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 draw_link_errors(const bContext &C, SpaceNode &snode, const bNodeLink &link, const Span< bke::NodeLinkError > errors, ui::Block &invalid_links_block)
static void node_draw_comment(const bContext &C, TreeDrawContext &tree_draw_ctx, ARegion ®ion, bNode &node, ui::Block &block)
static void tag_final_panel(bNode &node, const Span< FlatNodeItem > items)
static void node_update_basis(const bContext &C, TreeDrawContext &tree_draw_ctx, bNodeTree &ntree, bNode &node, ui::Block &block)
static float get_margin_between_elements(const Span< FlatNodeItem > items, const int next_index)
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])
static void node_draw_nodetree(const bContext &C, TreeDrawContext &tree_draw_ctx, ARegion ®ion, SpaceNode &snode, bNodeTree &ntree, Span< bNode * > nodes, Span< ui::Block * > blocks)
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)
std::optional< ObjectAndModifier > get_geometry_nodes_modifier_for_node_editor(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 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()
static void node_draw(const bContext &C, TreeDrawContext &tree_draw_ctx, ARegion ®ion, const SpaceNode &snode, bNodeTree &ntree, bNode &node, ui::Block &block)
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)
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)
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, ui::Block &block, const int &locx, int &locy)
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 void node_frame_get_color(const bNode &node, float r_color[4])
static NodeExtraInfoRow row_from_used_named_attribute(const Map< StringRefNull, nodes::eval_log::NamedAttributeUsage > &usage_by_attribute_name)
void node_socket_add_tooltip(const bNodeTree &ntree, const bNodeSocket &sock, ui::Layout &layout)
static const bNode * find_node_under_cursor(SpaceNode &snode, const float2 &cursor)
static bool is_node_panels_supported(const bNode &node)
void node_draw_link_dragged(const bContext &C, const View2D &v2d, const SpaceNode &snode, const bNodeLink &link)
static std::string node_errors_tooltip_fn(const Span< nodes::NodeWarning > warnings)
static void node_update_nodetree(const bContext &C, TreeDrawContext &tree_draw_ctx, bNodeTree &ntree, Span< bNode * > nodes, Span< ui::Block * > blocks)
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 Set< const bNodeSocket * > find_sockets_on_active_gizmo_paths(const bContext &C, const SpaceNode &snode, bke::ComputeContextCache &compute_context_cache)
static void node_draw_extra_info_row(const bNode &node, ui::Block &block, const rctf &rect, const int row, const NodeExtraInfoRow &extra_info_row)
static void node_draw_basis(const bContext &C, TreeDrawContext &tree_draw_ctx, const View2D &v2d, const SpaceNode &snode, bNodeTree &ntree, const bNode &node, ui::Block &block)
static void draw_background_color()
static void node_update_collapsed(bNode &node, ui::Block &block)
void build_socket_tooltip(ui::TooltipData &tip_data, bContext &C, ui::Button *but, const bNodeTree &tree, const bNodeSocket &socket)
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 determine_potentially_visible_panels_recursive(const bNode &node, const nodes::PanelDeclaration &panel_decl, MutableSpan< bool > r_result)
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 node_comment_edit_button_cb(bContext *C, void *node_argv, void *)
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_extra_info_panel_back(const bNode &node, const rctf &extra_info_rect)
static void count_multi_input_socket_links(bNodeTree &ntree, SpaceNode &snode)
static void node_draw_preview(const Scene *scene, const ImBuf *preview, const rctf *prv)
static void snode_setup_v2d(SpaceNode &snode, ARegion ®ion, const float2 ¢er, const float size_x)
static void determine_visible_panels(const bNode &node, MutableSpan< bool > r_visibility_states)
static void node_header_custom_tooltip(const bNodeTree &ntree, const bNode &node, ui::Button &but)
static ui::Button * add_error_message_button(ui::Block &block, const rctf &rect, const int icon, float &icon_offset, const char *tooltip=nullptr)
static void node_draw_collapsed(const bContext &C, TreeDrawContext &tree_draw_ctx, const View2D &v2d, const SpaceNode &snode, bNodeTree &ntree, bNode &node, ui::Block &block)
static void node_draw_extra_info_panel(const bContext &C, TreeDrawContext &tree_draw_ctx, const SpaceNode &snode, const bNode &node, const ImBuf *preview, ui::Block &block)
static void node_frame_get_label_color(const float bgcolor[4], uchar r_color[3])
static void node_socket_tooltip_set(ui::Block &block, const int socket_index_in_tree, const float2 location, const float2 size)
void tree_update(const bContext *C)
static std::string node_get_execution_time_label(TreeDrawContext &tree_draw_ctx, const SpaceNode &snode, const bNode &node)
static void node_add_error_message_button(const TreeDrawContext &tree_draw_ctx, const bNodeTree &ntree, const bNode &node, ui::Block &block, const rctf &rect, float &icon_offset)
static ui::Block & invalid_links_uiblock_init(const bContext &C)
static void reroute_node_draw_body(const bContext &C, const SpaceNode &snode, const bNodeTree &ntree, const bNode &node, ui::Block &block, const bool selected)
const char * node_socket_get_label(const bNodeSocket *socket, const char *panel_label=nullptr)
static Array< ui::Block * > node_uiblocks_init(const bContext &C, const Span< bNode * > nodes)
void nodesocket_batch_end()
static void node_update_basis_from_declaration(TreeDrawContext &tree_draw_ctx, const bContext &C, bNodeTree &ntree, bNode &node, ui::Block &block, const int locx, int &locy)
static short get_viewer_shortcut_icon(const bNode &node)
Array< bNode * > tree_draw_order_calc_nodes(bNodeTree &ntree)
static void node_socket_add_tooltip_in_node_editor(const bNodeSocket &sock, ui::Layout &layout)
static void update_collapsed_sockets_recursive(bNode &node, const int node_left_x, const nodes::PanelDeclaration &panel_decl)
static void frame_node_draw_overlay(const bContext &C, TreeDrawContext &tree_draw_ctx, const ARegion ®ion, const SpaceNode &snode, const bNode &node, ui::Block &block)
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 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)
static std::optional< NodeExtraInfoRow > node_get_execution_time_label_row(TreeDrawContext &tree_draw_ctx, const SpaceNode &snode, const bNode &node)
static void reroute_node_draw(const bContext &C, TreeDrawContext &tree_draw_ctx, ARegion ®ion, const SpaceNode &snode, bNodeTree &ntree, const bNode &node, ui::Block &block)
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)
static void node_draw_panels(bNodeTree &ntree, const bNode &node, ui::Block &block)
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)
static void draw_frame_overlays(const bContext &C, TreeDrawContext &tree_draw_ctx, const ARegion ®ion, const SpaceNode &snode, const bNodeTree &ntree, Span< ui::Block * > blocks)
float2 socket_link_connection_location(const bNode &node, const bNodeSocket &socket, const bNodeLink &link)
static void frame_node_draw_label(const bNode &node, const SpaceNode &snode)
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_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)
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)
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_shadow(const SpaceNode &snode, const bNode &node, const float radius, const float alpha)
const char * node_socket_get_description(const bNodeSocket *socket)
static bool node_undefined_or_unsupported(const bNodeTree &node_tree, const bNode &node)
static void draw_tree_path(const bContext &C, ARegion ®ion)
static float get_margin_empty()
static void comment_node_prepare_for_draw(const bContext &C, bNodeTree &ntree, bNode &node, ui::Block &block)
static void node_draw_socket(const bContext &C, const bNodeTree &ntree, const bNode &node, PointerRNA &node_ptr, ui::Block &block, const bNodeSocket &sock, const float outline_thickness, const bool selected, const float aspect)
static void draw_socket_layout(TreeDrawContext &tree_draw_ctx, const bContext &C, ui::Layout &layout, bNodeSocket &socket, bNodeTree &ntree, bNode &node, PointerRNA &node_ptr, PointerRNA &socket_ptr, const char *panel_label)
static StringRef reroute_node_get_auto_label(TreeDrawContext &tree_draw_ctx, const bNode &src_reroute)
std::optional< Bounds< float2 > > node_bounds(Span< const bNode * > nodes)
static nodes::NodeWarningType node_error_highest_priority(const WarningsRange &warnings)
static void draw_nodetree(const bContext &C, ARegion ®ion, bNodeTree &ntree)
static void node_update_basis_from_socket_lists(TreeDrawContext &tree_draw_ctx, const bContext &C, bNodeTree &ntree, bNode &node, ui::Block &block, const int locx, int &locy)
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 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)
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)
int node_warning_type_severity(const NodeWarningType type)
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)
void get_color_blend_alpha_4fv(const float cp1[4], const float cp2[4], float fac, float alphaoffset, float r_col[4])
int get_value_type(int colorid, int spacetype)
void get_color_3fv(int colorid, float col[3])
void get_color_4fv(int colorid, float col[4])
void get_color_blend_shade_3fv(int colorid1, int colorid2, float fac, int offset, float col[3])
void get_color_shade_4fv(int colorid, int offset, float col[4])
void get_color_blend_shade_4fv(int colorid1, int colorid2, float fac, int offset, float col[4])
void get_color_blend_3f(int colorid1, int colorid2, float fac, float r_col[3])
void get_color_blend_4f(int colorid1, int colorid2, float fac, float r_col[4])
void get_color_shade_alpha_4fv(int colorid, int coloffset, int alphaoffset, float col[4])
void get_color_type_4fv(int colorid, int spacetype, float col[4])
void view2d_view_ortho(const View2D *v2d)
int textbox_but_height(const TextboxState &state)
const uiStyle * style_get()
void view2d_view_restore(const bContext *C)
void draw_dropshadow(const rctf *rct, float radius, float width, float aspect, float alpha)
void view2d_center_set(View2D *v2d, float x, float y)
const uiStyle * style_get_dpi()
void view2d_scrollers_draw(View2D *v2d, const rcti *mask_custom)
void view2d_region_to_view(const View2D *v2d, float x, float y, float *r_view_x, float *r_view_y) ATTR_NONNULL()
void view2d_dot_grid_draw(const View2D *v2d, int grid_color_id, float min_step, int grid_subdivisions)
void draw_roundbox_corner_set(int type)
void view2d_center_get(const View2D *v2d, float *r_x, float *r_y)
bool button_active_only(const bContext *C, ARegion *region, Block *block, Button *but)
void draw_roundbox_aa(const rctf *rect, bool filled, float rad, const float color[4])
void 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)
int2 block_layout_resolve(Block *block)
Layout & block_layout(Block *block, LayoutDirection direction, LayoutType type, int x, int y, int size, int em, int padding, const uiStyle *style)
void template_breadcrumbs(Layout &layout, Span< ContextPathItem > context_path)
void view2d_scale_get(const View2D *v2d, float *r_x, float *r_y)
void draw_roundbox_4fv(const rctf *rect, bool filled, float rad, const float col[4])
MINLINE float min_ff(float a, float b)
bool ED_node_is_compositor(const SpaceNode *snode)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
unsigned __int64 uint64_t
ScrArea * CTX_wm_area(const bContext *C)
void wmOrtho2_region_pixelspace(const ARegion *region)
void ED_region_draw_cb_draw(const bContext *C, ARegion *region, int type)
void immUniformThemeColorBlend(int color_id1, int color_id2, float fac)
uint padding(uint offset, uint alignment)
void BLF_aspect(int fontid, float x, float y, float z)
void BLF_position(int fontid, float x, float y, float z)
float BLI_rctf_length_y(const rctf *rect, float y)
bool BLI_rctf_clamp_segment(const struct rctf *rect, float s1[2], float s2[2])
int char char int int int BLI_strcasecmp_natural(const char *s1, const char *s2) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
float BLF_width(int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(2)
bool BLI_rctf_isect_pt_v(const struct rctf *rect, const float xy[2])
bool RNA_struct_is_a(const StructRNA *type, const StructRNA *srna)
void GPU_clear_color(float red, float green, float blue, float alpha)
WorkSpace * CTX_wm_workspace(const bContext *C)
void wmOrtho2_pixelspace(const float x, const float y)
MINLINE int round_fl_to_int(float a)
std::optional< std::string > RNA_path_full_struct_py(const PointerRNA *ptr)
void WM_operator_properties_free(PointerRNA *ptr)
void BLF_wordwrap(int fontid, int wrap_width, BLFWrapMode mode=BLFWrapMode::Minimal)
Depsgraph * CTX_data_depsgraph_pointer(const bContext *C)
void GPU_matrix_identity_set()
MINLINE void copy_v2_v2(float r[2], const float a[2])
GPUVertFormat * immVertexFormat()
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
void rgb_to_hsl_v(const float rgb[3], float r_hsl[3])
void ED_region_overlay_info_text_draw(const int render_size_x, const int render_size_y, const int viewer_size_x, const int viewer_size_y, const int draw_offset_x, const int draw_offset_y)
void ED_draw_imbuf(const ImBuf *ibuf, float x, float y, bool use_filter, const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings, float zoom_x, float zoom_y)
void BLI_rctf_resize(struct rctf *rect, float x, float y)
void immBegin(GPUPrimType, uint vertex_len)
void GPU_line_smooth(bool enable)
wmWindow * CTX_wm_window(const bContext *C)
const rcti * ED_region_visible_rect(ARegion *region)
void immUniformThemeColorAlpha(int color_id, float a)
MINLINE void rgb_float_to_uchar(unsigned char r_col[3], const float col_f[3])
MINLINE float srgb_to_grayscale(const float rgb[3])
void BLF_disable(int fontid, FontFlags flag)
void MEM_delete_void(void *vmemh)
void BKE_render_resolution(const RenderData *r, const bool use_crop, int *r_width, int *r_height)
MINLINE void mul_v3_fl(float r[3], float f)
void GPU_line_width(float width)
int BLI_convexhull_2d(Span< float2 > points, int r_points[])
VecBase< float, 4 > float4
void immBindBuiltinProgram(GPUBuiltinShader shader_id)
PointerRNA WM_operator_properties_create(const char *opstring)
void BLF_size(int fontid, float size)
void BLI_rctf_init_pt_radius(struct rctf *rect, const float xy[2], float size)
bool BLI_rctf_is_empty(const struct rctf *rect)
void BLI_rctf_mul(struct rctf *rect, float factor)
void * MEM_dupalloc_void(const void *vmemh) ATTR_WARN_UNUSED_RESULT
VecBase< int32_t, 2 > int2
VecBase< float, 2 > float2
void immUniform1f(const char *name, float x)
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
void GPU_viewport_size_get_f(float coords[4])
BMesh const char void * data
void BLF_color3ubv(int fontid, const unsigned char rgb[3])
@ GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR
@ GPU_SHADER_3D_UNIFORM_COLOR
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
bool BLI_rctf_isect_pt(const struct rctf *rect, float x, float y)
void BKE_main_ensure_invariants(Main &bmain, std::optional< Span< ID * > > modified_ids=std::nullopt)
void BLI_rctf_init_minmax(struct rctf *rect)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
void BLF_clipping(int fontid, int xmin, int ymin, int xmax, int ymax)
SpaceNode * CTX_wm_space_node(const bContext *C)
wmOperatorStatus WM_operator_name_call(bContext *C, const char *opstring, wm::OpCallContext context, PointerRNA *properties, const wmEvent *event)
void GPU_framebuffer_bind_no_srgb(gpu::FrameBuffer *fb)
void GPU_matrix_projection_set(const float m[4][4])
void BLF_draw(int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_NONNULL(2)
uint GPU_vertformat_attr_add(GPUVertFormat *format, StringRef name, gpu::VertAttrType type)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
bool BKE_scene_uses_shader_previews(const Scene *scene)
void BLI_rctf_union(struct rctf *rct_a, const struct rctf *rct_b)
void hsl_to_rgb_v(const float hsl[3], float r_rgb[3])
void BLI_rcti_init(struct rcti *rect, int xmin, int xmax, int ymin, int ymax)
ImBuf * BKE_image_acquire_ibuf(Image *ima, ImageUser *iuser, void **r_lock)
BLI_INLINE float BLI_rcti_cent_x_fl(const struct rcti *rct)
void id_us_ensure_real(ID *id)
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)
void immVertex3fv(uint attr_id, const float data[3])
gpu::FrameBuffer * GPU_viewport_framebuffer_overlay_get(GPUViewport *viewport)
int BLF_height_max(int fontid) ATTR_WARN_UNUSED_RESULT
float BLI_rctf_length_x(const rctf *rect, float x)
void immUniform4f(const char *name, float x, float y, float z, float w)
Main * CTX_data_main(const bContext *C)
void GPU_matrix_pop_projection()
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
@ NODE_VIEWER_SHORCTUT_SLOT_9
@ NODE_VIEWER_SHORCTUT_SLOT_8
@ NODE_VIEWER_SHORCTUT_SLOT_1
@ NODE_VIEWER_SHORCTUT_SLOT_5
@ NODE_VIEWER_SHORCTUT_SLOT_6
@ NODE_VIEWER_SHORTCUT_NONE
@ NODE_VIEWER_SHORCTUT_SLOT_4
@ NODE_VIEWER_SHORCTUT_SLOT_3
@ NODE_VIEWER_SHORCTUT_SLOT_2
@ NODE_VIEWER_SHORCTUT_SLOT_7
bool BLI_rctf_isect(const struct rctf *src1, const struct rctf *src2, struct rctf *dest)
Image * BKE_image_ensure_viewer(Main *bmain, int type, const char *name)
BLI_INLINE float BLI_rctf_cent_y(const struct rctf *rct)
void WM_gizmomap_draw(wmGizmoMap *gzmap, const bContext *C, const eWM_GizmoFlagMapDrawStep drawstep)
Scene * CTX_data_scene(const bContext *C)
void immUniform2fv(const char *name, const float data[2])
void WM_cursor_set(wmWindow *win, int curs)
void ED_annotation_draw_view2d(const bContext *C, bool onlyv2d)
MINLINE void copy_v4_v4(float r[4], const float a[4])
ColorTheme4< float > ColorTheme4f
void GPU_blend(GPUBlend blend)
void immUniform1i(const char *name, int x)
VecBase< float, 3 > float3
const float(* GPU_matrix_projection_get(float m[4][4]))[4]
void GPU_matrix_push_projection()
GPUViewport * WM_draw_region_get_viewport(ARegion *region)
MINLINE int min_ii(int a, int b)
void GPU_depth_test(GPUDepthTest test)
void immRectf(uint pos, float x1, float y1, float x2, float y2)
BLI_INLINE float BLI_rcti_cent_y_fl(const struct rcti *rct)
ARegion * CTX_wm_region(const bContext *C)
BLI_INLINE float BLI_rctf_cent_x(const struct rctf *rct)
void BLI_rctf_pad(struct rctf *rect, float pad_x, float pad_y)
void BLF_enable(int fontid, FontFlags flag)
void ED_region_render_region_draw(int x, int y, const rcti *frame, float zoomx, float zoomy, float passepartout_alpha)
@ WM_GIZMOMAP_DRAWSTEP_2D
@ SN_OVERLAY_SHOW_TEXT_INFO
@ SN_OVERLAY_SHOW_OVERLAYS
@ SN_OVERLAY_SHOW_TIMINGS
@ SN_OVERLAY_SHOW_REROUTE_AUTO_LABELS
@ SN_OVERLAY_SHOW_PREVIEWS
@ SN_OVERLAY_SHOW_RENDER_REGION
@ SN_OVERLAY_SHOW_NAMED_ATTRIBUTES
void BKE_image_release_ibuf(Image *ima, ImBuf *ibuf, void *lock)
MINLINE void rgba_float_args_set(float col[4], float r, float g, float b, float a)
#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
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
bke::ARegionRuntime * runtime
eRegion_Alignment alignment
ColorManagedViewSettings view_settings
ColorManagedDisplaySettings display_settings
ListBaseT< ARegion > regionbase
eSpaceNodeOverlay_Flag flag
struct bNodeTree * edittree
struct bNodeTree * nodetree
ListBaseT< bNodeTreePath > treepath
ed::space_node::SpaceNode_Runtime * runtime
bke::bNodeSocketType * typeinfo
bke::bNodeSocketRuntime * runtime
eNodeSocketDisplayShape display_shape
struct bNodeTree * nodetree
bNodeInstanceKey parent_key
bke::bNodeTreeRuntime * runtime
bke::bNodeRuntime * runtime
void(*) draw_color(bContext *C, PointerRNA *ptr, PointerRNA *node_ptr, float *r_color)
void(*) draw_color_simple(const bNodeSocketType *socket_type, float *r_color)
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
NestedTreePreviews * nested_group_infos
const bNode * active_geometry_nodes_viewer
Array< Vector< NodeExtraInfoRow > > extra_info_rows_per_node
nodes::eval_log::ContextualNodeTreeLogs tree_logs
Map< const bNode *, const bNode * > menu_switch_source_by_index_switch
Map< const bNode *, StringRef > reroute_auto_labels
Map< int32_t, VectorSet< nodes::NodeWarning > > shader_node_errors
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 draw_standard(ui::Layout &layout, std::optional< StringRefNull > label_override=std::nullopt)
void enabled_set(bool enabled)
void alignment_set(LayoutAlign alignment)
void active_set(bool active)
void separator(float factor=1.0f, LayoutSeparatorType type=LayoutSeparatorType::Auto)
void label_markdown(StringRef text)
void context_ptr_set(StringRef name, const PointerRNA *ptr)
bke::WindowRuntime * runtime