Blender V4.5
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
17#include "NOD_nested_node_id.hh"
18
19#include "ED_node_c.hh"
20
21struct SpaceNode;
22struct ARegion;
23struct Main;
24struct bContext;
25struct bNodeSocket;
26struct bNodeTree;
27struct Object;
28struct rcti;
29struct rctf;
31struct uiLayout;
32
33namespace blender::bke {
34class bNodeTreeZone;
35}
36
38
39void tree_update(const bContext *C);
40void tag_update_id(ID *id);
41
42float grid_size_get();
43
45void snode_set_context(const bContext &C);
46
48
54 const ARegion &region,
55 bool attach_enabled,
56 bool is_new_node);
57
61void node_insert_on_frame_flag_set(bContext &C, SpaceNode &snode, const int2 &cursor);
63
67void node_insert_on_link_flags(Main &bmain, SpaceNode &snode, bool is_new_node);
69
73void node_socket_draw(bNodeSocket *sock, const rcti *rect, const float color[4], float scale);
74void node_draw_nodesocket(const rctf *rect,
75 const float color_inner[4],
76 const float color_outline[4],
77 float outline_thickness,
78 int shape,
79 float aspect);
80
81void std_node_socket_colors_get(int socket_type, float *r_color);
82
86std::optional<nodes::FoundNestedNodeID> find_nested_node_id_in_root(const SpaceNode &snode,
87 const bNode &node);
88std::optional<nodes::FoundNestedNodeID> find_nested_node_id_in_root(
89 const bNodeTree &root_tree, const ComputeContext *compute_context, const int node_id);
90
95
98std::optional<ObjectAndModifier> get_modifier_for_node_editor(const SpaceNode &snode);
99
101 const Object &object,
102 const NodesModifierData &nmd);
103
109 const SpaceNode &snode, bke::ComputeContextCache &compute_context_cache);
110
115 const SpaceNode &snode,
116 bke::ComputeContextCache &compute_context_cache,
117 const bNodeSocket &socket);
118
120 const SpaceNode &snode, bke::ComputeContextCache &compute_context_cache, const bNode &node);
121
128 const ComputeContext *closure_socket_context,
129 const bNodeSocket &closure_socket,
130 bke::ComputeContextCache &compute_context_cache,
131 const std::optional<nodes::ClosureSourceLocation> &source_location);
132
137[[nodiscard]] const ComputeContext *compute_context_for_zone(
138 const bke::bNodeTreeZone &zone,
139 bke::ComputeContextCache &compute_context_cache,
140 const ComputeContext *parent_compute_context);
141
143 const bContext &C,
144 StringRef catalog_path);
145
146} // namespace blender::ed::space_node
#define C
Definition RandGen.cpp:29
void tag_update_id(ID *id)
Definition node_draw.cc:194
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 ui_template_node_asset_menu_items(uiLayout &layout, const bContext &C, StringRef catalog_path)
void std_node_socket_colors_get(int socket_type, float *r_color)
Definition drawnode.cc:996
const ComputeContext * compute_context_for_edittree(const SpaceNode &snode, bke::ComputeContextCache &compute_context_cache)
void node_insert_on_frame_flag_set(bContext &C, SpaceNode &snode, const int2 &cursor)
void tree_update(const bContext *C)
Definition node_draw.cc:169
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:726
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)
const ComputeContext * compute_context_for_closure_evaluation(const ComputeContext *closure_socket_context, const bNodeSocket &closure_socket, bke::ComputeContextCache &compute_context_cache, const std::optional< nodes::ClosureSourceLocation > &source_location)
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:1826
void node_insert_on_link_flags(Main &bmain, SpaceNode &snode, bool is_new_node)
VecBase< int32_t, 2 > int2
Definition DNA_ID.h:404
const NodesModifierData * nmd
Definition ED_node.hh:93