[Bf-blender-cvs] [01e13e2c951] master: Cleanup: Remove unused node editor button event defines
Hans Goudey
noreply at git.blender.org
Wed Feb 24 21:53:56 CET 2021
Commit: 01e13e2c95132c92d37c832cbe9e814fae2007a2
Author: Hans Goudey
Date: Wed Feb 24 14:53:37 2021 -0600
Branches: master
https://developer.blender.org/rB01e13e2c95132c92d37c832cbe9e814fae2007a2
Cleanup: Remove unused node editor button event defines
These defines seem to be left over from the initial implementation
of the node editor. In a few places the values were used in button
creation, but the callbacks never checked the value anyway.
Node uiBlocks also had a callback what would never do anything
since the value it checked for was never used.
===================================================================
M source/blender/editors/space_node/node_draw.cc
M source/blender/editors/space_node/node_intern.h
===================================================================
diff --git a/source/blender/editors/space_node/node_draw.cc b/source/blender/editors/space_node/node_draw.cc
index 83c7dd8eea5..162f3878f7e 100644
--- a/source/blender/editors/space_node/node_draw.cc
+++ b/source/blender/editors/space_node/node_draw.cc
@@ -302,16 +302,6 @@ void ED_node_sort(bNodeTree *ntree)
}
}
-static void do_node_internal_buttons(bContext *C, void *UNUSED(node_v), int event)
-{
- if (event == B_NODE_EXEC) {
- SpaceNode *snode = CTX_wm_space_node(C);
- if (snode && snode->id) {
- ED_node_tag_update_id(snode->id);
- }
- }
-}
-
static void node_uiblocks_init(const bContext *C, bNodeTree *ntree)
{
/* Add node uiBlocks in drawing order - prevents events going to overlapping nodes. */
@@ -321,7 +311,6 @@ static void node_uiblocks_init(const bContext *C, bNodeTree *ntree)
char uiblockstr[32];
BLI_snprintf(uiblockstr, sizeof(uiblockstr), "node buttons %p", (void *)node);
node->block = UI_block_begin(C, CTX_wm_region(C), uiblockstr, UI_EMBOSS);
- UI_block_func_handle_set(node->block, do_node_internal_buttons, node);
/* this cancels events for background nodes */
UI_block_flag_enable(node->block, UI_BLOCK_CLIP_EVENTS);
@@ -1354,7 +1343,7 @@ static void node_draw_basis(const bContext *C,
UI_block_emboss_set(node->block, UI_EMBOSS_NONE);
uiBut *but = uiDefIconBut(node->block,
UI_BTYPE_BUT_TOGGLE,
- B_REDR,
+ 0,
ICON_MATERIAL,
iconofs,
rct->ymax - NODE_DY,
@@ -1380,7 +1369,7 @@ static void node_draw_basis(const bContext *C,
UI_block_emboss_set(node->block, UI_EMBOSS_NONE);
uiBut *but = uiDefIconBut(node->block,
UI_BTYPE_BUT_TOGGLE,
- B_REDR,
+ 0,
ICON_NODETREE,
iconofs,
rct->ymax - NODE_DY,
@@ -1432,7 +1421,7 @@ static void node_draw_basis(const bContext *C,
UI_block_emboss_set(node->block, UI_EMBOSS_NONE);
uiBut *but = uiDefBut(node->block,
UI_BTYPE_BUT_TOGGLE,
- B_REDR,
+ 0,
"",
rct->xmin + 0.35f * U.widget_unit,
rct->ymax - NODE_DY / 2.2f - but_size / 2,
@@ -1607,7 +1596,7 @@ static void node_draw_hidden(const bContext *C,
UI_block_emboss_set(node->block, UI_EMBOSS_NONE);
uiBut *but = uiDefBut(node->block,
UI_BTYPE_BUT_TOGGLE,
- B_REDR,
+ 0,
"",
rct->xmin + 0.35f * U.widget_unit,
centy - but_size / 2,
diff --git a/source/blender/editors/space_node/node_intern.h b/source/blender/editors/space_node/node_intern.h
index 1566c1e8571..5973d59e68f 100644
--- a/source/blender/editors/space_node/node_intern.h
+++ b/source/blender/editors/space_node/node_intern.h
@@ -307,26 +307,6 @@ extern const char *node_context_dir[];
#define NODE_RESIZE_MARGIN (0.20f * U.widget_unit)
#define NODE_LINK_RESOL 12
-/* Button events (butspace) */
-enum eNodeSpace_ButEvents {
- B_NOP = 0,
- B_REDR = 1,
- B_NODE_USEMAT,
- B_NODE_USESCENE,
- B_NODE_USETEX,
- B_TEXBROWSE,
- B_TEXALONE,
- B_TEXLOCAL,
- B_TEXDELETE,
- B_TEXPRV,
- B_AUTOTEXNAME,
- B_KEEPDATA,
- B_NODE_EXEC,
- B_MATPRV,
- B_NODE_LOADIMAGE,
- B_NODE_SETIMAGE,
-};
-
#ifdef __cplusplus
}
#endif
More information about the Bf-blender-cvs
mailing list