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:
authorLukas Toenne <lukas.toenne@googlemail.com>2013-04-18 15:36:11 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2013-04-18 15:36:11 +0400
commit4f23bd8904dfd46181a4082f1bea91dbbcaa8d86 (patch)
treed55964acef036f81f94375549aff8993069bd4a7 /source/blender/blenkernel/intern/node.c
parent4587ecd45be207a79365329d9c1266ced4043ae4 (diff)
Fix for #35010, Node Groups don't show up anymore in Material Surface. Fixing the node tree view was a bit of a todo item after pynodes.
To make the type-dependent socket linking in this template a bit more manageable, there are now separate functions that generate "items" for a particular node type consisting of the socket index, name and possibly additional properties required (currently only node groups vs. all other types). This is still nowhere near flexible enough to be used as a generic template all node systems, but works for now. In order to make this usable as a generic tool we will have to devise a way of storing, comparing, applying node settings *outside of actual node instances*. Then each node needs to tell how sockets are generated based on these properties. For the current nodes this would be far too complicated ...
Diffstat (limited to 'source/blender/blenkernel/intern/node.c')
-rw-r--r--source/blender/blenkernel/intern/node.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index 83e2ff6593b..954bb419ea7 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -796,8 +796,11 @@ bNode *nodeAddStaticNode(const struct bContext *C, bNodeTree *ntree, int type)
const char *idname = NULL;
NODE_TYPES_BEGIN(ntype)
- if (ntype->type == type) {
- idname = DATA_(ntype->idname);
+ /* do an extra poll here, because some int types are used
+ * for multiple node types, this helps find the desired type
+ */
+ if (ntype->type == type && (!ntype->poll || ntype->poll(ntype, ntree))) {
+ idname = ntype->idname;
break;
}
NODE_TYPES_END