From 43d2578223d9c803516cd578063e3e0e35a26196 Mon Sep 17 00:00:00 2001 From: Ben1138 Date: Sat, 4 Jan 2020 19:31:00 +0100 Subject: [PATCH] Fix crash for potential non existent texture images. --- .../converters/material/script_shader/node_tree.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/io_scene_godot/converters/material/script_shader/node_tree.py b/io_scene_godot/converters/material/script_shader/node_tree.py index 5c582f2e..518d421f 100644 --- a/io_scene_godot/converters/material/script_shader/node_tree.py +++ b/io_scene_godot/converters/material/script_shader/node_tree.py @@ -429,7 +429,10 @@ def export_texture(escn_file, export_settings, image): else: src_path = image.filepath_raw if os.path.normpath(src_path) != os.path.normpath(dst_path): - copyfile(src_path, dst_path) + if not os.path.exists(src_path): + logging.warning("Texture Image '%s' does not exist!", src_path) + else: + copyfile(src_path, dst_path) img_resource = ExternalResource(dst_path, "Texture") return escn_file.add_external_resource(img_resource, image)