[Bf-extensions-cvs] [83e5b12b] master: bugfix Collect, missing paths

Eugenio Pignataro noreply at git.blender.org
Thu Aug 3 18:13:41 CEST 2017


Commit: 83e5b12b75643ea5f71a5de40533d82d9179ab2a
Author: Eugenio Pignataro
Date:   Thu Aug 3 13:13:34 2017 -0300
Branches: master
https://developer.blender.org/rBA83e5b12b75643ea5f71a5de40533d82d9179ab2a

bugfix Collect, missing paths

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

M	oscurart_tools/oscurart_files.py

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

diff --git a/oscurart_tools/oscurart_files.py b/oscurart_tools/oscurart_files.py
index ac08907b..870508bd 100644
--- a/oscurart_tools/oscurart_files.py
+++ b/oscurart_tools/oscurart_files.py
@@ -123,11 +123,19 @@ class collectImagesOsc(Operator):
         bpy.ops.file.make_paths_absolute()
 
         for image in bpy.data.images:
-            if not os.path.exists(os.path.join(imagespath,os.path.basename(image.filepath))):
-                shutil.copy(image.filepath, os.path.join(imagespath,os.path.basename(image.filepath)))
-                image.filepath = os.path.join(imagespath,os.path.basename(image.filepath))
-            else:
-                print("%s exists." % (image.name))
+            try:
+                image.update()
+            
+                if image.has_data:
+                    if not os.path.exists(os.path.join(imagespath,os.path.basename(image.filepath))):
+                        shutil.copy(image.filepath, os.path.join(imagespath,os.path.basename(image.filepath)))
+                        image.filepath = os.path.join(imagespath,os.path.basename(image.filepath))
+                    else:
+                        print("%s exists." % (image.name))
+                else:
+                    print("%s missing path." % (image.name))   
+            except:
+                print("%s missing path." % (image.name))             
 
         bpy.ops.file.make_paths_relative()



More information about the Bf-extensions-cvs mailing list