33 #include "RNA_prototypes.h"
88 bNodeLink *oplink = MEM_cnew<bNodeLink>(__func__);
140 const float cursor_link_touch_distance = 12.5f *
UI_DPI_FAC;
147 if (link->tosock == socket) {
154 vec[0][0], vec[1][0], vec[2][0], vec[3][0],
data, resolution,
sizeof(
float[2]));
156 vec[0][1], vec[1][1], vec[2][1], vec[3][1],
data + 1, resolution,
sizeof(
float[2]));
158 for (
int i = 0; i < resolution * 2; i += 2) {
159 float *l1 = &
data[i];
160 float *l2 = &
data[i + 2];
162 if (
distance < cursor_link_touch_distance) {
175 if (last_picked_link) {
176 link_to_pick = last_picked_link;
210 const bool allow_multiple)
218 if (sock->flag &
SELECT) {
230 if (sock->type == sock_target->
type) {
231 if (
STREQ(sock->name, sock_target->
name)) {
244 if (sock->type == sock_target->
type) {
264 maxtype =
max_ii(sock->type, maxtype);
269 for (
int socktype = maxtype; socktype >= 0; socktype--) {
276 if (sock->type == socktype) {
325 if (link->tosock == socket) {
329 link->multi_input_socket_index,
330 link->tosock->total_inputs)});
336 link_and_position.
link = drag_link;
338 link_and_position.multi_socket_position = *cursor;
340 links.
append(link_and_position);
344 return a.multi_socket_position.y < b.multi_socket_position.y;
348 links[i].link->multi_input_socket_index = i;
366 return a->locx < b->locx;
370 for (
const int i : sorted_nodes.
as_mutable_span().drop_back(1).index_range()) {
371 bool has_selected_inputs =
false;
373 bNode *node_fr = sorted_nodes[i];
374 bNode *node_to = sorted_nodes[i + 1];
382 if (sock_to->flag &
SELECT) {
383 has_selected_inputs =
true;
401 if (!has_selected_inputs) {
405 for (
int i = 0; i < num_inputs; i++) {
430 namespace viewer_linking {
442 if (socket.
idname() ==
"NodeSocketVirtual") {
459 switch (socket_type) {
489 if (viewer_socket->type == src_socket.
type) {
491 return viewer_socket;
499 return viewer_socket;
528 return socket.
index() == 0;
534 if (&target_socket->node() != &viewer_node) {
537 if (!target_socket->is_available()) {
556 if (link->tonode == &viewer_node) {
569 for (
const NodeRef *viewer_node : viewer_nodes) {
578 return viewer_nodes[0];
589 if (output_socket->bsocket()->flag &
SELECT) {
590 return output_socket;
595 if (active_viewer_node !=
nullptr) {
601 last_socket_linked_to_viewer = output_socket;
605 if (last_socket_linked_to_viewer ==
nullptr) {
609 return output_socket;
617 const int index = (last_socket_linked_to_viewer->
index() +
offset) % tot_outputs;
625 return &output_socket;
633 bNode &bnode_to_view,
639 if (viewer_bnode ==
nullptr) {
649 if (viewer_bnode ==
nullptr) {
655 if (viewer_bsocket ==
nullptr) {
661 if (link->tosock == viewer_bsocket) {
662 link_to_change = link;
667 if (link_to_change ==
nullptr) {
668 nodeAddLink(&btree, &bnode_to_view, &bsocket_to_view, viewer_bnode, viewer_bsocket);
671 link_to_change->
fromnode = &bnode_to_view;
672 link_to_change->
fromsock = &bsocket_to_view;
697 if (socket_to_view ==
nullptr) {
702 bNode *viewer_bnode = active_viewer_node ? active_viewer_node->
bnode() :
nullptr;
746 ot->
name =
"Link to Viewer Node";
816 const uchar text_col[4] = {255, 255, 255, 255};
845 BLI_strncpy(header,
TIP_(
"LMB: drag node link, RMB: cancel"),
sizeof(header));
853 if (
ELEM(&socket, link->fromsock, link->tosock)) {
871 if (tlink == &link) {
875 if (tlink && tlink->fromsock == &
from) {
876 if (from_count > from_link_limit) {
883 if (tlink && tlink->tosock == &to) {
884 if (to_count > to_link_limit) {
889 else if (tlink->fromsock == &
from) {
946 snode.
runtime->linkdrag.reset();
960 if (tnode && link->
fromnode == tnode) {
965 bNodeLink *existing_link_connected_to_fromsock =
nullptr;
967 if (existing_link->fromsock == link->
fromsock && existing_link->tosock == tsock) {
968 existing_link_connected_to_fromsock = existing_link;
977 if (existing_link_connected_to_fromsock) {
1008 if (tnode && link->
tonode == tnode) {
1038 nldrag->
cursor[0] =
event->mval[0];
1039 nldrag->
cursor[1] =
event->mval[1];
1041 switch (event->
type) {
1103 std::unique_ptr<bNodeLinkDrag> nldrag = std::make_unique<bNodeLinkDrag>();
1104 nldrag->start_node =
node;
1105 nldrag->start_socket = sock;
1108 if (nldrag->start_link_count > 0 && (nldrag->start_link_count >= link_limit || detach)) {
1113 if (link->fromsock == sock) {
1114 bNodeLink *oplink = MEM_cnew<bNodeLink>(
"drag link op link");
1116 oplink->
next = oplink->
prev =
nullptr;
1120 nldrag->links.append(oplink);
1136 std::unique_ptr<bNodeLinkDrag> nldrag = std::make_unique<bNodeLinkDrag>();
1137 nldrag->last_node_hovered_while_dragging_a_link =
node;
1138 nldrag->start_node =
node;
1139 nldrag->start_socket = sock;
1142 if (nldrag->start_link_count > 0) {
1148 if (link->tosock == sock) {
1150 nldrag->from_multi_input_socket =
true;
1152 link_to_pick = link;
1156 if (link_to_pick !=
nullptr && !nldrag->from_multi_input_socket) {
1157 bNodeLink *oplink = MEM_cnew<bNodeLink>(
"drag link op link");
1158 *oplink = *link_to_pick;
1159 oplink->
next = oplink->
prev =
nullptr;
1163 nldrag->links.append(oplink);
1202 std::unique_ptr<bNodeLinkDrag> nldrag =
node_link_init(snode, cursor, detach);
1211 snode.
runtime->linkdrag = std::move(nldrag);
1229 snode->
runtime->linkdrag.reset();
1239 ot->
description =
"Use the mouse to create a link between two nodes";
1259 "The operation has placed a link. Only used for multi-input sockets, where the "
1260 "link is picked later");
1269 "The position of the mouse cursor at the start of the operation",
1314 ot->
description =
"Makes a link between selected output in input sockets";
1326 ot->
srna,
"replace",
false,
"Replace",
"Replace socket connections with the new links");
1340 for (
int i = 0; i < tot - 1; i++) {
1342 if (
isect_seg_seg_v2(mcoords[i], mcoords[i + 1], coord_array[
b], coord_array[
b + 1]) > 0) {
1364 float mcoords[256][2];
1370 ®ion.
v2d, (
int)loc[0], (
int)loc[1], &mcoords[i][0], &mcoords[i][1]);
1390 if (found ==
false) {
1396 bNode *to_node = link->tonode;
1417 ot->
description =
"Use the mouse to cut (remove) some links";
1451 float mcoords[256][2];
1457 ®ion.
v2d, (
int)loc[0], (
int)loc[1], &mcoords[i][0], &mcoords[i][1]);
1559 ot->
name =
"Detach Links";
1560 ot->
idname =
"NODE_OT_links_detach";
1562 "Remove all links to selected nodes, and try to connect neighbor nodes together";
1587 if (
node == frame) {
1605 ot->
name =
"Make Parent";
1624 #define NODE_JOIN_DONE 1
1625 #define NODE_JOIN_IS_DESCENDANT 2
1631 if (
node == frame) {
1634 else if (
node->parent) {
1703 ot->
description =
"Attach selected nodes to a new common frame";
1722 const int mouse_xy[2])
1751 if (
node->parent ==
nullptr) {
1761 for (parent = frame->
parent; parent; parent = parent->
parent) {
1762 if (parent ==
node->parent) {
1788 ot->
name =
"Attach Nodes";
1808 #define NODE_DETACH_DONE 1
1809 #define NODE_DETACH_IS_DESCENDANT 2
1864 ot->
name =
"Detach Nodes";
1891 *r_select =
nullptr;
1931 if (link->tonode ==
select || link->fromnode ==
select) {
1971 float dist_best = FLT_MAX;
1980 float dist = FLT_MAX;
1989 const float node_xy[] = {
select->totr.xmin,
select->totr.ymax};
1999 if (dist < dist_best) {
2057 if (node_decl !=
nullptr) {
2073 int maxpriority = -1;
2082 for (
int priority = maxpriority; priority >= 0; priority--) {
2091 for (
int priority = maxpriority; priority >= 0; priority--) {
2138 #define NODE_INSOFS_ANIM_DURATION 0.25f
2147 const bool reversed)
2150 bNode *ofs_node = reversed ? fromnode : tonode;
2166 const bNode *parent,
2168 const bool reversed)
2184 const bool reversed)
2187 bNode *ofs_node = reversed ? fromnode : tonode;
2189 if (
data->insert_parent) {
2199 data->insert_parent =
nullptr;
2202 else if (ofs_node->
parent) {
2215 const int mouse_xy[2],
2216 const bool right_alignment)
2223 const float min_margin =
U.node_margin *
UI_DPI_FAC;
2225 const bool needs_alignment = (
next->totr.xmin -
prev->totr.xmax) < (
width + (min_margin * 2.0f));
2227 float margin =
width;
2274 float dist = right_alignment ? totr_insert.
xmin -
prev->totr.xmax :
2275 next->totr.xmin - totr_insert.
xmax;
2277 if (dist < min_margin) {
2278 const float addval = (min_margin - dist) * (right_alignment ? 1.0f : -1.0f);
2282 totr_insert.
xmin += addval;
2283 totr_insert.
xmax += addval;
2284 margin += min_margin;
2289 dist = right_alignment ?
next->totr.xmin - totr_insert.
xmax : totr_insert.
xmin -
prev->totr.xmax;
2291 if (dist < min_margin) {
2292 const float addval = (min_margin - dist) * (right_alignment ? 1.0f : -1.0f);
2293 if (needs_alignment) {
2311 if (needs_alignment) {
2325 insert.parent = init_parent;
2335 bool redraw =
false;
2337 if (!snode || event->
type !=
TIMER || iofsd ==
nullptr ||
2348 const float endval =
node->anim_init_locx +
node->anim_ofsx;
2352 if (
node->anim_ofsx < 0) {
2371 node->anim_init_locx =
node->anim_ofsx = 0.0f;
2374 snode->
runtime->iofsd =
nullptr;
2383 #undef NODE_INSOFS_ANIM_DURATION
2390 if (!iofsd || !iofsd->
insert) {
2411 ot->
name =
"Insert Offset";
2412 ot->
description =
"Automatically offset nodes on insertion";
2413 ot->
idname =
"NODE_OT_insert_offset";
2436 bNode *node_to_insert;
2451 if (old_link ==
nullptr) {
2465 best_input =
nullptr;
2470 best_output =
nullptr;
2478 if (best_output !=
nullptr) {
2480 old_link->
fromnode = node_to_insert;
2488 if (best_input !=
nullptr) {
2497 iofsd->
insert = node_to_insert;
2498 iofsd->
prev = from_node;
2499 iofsd->
next = to_node;
2501 snode->
runtime->iofsd = iofsd;
typedef float(TangentPoint)[2]
struct ScrArea * CTX_wm_area(const bContext *C)
struct SpaceNode * CTX_wm_space_node(const bContext *C)
struct wmWindowManager * CTX_wm_manager(const bContext *C)
struct ARegion * CTX_wm_region(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
struct wmWindow * CTX_wm_window(const bContext *C)
void BKE_curve_forward_diff_bezier(float q0, float q1, float q2, float q3, float *p, int it, int stride)
#define CMP_NODE_SPLITVIEWER
bool nodeAttachNodeCheck(const struct bNode *node, const struct bNode *parent)
void nodeInternalRelink(struct bNodeTree *ntree, struct bNode *node)
void nodeRemSocketLinks(struct bNodeTree *ntree, struct bNodeSocket *sock)
bool nodeIsChildOf(const bNode *parent, const bNode *child)
void nodeAttachNode(struct bNode *node, struct bNode *parent)
struct bNode * nodeGetActive(struct bNodeTree *ntree)
void nodeRemLink(struct bNodeTree *ntree, struct bNodeLink *link)
int nodeSocketIsHidden(const struct bNodeSocket *sock)
void nodeMuteLinkToggle(struct bNodeTree *ntree, struct bNodeLink *link)
int nodeSocketLinkLimit(const struct bNodeSocket *sock)
void ntreeNodeFlagSet(const bNodeTree *ntree, int flag, bool enable)
struct bNodeLink * nodeAddLink(struct bNodeTree *ntree, struct bNode *fromnode, struct bNodeSocket *fromsock, struct bNode *tonode, struct bNodeSocket *tosock)
void nodeParentsIter(bNode *node, bool(*callback)(bNode *, void *), void *userdata)
struct bNode * nodeFindRootParent(bNode *node)
void nodeChainIter(const bNodeTree *ntree, const bNode *node_start, bool(*callback)(bNode *, bNode *, void *, const bool), void *userdata, bool reversed)
bool nodeDeclarationEnsure(struct bNodeTree *ntree, struct bNode *node)
int nodeCountSocketLinks(const struct bNodeTree *ntree, const struct bNodeSocket *sock)
void nodeDetachNode(struct bNode *node)
void BKE_ntree_update_tag_node_property(struct bNodeTree *ntree, struct bNode *node)
void BKE_ntree_update_tag_link_changed(struct bNodeTree *ntree)
void BKE_ntree_update_tag_link_added(struct bNodeTree *ntree, struct bNodeLink *link)
struct ARegion * BKE_area_find_region_type(const struct ScrArea *area, int type)
float BLI_easing_cubic_ease_in_out(float time, float begin, float change, float duration)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
#define LISTBASE_FOREACH(type, var, list)
#define LISTBASE_FOREACH_MUTABLE(type, var, list)
#define LISTBASE_FOREACH_BACKWARD(type, var, list)
#define LISTBASE_FOREACH_INDEX(type, var, list, index_var)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE float min_ff(float a, float b)
MINLINE int max_ii(int a, int b)
int isect_seg_seg_v2(const float v1[2], const float v2[2], const float v3[2], const float v4[2])
float dist_squared_to_line_segment_v2(const float p[2], const float l1[2], const float l2[2])
bool BLI_rctf_isect_x(const rctf *rect, float x)
bool BLI_rctf_isect_pt_v(const struct rctf *rect, const float xy[2])
bool BLI_rctf_isect_y(const rctf *rect, float y)
bool BLI_rctf_isect_segment(const struct rctf *rect, const float s1[2], const float s2[2])
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
#define NODE_LINK_DRAGGED
#define NODE_LINK_TEMP_HIGHLIGHT
#define NODE_LINKFLAG_HILITE
@ SNODE_INSERTOFS_DIR_RIGHT
bool ED_node_is_compositor(struct SpaceNode *snode)
bool ED_node_is_geometry(struct SpaceNode *snode)
#define NODE_EDGE_PAN_OUTSIDE_PAD
#define NODE_EDGE_PAN_INSIDE_PAD
#define NODE_EDGE_PAN_MAX_SPEED
#define NODE_EDGE_PAN_DELAY
#define NODE_EDGE_PAN_ZOOM_INFLUENCE
void ED_node_tree_propagate_change(const struct bContext *C, struct Main *bmain, struct bNodeTree *ntree)
#define NODE_EDGE_PAN_SPEED_RAMP
void ED_preview_kill_jobs(struct wmWindowManager *wm, struct Main *bmain)
void ED_area_tag_redraw(ScrArea *area)
bool ED_operator_node_editable(struct bContext *C)
void ED_region_tag_redraw(struct ARegion *region)
void ED_workspace_status_text(struct bContext *C, const char *str)
void * ED_region_draw_cb_activate(struct ARegionType *art, void(*draw)(const struct bContext *, struct ARegion *, void *), void *customdata, int type)
#define REGION_DRAW_POST_PIXEL
bool ED_region_draw_cb_exit(struct ARegionType *art, void *handle)
void ED_spreadsheet_context_paths_set_geometry_node(struct Main *bmain, struct SpaceNode *snode, struct bNode *node)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
Read Guarded memory(de)allocation.
#define RNA_BEGIN(sptr, itemptr, propname)
#define UI_PRECISION_FLOAT_MAX
void UI_icon_draw_ex(float x, float y, int icon_id, float aspect, float alpha, float desaturate, const uchar mono_color[4], bool mono_border)
void UI_view2d_edge_pan_operator_init(struct bContext *C, struct View2DEdgePanData *vpd, struct wmOperator *op)
void UI_view2d_region_to_view(const struct View2D *v2d, float x, float y, float *r_view_x, float *r_view_y) ATTR_NONNULL()
void UI_view2d_edge_pan_operator_properties_ex(struct wmOperatorType *ot, float inside_pad, float outside_pad, float speed_ramp, float max_speed, float delay, float zoom_influence)
void void UI_view2d_edge_pan_apply_event(struct bContext *C, struct View2DEdgePanData *vpd, const struct wmEvent *event)
void UI_view2d_edge_pan_cancel(struct bContext *C, struct View2DEdgePanData *vpd)
@ OPTYPE_DEPENDS_ON_CURSOR
__forceinline const avxb select(const avxb &m, const avxb &t, const avxb &f)
void sort(btMatrix3x3 &U, btVector3 &sigma, btMatrix3x3 &V, int t)
Helper function of 3X3 SVD for sorting singular values.
MutableSpan< T > as_mutable_span()
void append(const T &value)
IndexRange index_range() const
Span< SocketDeclarationPtr > outputs() const
Span< SocketDeclarationPtr > inputs() const
bNodeTree * btree() const
Span< const InputSocketRef * > directly_linked_sockets() const
bool is_default_link_socket() const
const NodeRef & node() const
bNodeSocketType * typeinfo() const
StringRefNull idname() const
const NodeTreeRef & tree() const
bNodeSocket * bsocket() const
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
void(* MEM_freeN)(void *vmemh)
Insertion insert(const float3 &point_prev, const float3 &handle_prev, const float3 &handle_next, const float3 &point_next, float parameter)
static void area(int d1, int d2, int e1, int e2, float weights[2])
static const NodeRef * get_existing_viewer(const NodeTreeRef &tree)
static bool is_viewer_socket_in_viewer(const InputSocketRef &socket)
static bool is_linked_to_viewer(const OutputSocketRef &socket, const NodeRef &viewer_node)
static Vector< const NodeRef * > find_viewer_nodes(const NodeTreeRef &tree)
static void remove_links_to_unavailable_viewer_sockets(bNodeTree &btree, bNode &viewer_node)
static bNodeSocket * node_link_viewer_get_socket(bNodeTree &ntree, bNode &viewer_node, bNodeSocket &src_socket)
static bool socket_can_be_viewed(const OutputSocketRef &socket)
static int link_socket_to_viewer(const bContext &C, bNode *viewer_bnode, bNode &bnode_to_view, bNodeSocket &bsocket_to_view)
static int node_link_viewer(const bContext &C, bNode &bnode_to_view)
static eCustomDataType socket_type_to_custom_data_type(const eNodeSocketDatatype socket_type)
static bool is_viewer_node(const NodeRef &node)
static const OutputSocketRef * find_output_socket_to_be_viewed(const NodeRef *active_viewer_node, const NodeRef &node_to_view)
static int get_default_viewer_type(const bContext *C)
void NODE_OT_parent_set(wmOperatorType *ot)
static int cut_links_exec(bContext *C, wmOperator *op)
static void draw_draglink_tooltip_activate(const ARegion ®ion, bNodeLinkDrag &nldrag)
void node_sort(bNodeTree &ntree)
static int node_attach_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *event)
static bool snode_autoconnect_input(SpaceNode &snode, bNode *node_fr, bNodeSocket *sock_fr, bNode *node_to, bNodeSocket *sock_to, int replace)
void invoke_node_link_drag_add_menu(bContext &C, bNode &node, bNodeSocket &socket, const float2 &cursor)
static void node_remove_extra_links(SpaceNode &snode, bNodeLink &link)
static void node_link_exit(bContext &C, wmOperator &op, const bool apply_links)
void NODE_OT_detach(wmOperatorType *ot)
static void snode_autoconnect(SpaceNode &snode, const bool allow_multiple, const bool replace)
static void node_link_insert_offset_frame_chains(const bNodeTree *ntree, const bNode *parent, NodeInsertOfsData *data, const bool reversed)
static bNode * node_find_frame_to_attach(ARegion ®ion, const bNodeTree &ntree, const int mouse_xy[2])
void NODE_OT_insert_offset(wmOperatorType *ot)
static int get_main_socket_priority(const bNodeSocket *socket)
float2 node_link_calculate_multi_input_position(const float2 &socket_position, const int index, const int total_inputs)
static void pick_link(wmOperator &op, bNodeLinkDrag &nldrag, SpaceNode &snode, bNode *node, bNodeLink &link_to_pick)
static bNodeSocket * get_main_socket(bNodeTree &ntree, bNode &node, eNodeSocketInOut in_out)
static bool node_parents_offset_flag_enable_cb(bNode *parent, void *UNUSED(userdata))
void NODE_OT_links_detach(wmOperatorType *ot)
bool node_link_bezier_points(const View2D *v2d, const SpaceNode *snode, const bNodeLink &link, float coord_array[][2], const int resol)
bNode * node_add_node(const bContext &C, const char *idname, int type, float locx, float locy)
static bool dragged_links_are_detached(const bNodeLinkDrag &nldrag)
void NODE_OT_links_cut(wmOperatorType *ot)
static void pick_input_link_by_link_intersect(const bContext &C, wmOperator &op, bNodeLinkDrag &nldrag, const float2 &cursor)
static int mute_links_exec(bContext *C, wmOperator *op)
static void node_link_cancel(bContext *C, wmOperator *op)
static void draw_draglink_tooltip(const bContext *UNUSED(C), ARegion *UNUSED(region), void *arg)
void NODE_OT_join(wmOperatorType *ot)
void node_deselect_all_output_sockets(SpaceNode &snode, bool deselect_nodes)
static bool node_active_link_viewer_poll(bContext *C)
void NODE_OT_attach(wmOperatorType *ot)
bool node_link_is_hidden_or_dimmed(const View2D &v2d, const bNodeLink &link)
static int node_insert_offset_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void draw_draglink_tooltip_deactivate(const ARegion ®ion, bNodeLinkDrag &nldrag)
static bool node_links_intersect(bNodeLink &link, const float mcoords[][2], int tot)
static int node_insert_offset_modal(bContext *C, wmOperator *UNUSED(op), const wmEvent *event)
void NODE_OT_link_viewer(wmOperatorType *ot)
bool node_find_indicated_socket(SpaceNode &snode, bNode **nodep, bNodeSocket **sockp, const float2 &cursor, const eNodeSocketInOut in_out)
static int node_make_link_exec(bContext *C, wmOperator *op)
static int node_count_links(const bNodeTree &ntree, const bNodeSocket &socket)
static void node_link_update_header(bContext *C, bNodeLinkDrag *UNUSED(nldrag))
static int node_link_modal(bContext *C, wmOperator *op, const wmEvent *event)
static bNodeSocket * best_socket_output(bNodeTree *ntree, bNode *node, bNodeSocket *sock_target, const bool allow_multiple)
static int node_active_link_viewer_exec(bContext *C, wmOperator *UNUSED(op))
void NODE_OT_link_make(wmOperatorType *ot)
static bNodeLink * create_drag_link(bNode &node, bNodeSocket &sock)
float2 node_to_view(const bNode &node, const float2 &co)
static void node_link_insert_offset_ntree(NodeInsertOfsData *iofsd, ARegion *region, const int mouse_xy[2], const bool right_alignment)
void sort_multi_input_socket_links(SpaceNode &snode, bNode &node, bNodeLink *drag_link, const float2 *cursor)
static void node_detach_recursive(bNode *node)
static bool node_link_insert_offset_chain_cb(bNode *fromnode, bNode *tonode, void *userdata, const bool reversed)
static void node_join_attach_recursive(bNode *node, bNode *frame)
void node_to_updated_rect(const bNode &node, rctf &r_rect)
bool node_link_bezier_handles(const View2D *v2d, const SpaceNode *snode, const bNodeLink &link, float vec[4][2])
static bool should_create_drag_link_search_menu(const bNodeTree &node_tree, const bNodeLinkDrag &nldrag)
static int node_link_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static void node_link_find_socket(bContext &C, wmOperator &op, const float2 &cursor)
void NODE_OT_link(wmOperatorType *ot)
static int node_parent_set_exec(bContext *C, wmOperator *UNUSED(op))
void node_deselect_all_input_sockets(SpaceNode &snode, bool deselect_nodes)
static bNodeSocket * best_socket_input(bNodeTree *ntree, bNode *node, int num, int replace)
static std::unique_ptr< bNodeLinkDrag > node_link_init(SpaceNode &snode, float2 cursor, const bool detach)
void NODE_OT_links_mute(wmOperatorType *ot)
static int node_detach_exec(bContext *C, wmOperator *UNUSED(op))
static bool node_link_insert_offset_frame_chain_cb(bNode *fromnode, bNode *tonode, void *userdata, const bool reversed)
static bool socket_is_available(bNodeTree *UNUSED(ntree), bNodeSocket *sock, const bool allow_used)
static bool ed_node_link_conditions(ScrArea *area, bool test, SpaceNode **r_snode, bNode **r_select)
static void node_offset_apply(bNode &node, const float offset_x)
static int node_join_exec(bContext *C, wmOperator *UNUSED(op))
static void node_parent_offset_apply(NodeInsertOfsData *data, bNode *parent, const float offset_x)
static int detach_links_exec(bContext *C, wmOperator *UNUSED(op))
T distance(const T &a, const T &b)
SymEdge< T > * prev(const SymEdge< T > *se)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
#define NODE_DETACH_IS_DESCENDANT
static void clear_picking_highlight(ListBase *links)
#define NODE_JOIN_IS_DESCENDANT
#define NODE_INSOFS_ANIM_DURATION
void ED_node_link_insert(Main *bmain, ScrArea *area)
void ED_node_link_intersect_test(ScrArea *area, int test)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
void RNA_float_get_array(PointerRNA *ptr, const char *name, float *values)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_float_array(StructOrFunctionRNA *cont_, const char *identifier, int len, const float *default_value, float hardmin, float hardmax, const char *ui_name, const char *ui_description, float softmin, float softmax)
PropertyRNA * RNA_def_collection_runtime(StructOrFunctionRNA *cont_, const char *identifier, StructRNA *type, const char *ui_name, const char *ui_description)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, int default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
struct ARegionType * type
SpaceNode_Runtime * runtime
struct bNodeTree * edittree
int multi_input_socket_index
struct bNodeListItem * next
bool(* validate_link)(eNodeSocketDatatype from, eNodeSocketDatatype to)
struct bNodeTreeType * typeinfo
void(* updatefunc)(struct bNodeTree *ntree, struct bNode *node)
void(* insert_link)(struct bNodeTree *ntree, struct bNode *node, struct bNodeLink *link)
struct bNodeType * typeinfo
float2 multi_socket_position
bool from_multi_input_socket
Vector< bNodeLink * > links
View2DEdgePanData pan_data
bNodeLink * last_picked_multi_input_socket_link
bNode * last_node_hovered_while_dragging_a_link
std::array< int, 2 > cursor
bNodeSocket * start_socket
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
int(* modal)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
void(* cancel)(struct bContext *, struct wmOperator *)
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
void WM_event_drag_start_mval(const wmEvent *event, const ARegion *region, int r_mval[2])
wmEventHandler_Op * WM_event_add_modal_handler(bContext *C, wmOperator *op)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
int WM_gesture_lines_modal(bContext *C, wmOperator *op, const wmEvent *event)
void WM_gesture_lines_cancel(bContext *C, wmOperator *op)
int WM_gesture_lines_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void WM_event_remove_timer(wmWindowManager *wm, wmWindow *UNUSED(win), wmTimer *timer)
wmTimer * WM_event_add_timer(wmWindowManager *wm, wmWindow *win, int event_type, double timestep)