[Bf-blender-cvs] [ea474dda620] master: Fix: Node edge pan and remove on cancel doesn't work

Hans Goudey noreply at git.blender.org
Mon Sep 12 23:44:09 CEST 2022


Commit: ea474dda620036ff7003cbb6f2826952a08ceb14
Author: Hans Goudey
Date:   Mon Sep 12 16:43:54 2022 -0500
Branches: master
https://developer.blender.org/rBea474dda620036ff7003cbb6f2826952a08ceb14

Fix: Node edge pan and remove on cancel doesn't work

Caused by 4a71765f9a41 which used an operator that didn't have the
properties it expected.

===================================================================

M	source/blender/editors/space_node/link_drag_search.cc
M	source/blender/editors/space_node/node_ops.cc

===================================================================

diff --git a/source/blender/editors/space_node/link_drag_search.cc b/source/blender/editors/space_node/link_drag_search.cc
index a4be0a65230..f1387da97b5 100644
--- a/source/blender/editors/space_node/link_drag_search.cc
+++ b/source/blender/editors/space_node/link_drag_search.cc
@@ -227,12 +227,10 @@ static void link_drag_search_exec_fn(bContext *C, void *arg1, void *arg2)
   ED_node_tree_propagate_change(C, &bmain, snode.edittree);
 
   /* Start translation operator with the new node. */
-  wmOperatorType *ot = WM_operatortype_find("NODE_OT_translate_attach", true);
+  wmOperatorType *ot = WM_operatortype_find("NODE_OT_translate_attach_remove_on_cancel", true);
   BLI_assert(ot);
   PointerRNA ptr;
   WM_operator_properties_create_ptr(&ptr, ot);
-  RNA_boolean_set(&ptr, "view2d_edge_pan", true);
-  RNA_boolean_set(&ptr, "remove_on_cancel", true);
   WM_operator_name_call_ptr(C, ot, WM_OP_INVOKE_DEFAULT, &ptr, nullptr);
   WM_operator_properties_free(&ptr);
 }
diff --git a/source/blender/editors/space_node/node_ops.cc b/source/blender/editors/space_node/node_ops.cc
index 3b3189983e2..a208370a6f9 100644
--- a/source/blender/editors/space_node/node_ops.cc
+++ b/source/blender/editors/space_node/node_ops.cc
@@ -144,7 +144,7 @@ void ED_operatormacros_node()
   WM_operatortype_macro_define(ot, "NODE_OT_attach");
   WM_operatortype_macro_define(ot, "NODE_OT_insert_offset");
 
-  /* NODE_OT_translate_attach with remove_on_canel set to true */
+  /* NODE_OT_translate_attach with remove_on_cancel set to true. */
   ot = WM_operatortype_append_macro("NODE_OT_translate_attach_remove_on_cancel",
                                     "Move and Attach",
                                     "Move nodes and attach to frame",



More information about the Bf-blender-cvs mailing list