diff options
Diffstat (limited to 'precision_drawing_tools/pdt_library.py')
-rw-r--r-- | precision_drawing_tools/pdt_library.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/precision_drawing_tools/pdt_library.py b/precision_drawing_tools/pdt_library.py index a0b1a6be..4850481b 100644 --- a/precision_drawing_tools/pdt_library.py +++ b/precision_drawing_tools/pdt_library.py @@ -48,7 +48,7 @@ class PDT_OT_LibShow(Operator): scene = context.scene pg = scene.pdt_pg - file_path = context.preferences.addons[__package__].preferences.pdt_library_path + file_path = pg.pdt_library_path pg.error = str(Path(file_path)) debug("PDT Parts Library:") debug(f"{pg.error}") @@ -89,10 +89,10 @@ class PDT_OT_Append(Operator): return {"FINISHED"} obj_names = [o.name for o in context.view_layer.objects].copy() - file_path = context.preferences.addons[__package__].preferences.pdt_library_path + file_path = pg.pdt_library_path path = Path(file_path) - if path.is_file() and ".blend" in str(path): + if path.is_file() and str(path).endswith(".blend"): if pg.lib_mode == "OBJECTS": bpy.ops.wm.append( filepath=str(path), @@ -170,9 +170,10 @@ class PDT_OT_Link(Operator): self.report({"ERROR"}, error_message) return {"FINISHED"} - file_path = context.preferences.addons[__package__].preferences.pdt_library_path + file_path = pg.pdt_library_path path = Path(file_path) - if path.is_file() and ".blend" in str(path): + + if path.is_file() and str(path).endswith(".blend"): if pg.lib_mode == "OBJECTS": bpy.ops.wm.link( filepath=str(path), |