From 53cccee5164a4bb4ae724526b29240f5e8b4eddb Mon Sep 17 00:00:00 2001 From: Brendan Parmer Date: Thu, 25 May 2023 14:17:41 -0500 Subject: [PATCH] fix: image nodes no longer throw errors when no image is selected --- geo_nodes.py | 2 +- materials.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/geo_nodes.py b/geo_nodes.py index 9257fba..93c4cc3 100644 --- a/geo_nodes.py +++ b/geo_nodes.py @@ -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': diff --git a/materials.py b/materials.py index 3946ed4..7b6b803 100644 --- a/materials.py +++ b/materials.py @@ -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)