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:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2014-09-07 17:15:18 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2014-09-07 17:16:24 +0400
commit28cce475f2c7ff0e9d367b8a9fd9662336dadb4b (patch)
tree9cc822ce9318c11d303303d0cf5fb9601251c60a /release
parent65da19b0cde2f77ee0b89528c130b5bab606ec52 (diff)
Fix for line style shader nodes also shown in the Add menu of other shader types.
Problem report by Nahuel Belich through Facebook, thanks!
Diffstat (limited to 'release')
-rw-r--r--release/scripts/startup/nodeitems_builtins.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/release/scripts/startup/nodeitems_builtins.py b/release/scripts/startup/nodeitems_builtins.py
index e75f2037d1a..5dccda789e0 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=[