[Bf-extensions-cvs] [21a8a58] master: FBX import: do not fail on missing/unreadable image file.

Bastien Montagne noreply at git.blender.org
Wed Jul 30 14:03:31 CEST 2014


Commit: 21a8a5824dde50f060716047a12c748b4413b04d
Author: Bastien Montagne
Date:   Wed Jul 30 13:08:19 2014 +0200
Branches: master
https://developer.blender.org/rBA21a8a5824dde50f060716047a12c748b4413b04d

FBX import: do not fail on missing/unreadable image file.

===================================================================

M	io_scene_fbx/import_fbx.py

===================================================================

diff --git a/io_scene_fbx/import_fbx.py b/io_scene_fbx/import_fbx.py
index c12739b..17de1a9 100644
--- a/io_scene_fbx/import_fbx.py
+++ b/io_scene_fbx/import_fbx.py
@@ -1252,18 +1252,22 @@ def blen_read_texture(fbx_tmpl, fbx_obj, basedir, image_cache,
     if image is not None:
         return image
 
-    image = image_utils.load_image(
-        filepath,
-        dirname=basedir,
-        place_holder=True,
-        recursive=use_image_search,
-        )
+    try:
+        image = image_utils.load_image(
+            filepath,
+            dirname=basedir,
+            place_holder=True,
+            recursive=use_image_search,
+            )
 
-    image_cache[filepath] = image
-    # name can be ../a/b/c
-    image.name = os.path.basename(elem_name_utf8)
+        image_cache[filepath] = image
+        # name can be ../a/b/c
+        image.name = os.path.basename(elem_name_utf8)
 
-    return image
+        return image
+    except Exception as e:
+        print("Warning, failed to load image file %s..." % filepath);
+        return None
 
 
 def blen_read_camera(fbx_tmpl, fbx_obj, global_scale):



More information about the Bf-extensions-cvs mailing list