Skip to content

Commit

Permalink
Merge pull request #52 from BrendanParmer/NullImageFix
Browse files Browse the repository at this point in the history
fix: image nodes no longer throw errors when no image is selected
  • Loading branch information
BrendanParmer authored May 25, 2023
2 parents 700ae47 + 53cccee commit 94ad28a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion geo_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def process_geo_nodes_group(node_tree, level, node_vars, used_vars):
curve_node_settings(node, file, inner, node_var)
elif node.bl_idname in image_nodes:
img = node.image
if img.source in {'FILE', 'GENERATED', 'TILED'}:
if img is not None and img.source in {'FILE', 'GENERATED', 'TILED'}:
save_image(img, addon_dir)
load_image(img, file, inner, f"{node_var}.image")
elif node.bl_idname == 'GeometryNodeSimulationInput':
Expand Down
2 changes: 1 addition & 1 deletion materials.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def process_mat_node_group(node_tree, level, node_vars, used_vars):

elif node.bl_idname in image_nodes:
img = node.image
if img.source in {'FILE', 'GENERATED', 'TILED'}:
if img is not None and img.source in {'FILE', 'GENERATED', 'TILED'}:
save_image(img, addon_dir)
load_image(img, file, inner, f"{node_var}.image")
image_user_settings(node, file, inner, node_var)
Expand Down

0 comments on commit 94ad28a

Please sign in to comment.