Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugenio Pignataro <info@oscurart.com.ar>2017-08-03 19:13:34 +0300
committerEugenio Pignataro <info@oscurart.com.ar>2017-08-03 19:13:34 +0300
commit83e5b12b75643ea5f71a5de40533d82d9179ab2a (patch)
tree1bdc5154c717db75d2fa08f7398079cfdd0e7471
parent0023a36b40d2df9b05c45a4634f76ba4a179f349 (diff)
bugfix Collect, missing paths
-rw-r--r--oscurart_tools/oscurart_files.py18
1 files changed, 13 insertions, 5 deletions
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()