[Bf-blender-cvs] [ce359da5b3a] master: Fix T86894: Geometry nodes drag and drop creates a duplicate node

Charlie Jolly noreply at git.blender.org
Wed Mar 24 15:27:47 CET 2021


Commit: ce359da5b3ac98c9f7cfd6593cc1769ec3b7247b
Author: Charlie Jolly
Date:   Wed Mar 24 14:04:29 2021 +0000
Branches: master
https://developer.blender.org/rBce359da5b3ac98c9f7cfd6593cc1769ec3b7247b

Fix T86894: Geometry nodes drag and drop creates a duplicate node

Added a condition to the poll so that it ignores drag and drop on the button. The Paste Name operator is just not implemented. Doesn't work for shading nodes either.

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D10769

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

M	source/blender/editors/space_node/node_add.c

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

diff --git a/source/blender/editors/space_node/node_add.c b/source/blender/editors/space_node/node_add.c
index 8369f3e9258..c4fe9e9e531 100644
--- a/source/blender/editors/space_node/node_add.c
+++ b/source/blender/editors/space_node/node_add.c
@@ -498,7 +498,8 @@ static int node_add_object_invoke(bContext *C, wmOperator *op, const wmEvent *ev
 static bool node_add_object_poll(bContext *C)
 {
   const SpaceNode *snode = CTX_wm_space_node(C);
-  return ED_operator_node_editable(C) && ELEM(snode->nodetree->type, NTREE_GEOMETRY);
+  return ED_operator_node_editable(C) && ELEM(snode->nodetree->type, NTREE_GEOMETRY) &&
+         !UI_but_active_drop_name(C);
 }
 
 void NODE_OT_add_object(wmOperatorType *ot)
@@ -596,7 +597,8 @@ static int node_add_texture_invoke(bContext *C, wmOperator *op, const wmEvent *e
 static bool node_add_texture_poll(bContext *C)
 {
   const SpaceNode *snode = CTX_wm_space_node(C);
-  return ED_operator_node_editable(C) && ELEM(snode->nodetree->type, NTREE_GEOMETRY);
+  return ED_operator_node_editable(C) && ELEM(snode->nodetree->type, NTREE_GEOMETRY) &&
+         !UI_but_active_drop_name(C);
 }
 
 void NODE_OT_add_texture(wmOperatorType *ot)
@@ -700,7 +702,8 @@ static int node_add_collection_invoke(bContext *C, wmOperator *op, const wmEvent
 static bool node_add_collection_poll(bContext *C)
 {
   const SpaceNode *snode = CTX_wm_space_node(C);
-  return ED_operator_node_editable(C) && ELEM(snode->nodetree->type, NTREE_GEOMETRY);
+  return ED_operator_node_editable(C) && ELEM(snode->nodetree->type, NTREE_GEOMETRY) &&
+         !UI_but_active_drop_name(C);
 }
 
 void NODE_OT_add_collection(wmOperatorType *ot)



More information about the Bf-blender-cvs mailing list