[Bf-extensions-cvs] [841fcc68] master: Cleanup: don't print missing path when it's empty
Campbell Barton
noreply at git.blender.org
Mon Sep 4 14:09:43 CEST 2017
Commit: 841fcc68d77f0cb4ea780628accfe8eb39e00c77
Author: Campbell Barton
Date: Mon Sep 4 22:14:32 2017 +1000
Branches: master
https://developer.blender.org/rBA841fcc68d77f0cb4ea780628accfe8eb39e00c77
Cleanup: don't print missing path when it's empty
===================================================================
M materials_library_vx/__init__.py
===================================================================
diff --git a/materials_library_vx/__init__.py b/materials_library_vx/__init__.py
index 5891bdc5..9a8b47f9 100644
--- a/materials_library_vx/__init__.py
+++ b/materials_library_vx/__init__.py
@@ -265,10 +265,11 @@ def get_libraries():
libs = [Library(matlib_path, f) for f in os.listdir(matlib_path) if f[-5::] == "blend"]
try:
user_path = bpy.context.user_preferences.addons[__name__].preferences.matlib_path
- if os.path.exists(user_path):
- libs.extend([Library(user_path, f) for f in os.listdir(user_path) if f[-5::] == "blend"])
- else:
- print("path not found %s" % user_path)
+ if user_path:
+ if os.path.exists(user_path):
+ libs.extend([Library(user_path, f) for f in os.listdir(user_path) if f[-5::] == "blend"])
+ else:
+ print("path not found %s" % user_path)
except:
pass
return sorted(libs, key=lambda x: bpy.path.display_name(x.name))
More information about the Bf-extensions-cvs
mailing list