[Bf-blender-cvs] [28cce47] master: Fix for line style shader nodes also shown in the Add menu of other shader types.

Tamito Kajiyama noreply at git.blender.org
Sun Sep 7 15:16:47 CEST 2014


Commit: 28cce475f2c7ff0e9d367b8a9fd9662336dadb4b
Author: Tamito Kajiyama
Date:   Sun Sep 7 22:15:18 2014 +0900
Branches: master
https://developer.blender.org/rB28cce475f2c7ff0e9d367b8a9fd9662336dadb4b

Fix for line style shader nodes also shown in the Add menu of other shader types.

Problem report by Nahuel Belich through Facebook, thanks!

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

M	release/scripts/startup/nodeitems_builtins.py

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

diff --git a/release/scripts/startup/nodeitems_builtins.py b/release/scripts/startup/nodeitems_builtins.py
index e75f203..5dccda7 100644
--- a/release/scripts/startup/nodeitems_builtins.py
+++ b/release/scripts/startup/nodeitems_builtins.py
@@ -105,6 +105,13 @@ def group_input_output_item_poll(context):
     return False
 
 
+# only show input/output nodes when editing line style node trees
+def line_style_shader_nodes_poll(context):
+    snode = context.space_data
+    return (snode.tree_type == 'ShaderNodeTree' and
+            snode.shader_type == 'LINESTYLE')
+
+
 # All standard node categories currently used in nodes.
 
 shader_node_categories = [
@@ -169,14 +176,14 @@ shader_node_categories = [
         NodeItem("ShaderNodeParticleInfo"),
         NodeItem("ShaderNodeCameraData"),
         NodeItem("ShaderNodeUVMap"),
-        NodeItem("ShaderNodeUVAlongStroke"),
+        NodeItem("ShaderNodeUVAlongStroke", poll=line_style_shader_nodes_poll),
         NodeItem("NodeGroupInput", poll=group_input_output_item_poll),
         ]),
     ShaderNewNodeCategory("SH_NEW_OUTPUT", "Output", items=[
         NodeItem("ShaderNodeOutputMaterial"),
         NodeItem("ShaderNodeOutputLamp"),
         NodeItem("ShaderNodeOutputWorld"),
-        NodeItem("ShaderNodeOutputLineStyle"),
+        NodeItem("ShaderNodeOutputLineStyle", poll=line_style_shader_nodes_poll),
         NodeItem("NodeGroupOutput", poll=group_input_output_item_poll),
         ]),
     ShaderNewNodeCategory("SH_NEW_SHADER", "Shader", items=[




More information about the Bf-blender-cvs mailing list