Blender V5.0
ED_node.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
7#include <optional>
8
11#include "BLI_string_ref.hh"
12#include "BLI_vector_set.hh"
13
15
19#include "NOD_nested_node_id.hh"
20
21#include "ED_node_c.hh"
22
24
25struct SpaceNode;
26struct ARegion;
27struct Main;
28struct bContext;
29struct bNodeSocket;
30struct bNodeTree;
31struct Object;
32struct rcti;
33struct rctf;
35struct uiLayout;
36
37namespace blender::bke {
38class bNodeTreeZone;
39}
40
42
43void tree_update(const bContext *C);
44void tag_update_id(ID *id);
45
46float grid_size_get();
47
49void snode_set_context(const bContext &C);
50
52
58 const ARegion &region,
59 bool attach_enabled,
60 bool is_new_node);
61
65void node_insert_on_frame_flag_set(bContext &C, SpaceNode &snode, const int2 &cursor);
67
71void node_insert_on_link_flags(Main &bmain, SpaceNode &snode, bool is_new_node);
73
77void node_socket_draw(bNodeSocket *sock, const rcti *rect, const float color[4], float scale);
78void node_draw_nodesocket(const rctf *rect,
79 const float color_inner[4],
80 const float color_outline[4],
81 float outline_thickness,
82 int shape,
83 float aspect);
84
85void std_node_socket_colors_get(int socket_type, float *r_color);
86
90std::optional<nodes::FoundNestedNodeID> find_nested_node_id_in_root(const SpaceNode &snode,
91 const bNode &node);
92std::optional<nodes::FoundNestedNodeID> find_nested_node_id_in_root(
93 const bNodeTree &root_tree, const ComputeContext *compute_context, const int node_id);
94
99
102std::optional<ObjectAndModifier> get_modifier_for_node_editor(const SpaceNode &snode);
103
105 const Object &object,
106 const NodesModifierData &nmd);
107
113 const SpaceNode &snode, bke::ComputeContextCache &compute_context_cache);
114
119 const SpaceNode &snode,
120 bke::ComputeContextCache &compute_context_cache,
121 const bNodeSocket &socket);
122
124 const SpaceNode &snode, bke::ComputeContextCache &compute_context_cache, const bNode &node);
125
130[[nodiscard]] const ComputeContext *compute_context_for_zone(
131 const bke::bNodeTreeZone &zone,
132 bke::ComputeContextCache &compute_context_cache,
133 const ComputeContext *parent_compute_context);
134[[nodiscard]] const ComputeContext *compute_context_for_zones(
136 bke::ComputeContextCache &compute_context_cache,
137 const ComputeContext *parent_compute_context);
138
140 const bContext &C,
141 StringRef catalog_path,
142 const NodeAssetMenuOperatorType operator_type);
143
146
148
149const char *node_socket_get_label(const bNodeSocket *socket, const char *panel_label = nullptr);
150
151} // namespace blender::ed::space_node
#define C
Definition RandGen.cpp:29
NodeAssetMenuOperatorType
KDTree_3d * tree
void tag_update_id(ID *id)
Definition node_draw.cc:211
const ComputeContext * compute_context_for_edittree_socket(const SpaceNode &snode, bke::ComputeContextCache &compute_context_cache, const bNodeSocket &socket)
void node_insert_on_link_flags_set(SpaceNode &snode, const ARegion &region, bool attach_enabled, bool is_new_node)
void node_socket_draw(bNodeSocket *sock, const rcti *rect, const float color[4], float scale)
std::optional< nodes::FoundNestedNodeID > find_nested_node_id_in_root(const SpaceNode &snode, const bNode &node)
void std_node_socket_colors_get(int socket_type, float *r_color)
Definition drawnode.cc:974
void ui_template_node_asset_menu_items(uiLayout &layout, const bContext &C, StringRef catalog_path, const NodeAssetMenuOperatorType operator_type)
const ComputeContext * compute_context_for_edittree(const SpaceNode &snode, bke::ComputeContextCache &compute_context_cache)
void node_tree_interface_draw(bContext &C, uiLayout &layout, bNodeTree &tree)
void node_insert_on_frame_flag_set(bContext &C, SpaceNode &snode, const int2 &cursor)
void tree_update(const bContext *C)
Definition node_draw.cc:186
const char * node_socket_get_label(const bNodeSocket *socket, const char *panel_label=nullptr)
Definition node_draw.cc:453
VectorSet< bNode * > get_selected_nodes(bNodeTree &node_tree)
const ComputeContext * compute_context_for_zone(const bke::bNodeTreeZone &zone, bke::ComputeContextCache &compute_context_cache, const ComputeContext *parent_compute_context)
void node_insert_on_link_flags_clear(bNodeTree &node_tree)
std::optional< ObjectAndModifier > get_modifier_for_node_editor(const SpaceNode &snode)
void snode_set_context(const bContext &C)
Definition node_edit.cc:682
Map< int, bool > & node_can_sync_cache_get(SpaceNode &snode)
const ComputeContext * compute_context_for_zones(const Span< const bke::bNodeTreeZone * > zones, bke::ComputeContextCache &compute_context_cache, const ComputeContext *parent_compute_context)
bool node_editor_is_for_geometry_nodes_modifier(const SpaceNode &snode, const Object &object, const NodesModifierData &nmd)
void node_insert_on_frame_flag_clear(SpaceNode &snode)
const ComputeContext * compute_context_for_edittree_node(const SpaceNode &snode, bke::ComputeContextCache &compute_context_cache, const bNode &node)
void node_draw_nodesocket(const rctf *rect, const float color_inner[4], const float color_outline[4], float outline_thickness, int shape, float aspect)
Definition drawnode.cc:1805
void node_insert_on_link_flags(Main &bmain, SpaceNode &snode, bool is_new_node)
VecBase< int32_t, 2 > int2
Definition DNA_ID.h:414
const NodesModifierData * nmd
Definition ED_node.hh:97