Skip to content

Commit

Permalink
Fix active world output not updating
Browse files Browse the repository at this point in the history
Fix #143
  • Loading branch information
gregzaal committed Mar 10, 2022
1 parent 5e32190 commit b9b3f3e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": "",
Expand Down
10 changes: 7 additions & 3 deletions functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit b9b3f3e

Please sign in to comment.