Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Dinges <blender@dingto.org>2012-04-13 15:58:16 +0400
committerThomas Dinges <blender@dingto.org>2012-04-13 15:58:16 +0400
commit3578a93eb830002b41925a769e180bad77764ed2 (patch)
tree2f598188d59bf7098f98de50a3bdac06814e1a1f /source/blender/editors/space_node/node_buttons.c
parenta1e6e75adda2499cb1dc2f7102b79a9927c7bdef (diff)
Node Editor / Properties Region:
* Improved checks for Grease Pencil and Active Node panel, so the panel only gets shown when there is valid data, rather than showing the empty panel. Thanks to Lukas Tönne for some help! :)
Diffstat (limited to 'source/blender/editors/space_node/node_buttons.c')
-rw-r--r--source/blender/editors/space_node/node_buttons.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/editors/space_node/node_buttons.c b/source/blender/editors/space_node/node_buttons.c
index 49151cc5dcd..c67cb5f7c71 100644
--- a/source/blender/editors/space_node/node_buttons.c
+++ b/source/blender/editors/space_node/node_buttons.c
@@ -65,13 +65,20 @@
/* ******************* node space & buttons ************** */
+/* poll for active nodetree */
+static int active_nodetree_poll(const bContext *C, PanelType *UNUSED(pt))
+{
+ SpaceNode *snode= CTX_wm_space_node(C);
+
+ return (snode && snode->nodetree);
+}
+
/* poll callback for active node */
static int active_node_poll(const bContext *C, PanelType *UNUSED(pt))
{
SpaceNode *snode= CTX_wm_space_node(C);
- // TODO: include check for whether there is an active node...
- return (snode && snode->nodetree);
+ return (snode && snode->edittree && nodeGetActive(snode->edittree));
}
/* active node */
@@ -160,7 +167,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;
+ pt->poll= active_nodetree_poll;
BLI_addtail(&art->paneltypes, pt);
}