Kaynağa Gözat

Merge pull request #309 from Ben1138/fix_node_tree_crash

Fix crash for potential non existent texture images.
Lu Jiacheng 5 yıl önce
ebeveyn
işleme
81088123cb

+ 4 - 1
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)