diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-09-04 15:14:32 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-09-04 15:15:01 +0300 |
commit | 841fcc68d77f0cb4ea780628accfe8eb39e00c77 (patch) | |
tree | dbfc318bae116739f00b18a1ed8b35e9e057ebe8 /materials_library_vx | |
parent | d4752a5d6c5c7ea1da7e1f19f0f2cb7adb663cc4 (diff) |
Cleanup: don't print missing path when it's empty
Diffstat (limited to 'materials_library_vx')
-rw-r--r-- | materials_library_vx/__init__.py | 9 |
1 files changed, 5 insertions, 4 deletions
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)) |