Skip to content

Commit

Permalink
Merge branch 'main' into 744-selection-error
Browse files Browse the repository at this point in the history
  • Loading branch information
BradyAJohnston authored Feb 23, 2025
2 parents 9600db0 + 9d371e1 commit 95694b9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
12 changes: 10 additions & 2 deletions molecularnodes/entities/molecule/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,11 @@ def panel_wwpdb(layout, scene):
op.style = scene.mn.import_style
op.centre = scene.mn.import_centre
op.centre_type = scene.mn.import_centre_type
op.cache_dir = str(addon_preferences().cache_dir)
prefs = addon_preferences()
if prefs is not None:
op.cache_dir = str(prefs.cache_dir)
else:
op.cache_dir = str(bpy.app.tempdir)
layout.separator(factor=0.4)

layout.separator()
Expand Down Expand Up @@ -537,7 +541,11 @@ def panel_alphafold(layout, scene):
op.style = scene.mn.import_style
op.centre = scene.mn.import_centre
op.centre_type = scene.mn.import_centre_type
op.cache_dir = str(addon_preferences().cache_dir)
prefs = addon_preferences()
if prefs is not None:
op.cache_dir = str(prefs.cache_dir)
else:
op.cache_dir = str(bpy.app.tempdir)

layout.separator(factor=0.4)

Expand Down
8 changes: 4 additions & 4 deletions molecularnodes/pref.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ def addon_preferences(
try:
return context.preferences.addons[__package__].preferences
except KeyError:
return context.preferences.addons[
"bl_ext.vscode_development.molecularnodes"
].preferences

key = "bl_ext.vscode_development.molecularnodes"
if key in context.preferences.addons:
return context.preferences.addons[key].preferences
return None

class MN_OT_Template_Install(bpy.types.Operator):
bl_idname = "mn.template_install"
Expand Down

0 comments on commit 95694b9

Please sign in to comment.