Enhancement: By default do not show the previews of composite nodes

only input nodes will show the preview by default.
This commit is contained in:
Jeroen Bakker 2013-12-01 21:56:52 +01:00
parent f120adf65c
commit 6c83d92d58

@ -122,7 +122,6 @@ static void node_init(const struct bContext *C, bNodeTree *ntree, bNode *node)
node->miniwidth = 42.0f;
node->height = ntype->height;
node->color[0] = node->color[1] = node->color[2] = 0.608; /* default theme color */
/* initialize the node name with the node label.
* note: do this after the initfunc so nodes get their data set which may be used in naming
* (node groups for example) */
@ -134,6 +133,13 @@ static void node_init(const struct bContext *C, bNodeTree *ntree, bNode *node)
nodeUniqueName(ntree, node);
node_add_sockets_from_type(ntree, node, ntype);
/* Composite node will only show previews for input classes
* by default, other will be hidden
* but can be made visible with the show_preview option */
if (ntree->typeinfo->type == NTREE_COMPOSIT && ntype->nclass != NODE_CLASS_INPUT) {
node->flag &= ~NODE_PREVIEW;
}
if (ntype->initfunc != NULL)
ntype->initfunc(ntree, node);