Skip to content

Commit 94ad28a

Browse files
Merge pull request #52 from BrendanParmer/NullImageFix
fix: image nodes no longer throw errors when no image is selected
2 parents 700ae47 + 53cccee commit 94ad28a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

geo_nodes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ def process_geo_nodes_group(node_tree, level, node_vars, used_vars):
263263
curve_node_settings(node, file, inner, node_var)
264264
elif node.bl_idname in image_nodes:
265265
img = node.image
266-
if img.source in {'FILE', 'GENERATED', 'TILED'}:
266+
if img is not None and img.source in {'FILE', 'GENERATED', 'TILED'}:
267267
save_image(img, addon_dir)
268268
load_image(img, file, inner, f"{node_var}.image")
269269
elif node.bl_idname == 'GeometryNodeSimulationInput':

materials.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def process_mat_node_group(node_tree, level, node_vars, used_vars):
189189

190190
elif node.bl_idname in image_nodes:
191191
img = node.image
192-
if img.source in {'FILE', 'GENERATED', 'TILED'}:
192+
if img is not None and img.source in {'FILE', 'GENERATED', 'TILED'}:
193193
save_image(img, addon_dir)
194194
load_image(img, file, inner, f"{node_var}.image")
195195
image_user_settings(node, file, inner, node_var)

0 commit comments

Comments
 (0)