Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_node/link_drag_search.cc
| Show First 20 Lines • Show All 224 Lines • ▼ Show 20 Lines | static void link_drag_search_exec_fn(bContext *C, void *arg1, void *arg2) | ||||
| nodeSetSelected(new_node, true); | nodeSetSelected(new_node, true); | ||||
| nodeSetActive(snode.edittree, new_node); | nodeSetActive(snode.edittree, new_node); | ||||
| /* Ideally it would be possible to tag the node tree in some way so it updates only after the | /* Ideally it would be possible to tag the node tree in some way so it updates only after the | ||||
| * translate operation is finished, but normally moving nodes around doesn't cause updates. */ | * translate operation is finished, but normally moving nodes around doesn't cause updates. */ | ||||
| ED_node_tree_propagate_change(C, &bmain, snode.edittree); | ED_node_tree_propagate_change(C, &bmain, snode.edittree); | ||||
| /* Start translation operator with the new node. */ | /* Start translation operator with the new node. */ | ||||
| wmOperatorType *ot = WM_operatortype_find("TRANSFORM_OT_translate", true); | wmOperatorType *ot = WM_operatortype_find("NODE_OT_translate_attach", true); | ||||
| BLI_assert(ot); | BLI_assert(ot); | ||||
| PointerRNA ptr; | WM_operator_name_call_ptr(C, ot, WM_OP_INVOKE_DEFAULT, nullptr); | ||||
| WM_operator_properties_create_ptr(&ptr, ot); | |||||
| RNA_boolean_set(&ptr, "view2d_edge_pan", true); | |||||
| WM_operator_name_call_ptr(C, ot, WM_OP_INVOKE_DEFAULT, &ptr); | |||||
| WM_operator_properties_free(&ptr); | |||||
| } | } | ||||
| static void link_drag_search_free_fn(void *arg) | static void link_drag_search_free_fn(void *arg) | ||||
| { | { | ||||
| LinkDragSearchStorage *storage = static_cast<LinkDragSearchStorage *>(arg); | LinkDragSearchStorage *storage = static_cast<LinkDragSearchStorage *>(arg); | ||||
| delete storage; | delete storage; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 66 Lines • Show Last 20 Lines | |||||