diff --git a/__init__.py b/__init__.py index 8cef9bd..6b4df04 100644 --- a/__init__.py +++ b/__init__.py @@ -20,7 +20,7 @@ "name": "Gaffer", "description": "Master your lighting workflow with easy access to light properties, HDRIs and other tools", "author": "Greg Zaal", - "version": (3, 1, 10), + "version": (3, 1, 11), "blender": (2, 90, 0), "location": "3D View > Sidebar & World Settings > HDRI", "warning": "", diff --git a/functions.py b/functions.py index 3e6b3cf..cda2ef6 100644 --- a/functions.py +++ b/functions.py @@ -835,6 +835,13 @@ def warmth_node(context): """ Return requested node, or create it """ nodes = context.scene.world.node_tree.nodes + + if t == 'ShaderNodeOutputWorld': + for n in nodes: + if hasattr(n, 'is_active_output'): + if n.is_active_output: + return n + name = "HDRIHandler_" + t + ("_B" if background else "") for n in nodes: if n.name == name: @@ -975,9 +982,6 @@ def setup_hdri(self, context): n_sat = handler_node(context, "ShaderNodeHueSaturation") n_shader = handler_node(context, "ShaderNodeBackground") n_out = handler_node(context, "ShaderNodeOutputWorld") - for n in w.node_tree.nodes: - if hasattr(n, "is_active_output"): - n.is_active_output = n == n_out # Set the handler node to be the only active output if extra_nodes: n_img_b = handler_node(context, "ShaderNodeTexEnvironment", background=gaf_props.hdri_use_jpg_background)