21#include "RNA_prototypes.hh"
47 if (!socket.is_available()) {
50 if (socket.is_directly_linked()) {
56 if (socket.
typeinfo->draw ==
nullptr) {
63 if (node.is_reroute()) {
71 node_ptr->
owner_id, &RNA_NodeSocket, &socket);
74 socket.
typeinfo->draw(
C, row, &socket_ptr, node_ptr, text);
81 if (
const auto *socket_decl =
dynamic_cast<const SocketDeclaration *
>(item_decl)) {
82 if (socket_decl->in_out ==
SOCK_OUT) {
85 const bNodeSocket &socket = node.socket_by_decl(*socket_decl);
86 if (!socket.is_inactive()) {
90 else if (
const auto *sub_panel_decl =
dynamic_cast<const PanelDeclaration *
>(item_decl)) {
106 const std::string panel_idname =
"NodePanel" + std::to_string(panel_decl.
identifier);
119 if (
const auto *socket_decl =
dynamic_cast<const SocketDeclaration *
>(item_decl)) {
120 if (socket_decl->in_out ==
SOCK_IN) {
124 else if (
const auto *sub_panel_decl =
dynamic_cast<const PanelDeclaration *
>(item_decl)) {
127 else if (
const auto *layout_decl =
dynamic_cast<const LayoutDeclaration *
>(item_decl)) {
128 if (!layout_decl->is_default) {
129 layout_decl->draw(panel.
body,
C, node_ptr);
143 tree.ensure_topology_cache();
147 if (node.
typeinfo->draw_buttons_ex) {
150 else if (node.
typeinfo->draw_buttons) {
154 if (node.declaration()) {
158 if (
const auto *panel_decl =
dynamic_cast<const PanelDeclaration *
>(item_decl)) {
161 else if (
const auto *socket_decl =
dynamic_cast<const SocketDeclaration *
>(item_decl)) {
162 bNodeSocket &socket = node.socket_by_decl(*socket_decl);
163 if (socket_decl->custom_draw_fn) {
172 (*socket_decl->custom_draw_fn)(
params);
174 else if (socket_decl->in_out ==
SOCK_IN) {
178 else if (
const auto *layout_decl =
dynamic_cast<const LayoutDeclaration *
>(item_decl)) {
179 if (!layout_decl->is_default) {
180 layout_decl->draw(layout,
C,
ptr);
#define CTX_IFACE_(context, msgid)
void uiLayoutSetActive(uiLayout *layout, bool active)
Vector< ItemDeclaration * > root_items
std::optional< std::string > translation_context
Vector< ItemDeclaration * > items
StringRefNull node_socket_label(const bNodeSocket &sock)
static void draw_node_input(bContext *C, uiLayout *layout, PointerRNA *node_ptr, bNodeSocket &socket)
static bool panel_has_used_inputs(const bNode &node, const blender::nodes::PanelDeclaration &panel_decl)
static void draw_node_inputs_recursive(bContext *C, uiLayout *layout, bNode &node, PointerRNA *node_ptr, const blender::nodes::PanelDeclaration &panel_decl)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
bNodeSocketTypeHandle * typeinfo
bNodeTypeHandle * typeinfo
bNodeRuntimeHandle * runtime
PanelLayout panel(const bContext *C, blender::StringRef idname, bool default_closed)
void label(blender::StringRef name, int icon)
uiLayout & row(bool align)