[Bf-blender-cvs] [47e08ee] master: Fix T49086: UV Along Stroke can be set as vector input for environment texture

Sergey Sharybin noreply at git.blender.org
Wed Aug 17 14:51:46 CEST 2016


Commit: 47e08ee924e1629a4ddd945f6173b9d9cec6c2b0
Author: Sergey Sharybin
Date:   Wed Aug 17 14:51:25 2016 +0200
Branches: master
https://developer.blender.org/rB47e08ee924e1629a4ddd945f6173b9d9cec6c2b0

Fix T49086: UV Along Stroke can be set as vector input for environment texture

===================================================================

M	source/blender/editors/space_node/node_templates.c

===================================================================

diff --git a/source/blender/editors/space_node/node_templates.c b/source/blender/editors/space_node/node_templates.c
index 09594ab..ec525e6 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);
 	}




More information about the Bf-blender-cvs mailing list