diff options
author | Damien Picard <dam.pic@free.fr> | 2022-06-02 12:48:17 +0300 |
---|---|---|
committer | Damien Picard <dam.pic@free.fr> | 2022-06-10 10:57:29 +0300 |
commit | ebe0bd5677af5810972feb212a027b2a30f1ee6a (patch) | |
tree | ad4090a2ebcf5cb4670606617042a1262f8708f0 /node_wrangler.py | |
parent | 67273f17e8a5bf845e44e32e72071008e3369e36 (diff) |
Node Wrangler: create world output if the node tree is of type world
When using the node.nw_link_out operator (O key) in a world node tree,
a material output would be created instead of a world one.
Diffstat (limited to 'node_wrangler.py')
-rw-r--r-- | node_wrangler.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/node_wrangler.py b/node_wrangler.py index 30331ce2..1a815dc6 100644 --- a/node_wrangler.py +++ b/node_wrangler.py @@ -3777,7 +3777,10 @@ class NWLinkToOutputNode(Operator): if not output_node: bpy.ops.node.select_all(action="DESELECT") if tree_type == 'ShaderNodeTree': - output_node = nodes.new('ShaderNodeOutputMaterial') + if context.space_data.shader_type == 'OBJECT': + output_node = nodes.new('ShaderNodeOutputMaterial') + elif context.space_data.shader_type == 'WORLD': + output_node = nodes.new('ShaderNodeOutputWorld') elif tree_type == 'CompositorNodeTree': output_node = nodes.new('CompositorNodeComposite') elif tree_type == 'TextureNodeTree': |