From bdce58a42c3ca63773ce9c6b32189cfe10b27039 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Fri, 13 Apr 2012 00:04:56 +0000 Subject: Code cleanup: * Remove some non used *_button_register functions, panels are done in python. * Remove do_node_region_buttons, was not used anymore. Fix: * Only show Grease Pencil panel in the Node editor, when there is a valid nodetree. --- source/blender/editors/space_node/node_buttons.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'source/blender/editors/space_node/node_buttons.c') diff --git a/source/blender/editors/space_node/node_buttons.c b/source/blender/editors/space_node/node_buttons.c index dac185bf46e..49151cc5dcd 100644 --- a/source/blender/editors/space_node/node_buttons.c +++ b/source/blender/editors/space_node/node_buttons.c @@ -64,19 +64,6 @@ /* ******************* node space & buttons ************** */ -#define B_NOP 1 -#define B_REDR 2 - -static void do_node_region_buttons(bContext *C, void *UNUSED(arg), int event) -{ - //SpaceNode *snode= CTX_wm_space_node(C); - - switch(event) { - case B_REDR: - ED_area_tag_redraw(CTX_wm_area(C)); - return; /* no notifier! */ - } -} /* poll callback for active node */ static int active_node_poll(const bContext *C, PanelType *UNUSED(pt)) @@ -94,7 +81,6 @@ static void active_node_panel(const bContext *C, Panel *pa) bNodeTree *ntree= (snode) ? snode->edittree : NULL; bNode *node = (ntree) ? nodeGetActive(ntree) : NULL; // xxx... for editing group nodes uiLayout *layout= pa->layout; - uiBlock *block; PointerRNA ptr; /* verify pointers, and create RNA pointer for the node */ @@ -105,11 +91,6 @@ static void active_node_panel(const bContext *C, Panel *pa) //else RNA_pointer_create(&ntree->id, &RNA_Node, node, &ptr); - /* set update callback */ - // xxx is this really needed - block= uiLayoutGetBlock(layout); - uiBlockSetHandleFunc(block, do_node_region_buttons, NULL); - /* draw this node's name, etc. */ uiItemR(layout, &ptr, "label", 0, NULL, ICON_NODE); uiItemS(layout); @@ -179,6 +160,7 @@ void node_buttons_register(ARegionType *art) strcpy(pt->idname, "NODE_PT_gpencil"); strcpy(pt->label, "Grease Pencil"); pt->draw= gpencil_panel_standard; + pt->poll= active_node_poll; BLI_addtail(&art->paneltypes, pt); } -- cgit v1.2.3