diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-08-17 15:51:25 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-08-17 15:51:25 +0300 |
commit | 47e08ee924e1629a4ddd945f6173b9d9cec6c2b0 (patch) | |
tree | 580dc04b0bd8e6afd1d026aa21388068cf6b9001 /source/blender/editors | |
parent | 294eac2991560a79aa3fc48d30965ee54508a322 (diff) |
Fix T49086: UV Along Stroke can be set as vector input for environment texture
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_node/node_templates.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/source/blender/editors/space_node/node_templates.c b/source/blender/editors/space_node/node_templates.c index 09594ab543c..ec525e684b0 100644 --- a/source/blender/editors/space_node/node_templates.c +++ b/source/blender/editors/space_node/node_templates.c @@ -428,6 +428,20 @@ static int ui_node_item_name_compare(const void *a, const void *b) return BLI_natstrcmp(type_a->ui_name, type_b->ui_name); } +static bool ui_node_item_special_poll(const bNodeTree *UNUSED(ntree), + const bNodeType *ntype) +{ + if (STREQ(ntype->idname, "ShaderNodeUVAlongStroke")) { + /* TODO(sergey): Currently we don't have Freestyle nodes edited from + * the buttons context, so can ignore it's nodes completely. + * + * However, we might want to do some extra checks here later. + */ + return false; + } + return true; +} + static void ui_node_menu_column(NodeLinkArg *arg, int nclass, const char *cname) { bNodeTree *ntree = arg->ntree; @@ -452,11 +466,17 @@ static void ui_node_menu_column(NodeLinkArg *arg, int nclass, const char *cname) BLI_array_declare(sorted_ntypes); NODE_TYPES_BEGIN(ntype) { - if (compatibility && !(ntype->compatibility & compatibility)) + if (compatibility && !(ntype->compatibility & compatibility)) { continue; + } - if (ntype->nclass != nclass) + if (ntype->nclass != nclass) { continue; + } + + if (!ui_node_item_special_poll(ntree, ntype)) { + continue; + } BLI_array_append(sorted_ntypes, ntype); } |