67 if (win->scene !=
scene) {
90 const float margin = 1.5f *
U.widget_unit;
124 switch (
node->type) {
148 switch (
node->type) {
152 if (
distance(mouse, location) < 24.0f) {
217 if (
node && deselect_node) {
272 if (deselect_nodes) {
274 if (socket->flag &
SELECT) {
302 if (deselect_nodes) {
304 if (socket->flag &
SELECT) {
327 bool changed =
false;
341 bool changed =
false;
355 bool changed =
false;
356 const uint delims[] = {
'.',
'-',
'_',
'\0'};
357 size_t pref_len_act, pref_len_curr;
358 const char *sep, *suf_act, *suf_curr;
361 node_act.
name,
nullptr, delims, &sep, &suf_act, from_right);
364 if (from_right && !(sep && suf_act)) {
366 suf_act = node_act.
name;
374 node->name,
nullptr, delims, &sep, &suf_curr, from_right);
377 if (from_right && !(sep && suf_curr)) {
379 suf_curr =
node->name;
382 if ((from_right &&
STREQ(suf_act, suf_curr)) ||
383 (!from_right && (pref_len_act == pref_len_curr) &&
406 if (node_act ==
nullptr) {
410 bool changed =
false;
455 {0,
nullptr, 0,
nullptr,
nullptr},
459 ot->
name =
"Select Grouped";
461 ot->
idname =
"NODE_OT_select_grouped";
476 "Extend selection instead of deselecting everything first");
495 bool active_texture_changed =
false;
498 if (node_iter != &
node) {
534 bool changed =
false;
536 bool node_was_selected =
false;
597 found = (
node !=
nullptr);
604 else if (found ||
params->deselect_all) {
644 if (changed || found) {
645 bool active_texture_changed =
false;
646 bool viewer_node_changed =
false;
647 if ((
node !=
nullptr) && (node_was_selected ==
false ||
params->select_passthrough ==
false)) {
657 viewer_node_changed) {
664 return changed || found;
756 switch (
node->type) {
820 "Only activate when mouse is not over a node (useful for tweak gesture)");
860 switch (
node->type) {
865 const float radius_adjusted = (
float)radius / zoom;
866 BLI_rctf_pad(&frame_inside, -2.0f * radius_adjusted, -2.0f * radius_adjusted);
890 ot->
name =
"Circle Select";
891 ot->
idname =
"NODE_OT_select_circle";
927 const int mcoords[][2],
928 const int mcoords_len,
937 bool changed =
false;
955 switch (
node->type) {
976 ®ion->
v2d, cent[0], cent[1], &screen_co[0], &screen_co[1]) &&
1014 ot->
name =
"Lasso Select";
1016 ot->
idname =
"NODE_OT_select_lasso";
1033 "Only activate when mouse is not over a node (useful for tweak gesture)");
1062 ot->
name =
"(De)select All";
1095 if (link->fromnode && link->tonode && (link->fromnode->flag &
NODE_SELECT)) {
1115 ot->
name =
"Select Linked To";
1116 ot->
description =
"Select nodes linked to the selected ones";
1117 ot->
idname =
"NODE_OT_select_linked_to";
1146 if (link->fromnode && link->tonode && (link->tonode->flag &
NODE_SELECT)) {
1166 ot->
name =
"Select Linked From";
1167 ot->
description =
"Select nodes linked from the selected ones";
1168 ot->
idname =
"NODE_OT_select_linked_from";
1192 const bool same_type =
true;
1199 for (
a = 0;
a < totnodes;
a++) {
1200 if (node_array[
a] ==
active) {
1208 while (
node ==
nullptr) {
1216 if (a < 0 || a >= totnodes) {
1220 node = node_array[
a];
1234 active = node_array[totnodes - 1];
1241 if (
a == totnodes - 1) {
1270 ot->
name =
"Activate Same Type Next/Prev";
1271 ot->
description =
"Activate and view same node type, step by step";
1272 ot->
idname =
"NODE_OT_select_same_type_step";
1292 if (
node->label[0]) {
1305 const bool UNUSED(is_first))
1317 bNode **filtered_nodes;
1320 for (
int i = 0; i < filtered_amount; i++) {
1352 static char search[256] =
"";
1394 std::array<int, 2> bounds_offset = {0, -
UI_UNIT_Y};
1410 ot->
description =
"Search for a node by name and focus and select it";
typedef float(TangentPoint)[2]
struct Scene * CTX_data_scene(const bContext *C)
struct SpaceNode * CTX_wm_space_node(const bContext *C)
struct wmWindowManager * CTX_wm_manager(const bContext *C)
struct Object * CTX_data_active_object(const bContext *C)
struct ARegion * CTX_wm_region(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
bool nodeLinkIsHidden(const struct bNodeLink *link)
struct bNode * nodeGetActive(struct bNodeTree *ntree)
void nodeSetSelected(struct bNode *node, bool select)
void ntreeGetDependencyList(struct bNodeTree *ntree, struct bNode ***r_deplist, int *r_deplist_len)
struct bScreen * BKE_workspace_active_screen_get(const struct WorkSpaceInstanceHook *hook) GETTER_ATTRS
#define BLI_assert_unreachable()
bool BLI_lasso_is_point_inside(const int mcoords[][2], unsigned int mcoords_len, int sx, int sy, int error_value)
void BLI_lasso_boundbox(struct rcti *rect, const int mcoords[][2], unsigned int mcoords_len)
#define LISTBASE_FOREACH(type, var, list)
#define LISTBASE_FOREACH_BACKWARD(type, var, list)
MINLINE bool compare_v3v3(const float a[3], const float b[3], float limit) ATTR_WARN_UNUSED_RESULT
BLI_INLINE float BLI_rctf_cent_y(const struct rctf *rct)
bool BLI_rctf_isect(const struct rctf *src1, const struct rctf *src2, struct rctf *dest)
BLI_INLINE float BLI_rctf_cent_x(const struct rctf *rct)
bool BLI_rcti_isect_pt(const struct rcti *rect, int x, int y)
bool BLI_rctf_isect_circle(const struct rctf *rect, const float xy[2], float radius)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
void BLI_rctf_pad(struct rctf *rect, float pad_x, float pad_y)
bool BLI_rctf_isect_pt(const struct rctf *rect, float x, float y)
void BLI_rctf_rcti_copy(struct rctf *dst, const struct rcti *src)
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
bool BLI_rctf_inside_rctf(const rctf *rct_a, const rctf *rct_b)
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
void BLI_string_search_add(StringSearch *search, const char *str, void *user_data, int weight)
void BLI_string_search_free(StringSearch *search)
StringSearch * BLI_string_search_new(void)
int BLI_string_search_query(StringSearch *search, const char *query, void ***r_data)
size_t size_t size_t BLI_str_partition_ex_utf8(const char *str, const char *end, const unsigned int delim[], const char **sep, const char **suf, bool from_right) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
#define STREQLEN(a, b, n)
void DEG_id_tag_update(struct ID *id, int flag)
@ ID_RECALC_COPY_ON_WRITE
void ED_node_set_active(struct Main *bmain, struct SpaceNode *snode, struct bNodeTree *ntree, struct bNode *node, bool *r_active_texture_changed)
void ED_node_set_active_viewer_key(struct SpaceNode *snode)
bool ED_operator_node_active(struct bContext *C)
eSelectOp ED_select_op_modal(eSelectOp sel_op, bool is_first)
void ED_select_pick_params_from_operator(struct PointerRNA *ptr, struct SelectPick_Params *params) ATTR_NONNULL(1
#define SEL_OP_USE_PRE_DESELECT(sel_op)
const char * ED_select_circle_get_name(struct wmOperatorType *ot, PointerRNA *ptr)
void const char * ED_select_pick_get_name(struct wmOperatorType *ot, PointerRNA *ptr)
void ED_spreadsheet_context_paths_set_geometry_node(struct Main *bmain, struct SpaceNode *snode, struct bNode *node)
bool ED_view3d_has_workbench_in_texture_color(const struct Scene *scene, const struct Object *ob, const struct View3D *v3d)
_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 type
Read Guarded memory(de)allocation.
int UI_searchbox_size_x(void)
@ UI_BUT_ACTIVATE_ON_INIT
void UI_block_theme_style_set(uiBlock *block, char theme_style)
int UI_searchbox_size_y(void)
uiBut * uiDefBut(uiBlock *block, int type, int retval, const char *str, int x, int y, short width, short height, void *poin, float min, float max, float a1, float a2, const char *tip)
void UI_block_bounds_set_popup(uiBlock *block, int addval, const int bounds_offset[2])
@ UI_BLOCK_THEME_STYLE_POPUP
void UI_but_func_search_set(uiBut *but, uiButSearchCreateFn search_create_fn, uiButSearchUpdateFn search_update_fn, void *arg, bool free_arg, uiFreeArgFunc search_arg_free_fn, uiButHandleFunc search_exec_fn, void *active)
bool UI_search_item_add(uiSearchItems *items, const char *name, void *poin, int iconid, int but_flag, uint8_t name_prefix_offset)
uiBlock * UI_block_begin(const struct bContext *C, struct ARegion *region, const char *name, eUIEmbossType emboss)
uiBut * uiDefSearchBut(uiBlock *block, void *arg, int retval, int icon, int maxlen, int x, int y, short width, short height, float a1, float a2, const char *tip)
void UI_block_flag_enable(uiBlock *block, int flag)
void UI_popup_block_invoke(struct bContext *C, uiBlockCreateFunc func, void *arg, uiFreeArgFunc arg_free)
void UI_but_flag_enable(uiBut *but, int flag)
@ UI_BLOCK_MOVEMOUSE_QUIT
void UI_view2d_region_to_view_rctf(const struct View2D *v2d, const struct rctf *rect_src, struct rctf *rect_dst) ATTR_NONNULL()
bool UI_view2d_view_to_region_clip(const struct View2D *v2d, float x, float y, int *r_region_x, int *r_region_y) ATTR_NONNULL()
void UI_view2d_region_to_view(const struct View2D *v2d, float x, float y, float *r_view_x, float *r_view_y) ATTR_NONNULL()
@ OPTYPE_DEPENDS_ON_CURSOR
__forceinline const avxb select(const avxb &m, const avxb &t, const avxb &f)
static bool is_inside(int x, int y, int cols, int rows)
ccl_global KernelShaderEvalInput ccl_global float * output
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
ccl_global KernelShaderEvalInput * input
void(* MEM_freeN)(void *vmemh)
static void area(int d1, int d2, int e1, int e2, float weights[2])
bool active
all scheduled work for the GPU.
static bool has_workbench_in_texture_color(const wmWindowManager *wm, const Scene *scene, const Object *ob)
static bool node_select_grouped_type(bNodeTree &node_tree, bNode &node_act)
void node_sort(bNodeTree &ntree)
bool node_or_socket_isect_event(bContext *C, const wmEvent *event)
void NODE_OT_select_circle(wmOperatorType *ot)
static uiBlock * node_find_menu(bContext *C, ARegion *region, void *arg_op)
static int node_box_select_exec(bContext *C, wmOperator *op)
static int node_lasso_select_exec(bContext *C, wmOperator *op)
static int node_select_same_type_step_exec(bContext *C, wmOperator *op)
bool space_node_view_flag(bContext &C, SpaceNode &snode, ARegion ®ion, int node_flag, int smooth_viewtx)
static bool do_lasso_select_node(bContext *C, const int mcoords[][2], const int mcoords_len, eSelectOp sel_op)
void NODE_OT_find_node(wmOperatorType *ot)
void NODE_OT_select_lasso(wmOperatorType *ot)
void node_socket_select(bNode *node, bNodeSocket &sock)
@ NODE_SELECT_GROUPED_SUFIX
@ NODE_SELECT_GROUPED_TYPE
@ NODE_SELECT_GROUPED_PREFIX
@ NODE_SELECT_GROUPED_COLOR
void NODE_OT_select(wmOperatorType *ot)
static bool node_select_grouped_name(bNodeTree &node_tree, bNode &node_act, const bool from_right)
static int node_find_node_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
static void node_socket_toggle(bNode *node, bNodeSocket &sock, bool deselect_node)
static bool is_event_over_node_or_socket(bContext *C, const wmEvent *event)
void node_socket_deselect(bNode *node, bNodeSocket &sock, bool deselect_node)
static int node_lasso_select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static bool node_mouse_select(bContext *C, wmOperator *op, const int mval[2], struct SelectPick_Params *params)
void node_select_all(ListBase *lb, int action)
void node_deselect_all(SpaceNode &snode)
static bool is_position_over_node_or_socket(SpaceNode &snode, const float2 &mouse)
void NODE_OT_select_grouped(wmOperatorType *ot)
void node_deselect_all_output_sockets(SpaceNode &snode, bool deselect_nodes)
static bool node_frame_select_isect_mouse(bNode *node, const float2 &mouse)
static int node_circleselect_exec(bContext *C, wmOperator *op)
static int node_select_all_exec(bContext *C, wmOperator *op)
static void node_find_exec_fn(struct bContext *C, void *UNUSED(arg1), void *arg2)
static void node_find_update_fn(const struct bContext *C, void *UNUSED(arg), const char *str, uiSearchItems *items, const bool UNUSED(is_first))
void NODE_OT_select_linked_from(wmOperatorType *ot)
bool node_find_indicated_socket(SpaceNode &snode, bNode **nodep, bNodeSocket **sockp, const float2 &cursor, const eNodeSocketInOut in_out)
static int node_select_grouped_exec(bContext *C, wmOperator *op)
static int node_box_select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void NODE_OT_select_same_type_step(wmOperatorType *ot)
void node_select_single(bContext &C, bNode &node)
static bool node_select_grouped_color(bNodeTree &node_tree, bNode &node_act)
void NODE_OT_select_linked_to(wmOperatorType *ot)
static int node_select_linked_to_exec(bContext *C, wmOperator *UNUSED(op))
static bNode * node_under_mouse_select(bNodeTree &ntree, int mx, int my)
static int node_select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
rctf node_frame_rect_inside(const bNode &node)
static bNode * node_under_mouse_tweak(bNodeTree &ntree, const float2 &mouse)
void node_deselect_all_input_sockets(SpaceNode &snode, bool deselect_nodes)
void NODE_OT_select_box(wmOperatorType *ot)
void NODE_OT_select_all(wmOperatorType *ot)
static int node_select_exec(bContext *C, wmOperator *op)
static void node_find_create_label(const bNode *node, char *str, int maxlen)
static int node_select_linked_from_exec(bContext *C, wmOperator *UNUSED(op))
T distance(const T &a, const T &b)
static const EnumPropertyItem prop_select_grouped_types[]
void RNA_int_set_array(PointerRNA *ptr, const char *name, const int *values)
void RNA_int_get_array(PointerRNA *ptr, const char *name, int *values)
int RNA_int_get(PointerRNA *ptr, const char *name)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_int_vector(StructOrFunctionRNA *cont_, const char *identifier, int len, const int *default_value, int hardmin, int hardmax, const char *ui_name, const char *ui_description, int softmin, int softmax)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
struct bNodeTree * edittree
struct bNodeSocket * next
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
const char *(* get_name)(struct wmOperatorType *, struct PointerRNA *)
struct wmOperatorType * type
void WM_event_drag_start_mval(const wmEvent *event, const ARegion *region, int r_mval[2])
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
bool WM_gesture_is_modal_first(const wmGesture *gesture)
void WM_gesture_box_cancel(bContext *C, wmOperator *op)
int WM_gesture_box_invoke(bContext *C, wmOperator *op, const wmEvent *event)
int WM_gesture_circle_invoke(bContext *C, wmOperator *op, const wmEvent *event)
int WM_gesture_box_modal(bContext *C, wmOperator *op, const wmEvent *event)
int WM_gesture_circle_modal(bContext *C, wmOperator *op, const wmEvent *event)
int WM_gesture_lasso_modal(bContext *C, wmOperator *op, const wmEvent *event)
void WM_gesture_lasso_cancel(bContext *C, wmOperator *op)
int WM_gesture_lasso_invoke(bContext *C, wmOperator *op, const wmEvent *event)
const int(* WM_gesture_lasso_path_to_array(bContext *UNUSED(C), wmOperator *op, int *r_mcoords_len))[2]
void WM_operator_properties_gesture_box(wmOperatorType *ot)
void WM_operator_properties_select_operation_simple(wmOperatorType *ot)
void WM_operator_properties_gesture_lasso(wmOperatorType *ot)
void WM_operator_properties_gesture_circle(wmOperatorType *ot)
void WM_operator_properties_select_all(wmOperatorType *ot)
void WM_operator_properties_border_to_rctf(struct wmOperator *op, rctf *rect)
void WM_operator_properties_mouse_select(wmOperatorType *ot)
int WM_operator_flag_only_pass_through_on_press(int retval, const struct wmEvent *event)
int WM_operator_smooth_viewtx_get(const wmOperator *op)
int WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))