78 if (win->scene !=
scene) {
104 if (
node->typeinfo->select_area_func) {
105 if (
node->typeinfo->select_area_func(
node, mx, my)) {
118 if (
node->typeinfo->tweak_area_func) {
119 if (
node->typeinfo->tweak_area_func(
node, mx, my)) {
170 if (
node && deselect_node) {
174 for (sock =
node->inputs.first; sock; sock = sock->
next) {
180 for (sock =
node->outputs.first; sock; sock = sock->
next) {
226 for (sock =
node->inputs.first; sock; sock = sock->
next) {
231 if (deselect_nodes) {
232 for (sock =
node->outputs.first; sock; sock = sock->
next) {
259 for (sock =
node->outputs.first; sock; sock = sock->
next) {
264 if (deselect_nodes) {
265 for (sock =
node->inputs.first; sock; sock = sock->
next) {
290 bool changed =
false;
307 bool changed =
false;
324 bool changed =
false;
325 const uint delims[] = {
'.',
'-',
'_',
'\0'};
326 size_t pref_len_act, pref_len_curr;
327 const char *sep, *suf_act, *suf_curr;
330 node_act->
name,
NULL, delims, &sep, &suf_act, from_right);
333 if (from_right && !(sep && suf_act)) {
335 suf_act = node_act->
name;
343 node->name,
NULL, delims, &sep, &suf_curr, from_right);
346 if (from_right && !(sep && suf_curr)) {
348 suf_curr =
node->name;
351 if ((from_right &&
STREQ(suf_act, suf_curr)) ||
352 (!from_right && (pref_len_act == pref_len_curr) &&
374 if (node_act ==
NULL) {
379 bool changed =
false;
427 ot->
name =
"Select Grouped";
429 ot->
idname =
"NODE_OT_select_grouped";
444 "Extend selection instead of deselecting everything first");
461 bool active_texture_changed =
false;
485 bool wait_to_deselect_others)
505 if (extend || socket_select) {
506 wait_to_deselect_others =
false;
533 for (tsock =
node->outputs.first; tsock; tsock = tsock->
next) {
570 else if (deselect_all &&
node ==
NULL) {
574 if (wait_to_deselect_others) {
588 if (wait_to_deselect_others && (
node->flag &
SELECT)) {
607 bool active_texture_changed =
false;
625 const bool wait_to_deselect_others =
RNA_boolean_get(op->
ptr,
"wait_to_deselect_others");
664 "Deselect On Nothing",
665 "Deselect all when nothing under the cursor");
745 "Only activate when mouse is not over a node (useful for tweak gesture)");
797 ot->
name =
"Circle Select";
798 ot->
idname =
"NODE_OT_select_circle";
834 const int mcoords[][2],
835 const int mcoords_len,
844 bool changed =
false;
867 ®ion->
v2d, cent[0], cent[1], &screen_co[0], &screen_co[1]) &&
902 ot->
name =
"Lasso Select";
904 ot->
idname =
"NODE_OT_select_lasso";
921 "Only activate when mouse is not over a node (useful for tweak gesture)");
950 ot->
name =
"(De)select All";
1004 ot->
name =
"Select Linked To";
1005 ot->
description =
"Select nodes linked to the selected ones";
1006 ot->
idname =
"NODE_OT_select_linked_to";
1056 ot->
name =
"Select Linked From";
1057 ot->
description =
"Select nodes linked from the selected ones";
1058 ot->
idname =
"NODE_OT_select_linked_from";
1082 const bool same_type = 1;
1089 for (
a = 0;
a < totnodes;
a++) {
1090 if (node_array[
a] ==
active) {
1106 if (a < 0 || a >= totnodes) {
1110 node = node_array[
a];
1124 active = node_array[totnodes - 1];
1131 if (
a == totnodes - 1) {
1160 ot->
name =
"Activate Same Type Next/Prev";
1161 ot->
description =
"Activate and view same node type, step by step";
1162 ot->
idname =
"NODE_OT_select_same_type_step";
1182 if (
node->label[0]) {
1195 const bool UNUSED(is_first))
1207 bNode **filtered_nodes;
1210 for (
int i = 0; i < filtered_amount; i++) {
1242 static char search[256] =
"";
1299 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
void BLI_lasso_boundbox(struct rcti *rect, const int mcoords[][2], const unsigned int mcoords_len)
bool BLI_lasso_is_point_inside(const int mcoords[][2], const unsigned int mcoords_len, const int sx, const int sy, const int error_value)
#define LISTBASE_FOREACH(type, var, list)
MINLINE bool compare_v3v3(const float a[3], const float b[3], const 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_rctf_isect_circle(const struct rctf *rect, const float xy[2], const float radius)
bool BLI_rcti_isect_pt(const struct rcti *rect, const int x, const int y)
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
bool BLI_rctf_inside_rctf(const rctf *rct_a, const rctf *rct_b)
size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
void BLI_string_search_free(StringSearch *search)
void BLI_string_search_add(StringSearch *search, const char *str, void *user_data)
StringSearch * BLI_string_search_new(void)
int BLI_string_search_query(StringSearch *search, const char *query, void ***r_data)
size_t BLI_str_partition_ex_utf8(const char *str, const char *end, const unsigned int delim[], const char **sep, const char **suf, const bool from_right) 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_sort(struct bNodeTree *ntree)
void ED_node_set_active(struct Main *bmain, struct bNodeTree *ntree, struct bNode *node, bool *r_active_texture_changed)
void ED_node_select_all(ListBase *lb, int action)
void ED_node_set_active_viewer_key(struct SpaceNode *snode)
bool ED_operator_node_active(struct bContext *C)
#define SEL_OP_USE_PRE_DESELECT(sel_op)
eSelectOp ED_select_op_modal(const eSelectOp sel_op, const bool is_first)
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 type
_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
Read Guarded memory(de)allocation.
int UI_searchbox_size_x(void)
void UI_block_theme_style_set(uiBlock *block, char theme_style)
int UI_searchbox_size_y(void)
@ UI_BUT_ACTIVATE_ON_INIT
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])
bool UI_search_item_add(uiSearchItems *items, const char *name, void *poin, int iconid, int state, const uint8_t name_prefix_offset)
void UI_but_func_search_set(uiBut *but, uiButSearchCreateFn search_create_fn, uiButSearchUpdateFn search_update_fn, void *arg, const bool free_arg, uiButSearchArgFreeFn search_arg_free_fn, uiButHandleFunc search_exec_fn, void *active)
void UI_popup_block_invoke(struct bContext *C, uiBlockCreateFunc func, void *arg, void(*arg_free)(void *arg))
@ UI_BLOCK_MOVEMOUSE_QUIT
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)
@ UI_BLOCK_THEME_STYLE_POPUP
void UI_but_flag_enable(uiBut *but, int flag)
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()
static bool is_inside(int x, int y, int cols, int rows)
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.
int node_find_indicated_socket(SpaceNode *snode, bNode **nodep, bNodeSocket **sockp, const float cursor[2], int in_out)
int space_node_view_flag(struct bContext *C, struct SpaceNode *snode, ARegion *region, const int node_flag, const int smooth_viewtx)
static int node_circleselect_exec(bContext *C, wmOperator *op)
static bNode * node_under_mouse_tweak(bNodeTree *ntree, int mx, int my)
void node_deselect_all(SpaceNode *snode)
static bool do_lasso_select_node(bContext *C, const int mcoords[][2], const int mcoords_len, eSelectOp sel_op)
static bool node_select_grouped_type(SpaceNode *snode, bNode *node_act)
void node_select_single(bContext *C, bNode *node)
static uiBlock * node_find_menu(bContext *C, ARegion *region, void *arg_op)
void NODE_OT_select_grouped(wmOperatorType *ot)
static int node_box_select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void node_socket_select(bNode *node, bNodeSocket *sock)
void node_deselect_all_input_sockets(SpaceNode *snode, const bool deselect_nodes)
static int node_select_linked_from_exec(bContext *C, wmOperator *UNUSED(op))
static int node_find_node_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
static bool has_workbench_in_texture_color(const wmWindowManager *wm, const Scene *scene, const Object *ob)
static int node_box_select_exec(bContext *C, wmOperator *op)
void NODE_OT_select_linked_to(wmOperatorType *ot)
static void node_socket_toggle(bNode *node, bNodeSocket *sock, int deselect_node)
void NODE_OT_select_linked_from(wmOperatorType *ot)
static bool is_event_over_node_or_socket(bContext *C, const wmEvent *event)
static int node_select_same_type_step_exec(bContext *C, wmOperator *op)
void node_deselect_all_output_sockets(SpaceNode *snode, const bool deselect_nodes)
void NODE_OT_select_box(wmOperatorType *ot)
static void node_toggle(bNode *node)
static void node_find_create_label(const bNode *node, char *str, int maxlen)
static int node_mouse_select(bContext *C, wmOperator *op, const int mval[2], bool wait_to_deselect_others)
@ NODE_SELECT_GROUPED_COLOR
@ NODE_SELECT_GROUPED_PREFIX
@ NODE_SELECT_GROUPED_SUFIX
@ NODE_SELECT_GROUPED_TYPE
void NODE_OT_find_node(wmOperatorType *ot)
static int node_select_exec(bContext *C, wmOperator *op)
void NODE_OT_select(wmOperatorType *ot)
static bool node_select_grouped_color(SpaceNode *snode, bNode *node_act)
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_lasso(wmOperatorType *ot)
static int node_select_grouped_exec(bContext *C, wmOperator *op)
void NODE_OT_select_same_type_step(wmOperatorType *ot)
static bNode * node_under_mouse_select(bNodeTree *ntree, int mx, int my)
static void node_find_exec_fn(struct bContext *C, void *UNUSED(arg1), void *arg2)
static int node_lasso_select_exec(bContext *C, wmOperator *op)
void NODE_OT_select_circle(wmOperatorType *ot)
void node_socket_deselect(bNode *node, bNodeSocket *sock, const bool deselect_node)
static int node_select_linked_to_exec(bContext *C, wmOperator *UNUSED(op))
static bool is_position_over_node_or_socket(SpaceNode *snode, float mouse[2])
static int node_select_all_exec(bContext *C, wmOperator *op)
void NODE_OT_select_all(wmOperatorType *ot)
static int node_lasso_select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
static bool node_select_grouped_name(SpaceNode *snode, bNode *node_act, const bool from_right)
static const EnumPropertyItem prop_select_grouped_types[]
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)
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
struct wmOperatorType * type
__forceinline const avxb select(const avxb &m, const avxb &t, const avxb &f)
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_generic_select(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)
int WM_operator_smooth_viewtx_get(const wmOperator *op)
int WM_generic_select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
int WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
int WM_generic_select_modal(bContext *C, wmOperator *op, const wmEvent *event)