[Bf-extensions-cvs] [ebe0bd56] master: Node Wrangler: create world output if the node tree is of type world

Damien Picard noreply at git.blender.org
Fri Jun 10 09:59:03 CEST 2022


Commit: ebe0bd5677af5810972feb212a027b2a30f1ee6a
Author: Damien Picard
Date:   Thu Jun 2 11:48:17 2022 +0200
Branches: master
https://developer.blender.org/rBAebe0bd5677af5810972feb212a027b2a30f1ee6a

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.

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

M	node_wrangler.py

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

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':



More information about the Bf-extensions-cvs mailing list