|
Blender
V2.93
|
#include <stdlib.h>#include "DNA_node_types.h"#include "DNA_windowmanager_types.h"#include "BLI_lasso_2d.h"#include "BLI_listbase.h"#include "BLI_math.h"#include "BLI_rect.h"#include "BLI_string.h"#include "BLI_string_search.h"#include "BLI_string_utf8.h"#include "BLI_utildefines.h"#include "BKE_context.h"#include "BKE_main.h"#include "BKE_node.h"#include "BKE_workspace.h"#include "ED_node.h"#include "ED_screen.h"#include "ED_select_utils.h"#include "ED_view3d.h"#include "RNA_access.h"#include "RNA_define.h"#include "WM_api.h"#include "WM_types.h"#include "UI_interface.h"#include "UI_resources.h"#include "UI_view2d.h"#include "DEG_depsgraph.h"#include "MEM_guardedalloc.h"#include "node_intern.h"Go to the source code of this file.
Select Grouped Operator | |
| enum | { NODE_SELECT_GROUPED_TYPE = 0 , NODE_SELECT_GROUPED_COLOR = 1 , NODE_SELECT_GROUPED_PREFIX = 2 , NODE_SELECT_GROUPED_SUFIX = 3 } |
| static bool | node_select_grouped_type (SpaceNode *snode, bNode *node_act) |
| static bool | node_select_grouped_color (SpaceNode *snode, bNode *node_act) |
| static bool | node_select_grouped_name (SpaceNode *snode, bNode *node_act, const bool from_right) |
| static int | node_select_grouped_exec (bContext *C, wmOperator *op) |
| void | NODE_OT_select_grouped (wmOperatorType *ot) |
| anonymous enum |
| Enumerator | |
|---|---|
| NODE_SELECT_GROUPED_TYPE | |
| NODE_SELECT_GROUPED_COLOR | |
| NODE_SELECT_GROUPED_PREFIX | |
| NODE_SELECT_GROUPED_SUFIX | |
Definition at line 362 of file node_select.c.
|
static |
Definition at line 833 of file node_select.c.
References BLI_lasso_boundbox(), BLI_lasso_is_point_inside(), BLI_rctf_cent_x(), BLI_rctf_cent_y(), BLI_rcti_isect_pt(), C, CTX_wm_region(), CTX_wm_space_node(), ED_node_select_all(), SpaceNode::edittree, ListBase::first, NA_SELECTED, NC_NODE, node, NODE_SELECT, bNodeTree::nodes, nodeSetSelected(), NULL, SEL_DESELECT, SEL_OP_SUB, SEL_OP_USE_PRE_DESELECT, select(), UI_view2d_view_to_region_clip(), ARegion::v2d, and WM_event_add_notifier().
Referenced by node_lasso_select_exec().
|
static |
Function to detect if there is a visible view3d that uses workbench in texture mode. This function is for fixing T76970 for Blender 2.83. The actual fix should add a mechanism in the depsgraph that can be used by the draw engines to check if they need to be redrawn.
We don't want to add these risky changes this close before releasing 2.83 without good testing hence this workaround. There are still cases were too many updates happen. For example when you have both a Cycles and workbench with textures viewport.
Definition at line 73 of file node_select.c.
References blender::compositor::area(), bScreen::areabase, BKE_workspace_active_screen_get(), ED_view3d_has_workbench_in_texture_color(), LISTBASE_FOREACH, scene, SPACE_VIEW3D, and wmWindowManager::windows.
Referenced by node_mouse_select(), and node_select_single().
Definition at line 142 of file node_select.c.
References C, CTX_wm_region(), CTX_wm_space_node(), is_position_over_node_or_socket(), wmEvent::mval, UI_view2d_region_to_view(), and ARegion::v2d.
Referenced by node_box_select_invoke(), and node_lasso_select_invoke().
Definition at line 127 of file node_select.c.
References SpaceNode::edittree, node, node_find_indicated_socket(), node_under_mouse_tweak(), SOCK_IN, and SOCK_OUT.
Referenced by is_event_over_node_or_socket().
|
static |
Definition at line 675 of file node_select.c.
References BLI_rctf_inside_rctf(), BLI_rctf_isect(), C, CTX_wm_region(), CTX_wm_space_node(), ED_node_select_all(), ED_node_sort(), SpaceNode::edittree, is_inside(), LISTBASE_FOREACH, NA_SELECTED, NC_NODE, node, NODE_FRAME, bNodeTree::nodes, nodeSetSelected(), NULL, OPERATOR_FINISHED, wmOperator::ptr, RNA_enum_get(), SEL_DESELECT, SEL_OP_SUB, SEL_OP_USE_PRE_DESELECT, select(), UI_view2d_region_to_view_rctf(), ARegion::v2d, WM_event_add_notifier(), and WM_operator_properties_border_to_rctf().
Referenced by NODE_OT_select_box().
|
static |
Definition at line 711 of file node_select.c.
References C, is_event_over_node_or_socket(), OPERATOR_CANCELLED, OPERATOR_PASS_THROUGH, wmOperator::ptr, RNA_boolean_get(), and WM_gesture_box_invoke().
Referenced by NODE_OT_select_box().
|
static |
Definition at line 757 of file node_select.c.
References BLI_rctf_isect_circle(), BLI_rctf_size_x(), BLI_rcti_size_x(), C, CTX_wm_region(), CTX_wm_space_node(), View2D::cur, wmOperator::customdata, ED_node_select_all(), ED_select_op_modal(), SpaceNode::edittree, ListBase::first, float(), NA_SELECTED, NC_NODE, node, bNodeTree::nodes, nodeSetSelected(), NULL, OPERATOR_FINISHED, wmOperator::ptr, RNA_enum_get(), RNA_int_get(), SEL_DESELECT, SEL_OP_SUB, SEL_OP_USE_PRE_DESELECT, select(), UI_view2d_region_to_view(), ARegion::v2d, ARegion::winrct, WM_event_add_notifier(), WM_gesture_is_modal_first(), x, and y.
Referenced by NODE_OT_select_circle().
| void node_deselect_all | ( | SpaceNode * | snode | ) |
Definition at line 204 of file node_select.c.
References SpaceNode::edittree, ListBase::first, node, bNodeTree::nodes, and nodeSetSelected().
Referenced by add_reroute_exec(), node_add_node(), and node_clipboard_paste_exec().
| void node_deselect_all_input_sockets | ( | SpaceNode * | snode, |
| const bool | deselect_nodes | ||
| ) |
Definition at line 213 of file node_select.c.
References SpaceNode::edittree, ListBase::first, bNodeSocket::flag, bNodeSocket::next, node, bNodeTree::nodes, and SELECT.
Referenced by node_make_link_exec().
| void node_deselect_all_output_sockets | ( | SpaceNode * | snode, |
| const bool | deselect_nodes | ||
| ) |
Definition at line 246 of file node_select.c.
References SpaceNode::edittree, ListBase::first, bNodeSocket::flag, bNodeSocket::next, node, bNodeTree::nodes, and SELECT.
Referenced by node_make_link_exec().
|
static |
Definition at line 1180 of file node_select.c.
References BLI_snprintf(), BLI_strncpy(), node, and str.
Referenced by node_find_update_fn().
|
static |
Definition at line 1223 of file node_select.c.
References blender::compositor::active, C, CTX_wm_region(), CTX_wm_space_node(), View2D::cur, NODE_SELECT, node_select_single(), space_node_view_flag(), ARegion::v2d, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by node_find_menu().
Definition at line 1240 of file node_select.c.
References C, node_find_exec_fn(), node_find_update_fn(), NULL, wmOperator::type, UI_block_begin(), UI_block_bounds_set_popup(), UI_block_flag_enable(), UI_BLOCK_LOOP, UI_BLOCK_MOVEMOUSE_QUIT, UI_BLOCK_SEARCH_MENU, UI_BLOCK_THEME_STYLE_POPUP, UI_block_theme_style_set(), UI_BTYPE_LABEL, UI_BUT_ACTIVATE_ON_INIT, UI_but_flag_enable(), UI_but_func_search_set(), UI_EMBOSS, UI_searchbox_size_x(), UI_searchbox_size_y(), UI_UNIT_Y, uiDefBut(), and uiDefSearchBut().
Referenced by node_find_node_invoke().
|
static |
Definition at line 1289 of file node_select.c.
References C, node_find_menu(), NULL, OPERATOR_CANCELLED, and UI_popup_block_invoke().
Referenced by NODE_OT_find_node().
|
static |
Definition at line 1191 of file node_select.c.
References ARRAY_SIZE, BLI_string_search_add(), BLI_string_search_free(), BLI_string_search_new(), BLI_string_search_query(), C, CTX_wm_space_node(), SpaceNode::edittree, LISTBASE_FOREACH, MEM_freeN, node, node_find_create_label(), bNodeTree::nodes, str, and UI_search_item_add().
Referenced by node_find_menu().
|
static |
Definition at line 882 of file node_select.c.
References C, do_lasso_select_node(), MEM_freeN, OPERATOR_FINISHED, OPERATOR_PASS_THROUGH, wmOperator::ptr, RNA_enum_get(), and WM_gesture_lasso_path_to_array().
Referenced by NODE_OT_select_lasso().
|
static |
Definition at line 822 of file node_select.c.
References C, is_event_over_node_or_socket(), OPERATOR_CANCELLED, OPERATOR_PASS_THROUGH, wmOperator::ptr, RNA_boolean_get(), and WM_gesture_lasso_invoke().
Referenced by NODE_OT_select_lasso().
|
static |
Definition at line 482 of file node_select.c.
References C, CTX_data_active_object(), CTX_data_main(), CTX_data_scene(), CTX_wm_manager(), CTX_wm_region(), CTX_wm_space_node(), DEG_id_tag_update(), ED_node_set_active(), ED_node_set_active_viewer_key(), ED_node_sort(), SpaceNode::edittree, ListBase::first, bNodeSocket::flag, has_workbench_in_texture_color(), bNodeTree::id, ID_RECALC_COPY_ON_WRITE, NA_SELECTED, NC_NODE, bNodeSocket::next, bNode::next, node, NODE_ACTIVE, node_find_indicated_socket(), node_socket_deselect(), node_socket_select(), node_socket_toggle(), node_toggle(), node_under_mouse_select(), bNodeTree::nodes, nodeSetSelected(), NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, OPERATOR_RUNNING_MODAL, bNode::outputs, wmOperator::ptr, RNA_boolean_get(), scene, SELECT, SOCK_IN, SOCK_OUT, UI_view2d_region_to_view(), ARegion::v2d, and WM_event_add_notifier().
Referenced by node_select_exec().
| void NODE_OT_find_node | ( | wmOperatorType * | ot | ) |
Definition at line 1295 of file node_select.c.
References wmOperatorType::description, ED_operator_node_active(), wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, node_find_node_invoke(), OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, RNA_def_boolean(), and wmOperatorType::srna.
Referenced by node_operatortypes().
| void NODE_OT_select | ( | wmOperatorType * | ot | ) |
Definition at line 639 of file node_select.c.
References wmOperatorType::description, ED_operator_node_active(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, node_select_exec(), OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, PROP_SKIP_SAVE, RNA_def_boolean(), RNA_def_property_flag(), wmOperatorType::srna, WM_generic_select_invoke(), WM_generic_select_modal(), and WM_operator_properties_generic_select().
Referenced by node_operatortypes().
| void NODE_OT_select_all | ( | wmOperatorType * | ot | ) |
Definition at line 947 of file node_select.c.
References wmOperatorType::description, ED_operator_node_active(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, node_select_all_exec(), OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, and WM_operator_properties_select_all().
Referenced by node_operatortypes().
| void NODE_OT_select_box | ( | wmOperatorType * | ot | ) |
Definition at line 722 of file node_select.c.
References wmOperatorType::cancel, wmOperatorType::description, ED_operator_node_active(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, node_box_select_exec(), node_box_select_invoke(), OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, RNA_def_boolean(), wmOperatorType::srna, WM_gesture_box_cancel(), WM_gesture_box_modal(), WM_operator_properties_gesture_box(), and WM_operator_properties_select_operation_simple().
Referenced by node_operatortypes().
| void NODE_OT_select_circle | ( | wmOperatorType * | ot | ) |
Definition at line 794 of file node_select.c.
References wmOperatorType::description, ED_operator_node_active(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, node_circleselect_exec(), OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, WM_gesture_circle_invoke(), WM_gesture_circle_modal(), WM_operator_properties_gesture_circle(), and WM_operator_properties_select_operation_simple().
Referenced by node_operatortypes().
| void NODE_OT_select_grouped | ( | wmOperatorType * | ot | ) |
Definition at line 416 of file node_select.c.
References wmOperatorType::description, ED_operator_node_active(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, NODE_SELECT_GROUPED_COLOR, node_select_grouped_exec(), NODE_SELECT_GROUPED_PREFIX, NODE_SELECT_GROUPED_SUFIX, NODE_SELECT_GROUPED_TYPE, NULL, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, wmOperatorType::prop, prop_select_grouped_types, RNA_def_boolean(), RNA_def_enum(), wmOperatorType::srna, and WM_menu_invoke().
Referenced by node_operatortypes().
| void NODE_OT_select_lasso | ( | wmOperatorType * | ot | ) |
Definition at line 899 of file node_select.c.
References wmOperatorType::cancel, wmOperatorType::description, ED_operator_node_active(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, node_lasso_select_exec(), node_lasso_select_invoke(), OPTYPE_UNDO, ot, wmOperatorType::poll, RNA_def_boolean(), wmOperatorType::srna, WM_gesture_lasso_cancel(), WM_gesture_lasso_modal(), WM_operator_properties_gesture_lasso(), and WM_operator_properties_select_operation_simple().
Referenced by node_operatortypes().
| void NODE_OT_select_linked_from | ( | wmOperatorType * | ot | ) |
Definition at line 1053 of file node_select.c.
References wmOperatorType::description, ED_operator_node_active(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, node_select_linked_from_exec(), OPTYPE_REGISTER, OPTYPE_UNDO, ot, and wmOperatorType::poll.
Referenced by node_operatortypes().
| void NODE_OT_select_linked_to | ( | wmOperatorType * | ot | ) |
Definition at line 1001 of file node_select.c.
References wmOperatorType::description, ED_operator_node_active(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, node_select_linked_to_exec(), OPTYPE_REGISTER, OPTYPE_UNDO, ot, and wmOperatorType::poll.
Referenced by node_operatortypes().
| void NODE_OT_select_same_type_step | ( | wmOperatorType * | ot | ) |
Definition at line 1157 of file node_select.c.
References wmOperatorType::description, ED_operator_node_active(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, node_select_same_type_step_exec(), OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, RNA_def_boolean(), and wmOperatorType::srna.
Referenced by node_operatortypes().
|
static |
Definition at line 933 of file node_select.c.
References C, CTX_wm_space_node(), ED_node_select_all(), ED_node_sort(), SpaceNode::edittree, NA_SELECTED, NC_NODE, bNodeTree::nodes, NULL, OPERATOR_FINISHED, wmOperator::ptr, RNA_enum_get(), and WM_event_add_notifier().
Referenced by NODE_OT_select_all().
|
static |
Definition at line 623 of file node_select.c.
References C, node_mouse_select(), OPERATOR_PASS_THROUGH, wmOperator::ptr, RNA_boolean_get(), and RNA_int_get().
Referenced by NODE_OT_select().
Definition at line 304 of file node_select.c.
References bNode::color, compare_v3v3(), SpaceNode::edittree, ListBase::first, node, bNodeTree::nodes, nodeSetSelected(), and SELECT.
Referenced by node_select_grouped_exec().
|
static |
Definition at line 369 of file node_select.c.
References C, CTX_wm_space_node(), ED_node_sort(), SpaceNode::edittree, ListBase::first, NA_SELECTED, NC_NODE, node, node_select_grouped_color(), NODE_SELECT_GROUPED_COLOR, node_select_grouped_name(), NODE_SELECT_GROUPED_PREFIX, NODE_SELECT_GROUPED_SUFIX, node_select_grouped_type(), NODE_SELECT_GROUPED_TYPE, nodeGetActive(), bNodeTree::nodes, nodeSetSelected(), NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, RNA_boolean_get(), RNA_enum_get(), type, and WM_event_add_notifier().
Referenced by NODE_OT_select_grouped().
|
static |
Definition at line 321 of file node_select.c.
References BLI_str_partition_ex_utf8(), SpaceNode::edittree, ListBase::first, bNode::name, node, bNodeTree::nodes, nodeSetSelected(), NULL, SELECT, STREQ, and STREQLEN.
Referenced by node_select_grouped_exec().
Definition at line 287 of file node_select.c.
References SpaceNode::edittree, ListBase::first, node, bNodeTree::nodes, nodeSetSelected(), SELECT, and bNode::type.
Referenced by node_select_grouped_exec().
|
static |
Definition at line 1022 of file node_select.c.
References C, CTX_wm_space_node(), ED_node_sort(), SpaceNode::edittree, ListBase::first, bNode::flag, bNodeLink::fromnode, bNodeTree::links, NA_SELECTED, NC_NODE, bNodeLink::next, node, NODE_SELECT, NODE_TEST, nodeLinkIsHidden(), bNodeTree::nodes, nodeSetSelected(), NULL, OPERATOR_FINISHED, bNodeLink::tonode, and WM_event_add_notifier().
Referenced by NODE_OT_select_linked_from().
|
static |
Definition at line 970 of file node_select.c.
References C, CTX_wm_space_node(), ED_node_sort(), SpaceNode::edittree, ListBase::first, bNode::flag, bNodeLink::fromnode, bNodeTree::links, NA_SELECTED, NC_NODE, bNodeLink::next, node, NODE_SELECT, NODE_TEST, nodeLinkIsHidden(), bNodeTree::nodes, nodeSetSelected(), NULL, OPERATOR_FINISHED, bNodeLink::tonode, and WM_event_add_notifier().
Referenced by NODE_OT_select_linked_to().
|
static |
Definition at line 1074 of file node_select.c.
References Freestyle::a, blender::compositor::active, C, CTX_wm_region(), CTX_wm_space_node(), View2D::cur, SpaceNode::edittree, MEM_freeN, node, NODE_SELECT, node_select_single(), nodeGetActive(), ntreeGetDependencyList(), NULL, OPERATOR_FINISHED, wmOperator::ptr, RNA_boolean_get(), space_node_view_flag(), ARegion::v2d, WM_operator_smooth_viewtx_get(), rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by NODE_OT_select_same_type_step().
Definition at line 454 of file node_select.c.
References C, CTX_data_active_object(), CTX_data_main(), CTX_data_scene(), CTX_wm_manager(), CTX_wm_space_node(), DEG_id_tag_update(), ED_node_set_active(), ED_node_set_active_viewer_key(), ED_node_sort(), SpaceNode::edittree, ListBase::first, has_workbench_in_texture_color(), bNodeTree::id, ID_RECALC_COPY_ON_WRITE, NA_SELECTED, NC_NODE, bNode::next, node, bNodeTree::nodes, nodeSetSelected(), NULL, scene, and WM_event_add_notifier().
Referenced by node_find_exec_fn(), node_select_same_type_step_exec(), and node_toggle_button_cb().
| void node_socket_deselect | ( | bNode * | node, |
| bNodeSocket * | sock, | ||
| const bool | deselect_node | ||
| ) |
Definition at line 166 of file node_select.c.
References bNodeSocket::flag, bNodeSocket::next, node, and SELECT.
Referenced by node_mouse_select(), and node_socket_toggle().
| void node_socket_select | ( | bNode * | node, |
| bNodeSocket * | sock | ||
| ) |
Definition at line 156 of file node_select.c.
References bNodeSocket::flag, node, and SELECT.
Referenced by node_mouse_select(), and node_socket_toggle().
|
static |
Definition at line 193 of file node_select.c.
References bNodeSocket::flag, node, node_socket_deselect(), node_socket_select(), and SELECT.
Referenced by node_mouse_select().
|
static |
Definition at line 151 of file node_select.c.
References node, nodeSetSelected(), and SELECT.
Referenced by node_mouse_select().
Definition at line 99 of file node_select.c.
References ListBase::last, node, bNodeTree::nodes, ntree, and NULL.
Referenced by node_mouse_select().
Definition at line 113 of file node_select.c.
References ListBase::last, node, bNodeTree::nodes, ntree, and NULL.
Referenced by is_position_over_node_or_socket().