Merge pull request #309 from Ben1138/fix_node_tree_crash

Fix crash for potential non existent texture images.
This commit is contained in:
Lu Jiacheng
2020-02-09 10:00:05 -08:00
committed by GitHub

View File

@@ -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)