From 3b3fd2e3ff39eef03b0b5a036177f24411b43e65 Mon Sep 17 00:00:00 2001 From: Brady Johnston <36021261+BradyAJohnston@users.noreply.github.com> Date: Mon, 4 Nov 2024 21:14:14 +0800 Subject: [PATCH 1/4] add check for version (#647) --- molecularnodes/bpyd/attribute.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/molecularnodes/bpyd/attribute.py b/molecularnodes/bpyd/attribute.py index 46135872..7df017db 100644 --- a/molecularnodes/bpyd/attribute.py +++ b/molecularnodes/bpyd/attribute.py @@ -277,16 +277,19 @@ def store_named_attribute( # so we have to flatten it first attribute.data.foreach_set(atype.value.value_name, data.reshape(-1)) - # The updating of data doesn't work 100% of the time (see: - # https://projects.blender.org/blender/blender/issues/118507) so this resetting of a - # single vertex is the current fix. Not great as I can see it breaking when we are - # missing a vertex - but for now we shouldn't be dealing with any situations where this - # is the case For now we will set a single vert to it's own position, which triggers a - # proper refresh of the object data. - try: - obj.data.vertices[0].co = obj.data.vertices[0].co # type: ignore - except AttributeError: - obj.data.update() # type: ignore + # attribute bug is fixed in 4.3+ + if bpy.app.version_string.startswith("4.2"): + # TODO remove in later updates + # The updating of data doesn't work 100% of the time (see: + # https://projects.blender.org/blender/blender/issues/118507) so this resetting of a + # single vertex is the current fix. Not great as I can see it breaking when we are + # missing a vertex - but for now we shouldn't be dealing with any situations where this + # is the case For now we will set a single vert to it's own position, which triggers a + # proper refresh of the object data. + try: + obj.data.vertices[0].co = obj.data.vertices[0].co # type: ignore + except AttributeError: + obj.data.update() # type: ignore return attribute From 7ab18fb1a549335a18a6a69475eddb3d5f8d5c50 Mon Sep 17 00:00:00 2001 From: Brady Johnston <36021261+BradyAJohnston@users.noreply.github.com> Date: Mon, 4 Nov 2024 21:24:07 +0800 Subject: [PATCH 2/4] move noodlenotes to mn instead of docs (#646) --- docs/generate.py | 17 +++-------------- .../noodlenotes/__init__.py | 0 .../noodlenotes/documenter.py | 0 .../noodlenotes/interface.py | 0 .../noodlenotes/markdown.py | 0 5 files changed, 3 insertions(+), 14 deletions(-) rename {docs => molecularnodes}/noodlenotes/__init__.py (100%) rename {docs => molecularnodes}/noodlenotes/documenter.py (100%) rename {docs => molecularnodes}/noodlenotes/interface.py (100%) rename {docs => molecularnodes}/noodlenotes/markdown.py (100%) diff --git a/docs/generate.py b/docs/generate.py index 591a1124..c0b83c19 100644 --- a/docs/generate.py +++ b/docs/generate.py @@ -1,24 +1,13 @@ import bpy -import sys import pathlib -try: - from bl_ext.user_default import molecularnodes as mn -except ImportError: - try: - from bl_ext.vscode_development import molecularnodes as mn - except ImportError: - import molecularnodes as mn +import molecularnodes as mn +from molecularnodes import noodlenotes DOCS_FOLDER = pathlib.Path(__file__).resolve().parent -# import the scripts for building documentation -sys.path.insert(0, str(DOCS_FOLDER)) -import noodlenotes - - # load the data file which contains all of the nodes to build docs for -bpy.ops.wm.open_mainfile(filepath=mn.blender.nodes.MN_DATA_FILE) +bpy.ops.wm.open_mainfile(filepath=mn.utils.MN_DATA_FILE) header = """--- diff --git a/docs/noodlenotes/__init__.py b/molecularnodes/noodlenotes/__init__.py similarity index 100% rename from docs/noodlenotes/__init__.py rename to molecularnodes/noodlenotes/__init__.py diff --git a/docs/noodlenotes/documenter.py b/molecularnodes/noodlenotes/documenter.py similarity index 100% rename from docs/noodlenotes/documenter.py rename to molecularnodes/noodlenotes/documenter.py diff --git a/docs/noodlenotes/interface.py b/molecularnodes/noodlenotes/interface.py similarity index 100% rename from docs/noodlenotes/interface.py rename to molecularnodes/noodlenotes/interface.py diff --git a/docs/noodlenotes/markdown.py b/molecularnodes/noodlenotes/markdown.py similarity index 100% rename from docs/noodlenotes/markdown.py rename to molecularnodes/noodlenotes/markdown.py From 550ca785139d51fe08dce1bb49d363742ce5454d Mon Sep 17 00:00:00 2001 From: melomcr <1561126+melomcr@users.noreply.github.com> Date: Mon, 4 Nov 2024 09:48:19 -0700 Subject: [PATCH 3/4] Updated docs Added a troubleshooting section to installation instructions. This includes instructions to avoiding a biotite dependency error when installing the package on linux distributions. --- docs/installation.qmd | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/docs/installation.qmd b/docs/installation.qmd index 7a3e4c4b..0096b6c4 100644 --- a/docs/installation.qmd +++ b/docs/installation.qmd @@ -42,4 +42,24 @@ THis adds it as an option on the startup splash screen, or when starting a new f ## Start Importing Structures! -Molecular nodes should be fully installed. See the [Getting Started](tutorials/01_importing.qmd) page on how to start importing into Blender! \ No newline at end of file +Molecular nodes should be fully installed. See the [Getting Started](tutorials/01_importing.qmd) page on how to start importing into Blender! + +## Troubleshooting + +### Installation error: missing biotite module + +In some Linux systems, trying to install `Molecular Nodes` through the `Get Extensions` panel in Blender may lead to the following error: +``` +Report: Error +No module named 'biotite.structure.bonds' +``` +This is likely due to a mismatch in the Python versions installed in your system and in Blender (see issue [#629](https://github.com/BradyAJohnston/MolecularNodes/issues/629)). + +To avoid this issue, try installing Blender through a self-contained package system such as Flatpack or Snap. These package managers usually need to be installed and/or activated in your system. + +For example, after installing Snap in Fedora 40, you can install Blender through Snap with the command +``` +sudo snap install blender --classic +``` +which solves the `biotite` dependency error. + From 320d2ad719d933bd2ab370c0e2145bf765452a45 Mon Sep 17 00:00:00 2001 From: Brady Johnston Date: Tue, 5 Nov 2024 09:56:25 +0800 Subject: [PATCH 4/4] minor formatting --- docs/installation.qmd | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/installation.qmd b/docs/installation.qmd index 0096b6c4..bac457ce 100644 --- a/docs/installation.qmd +++ b/docs/installation.qmd @@ -49,17 +49,19 @@ Molecular nodes should be fully installed. See the [Getting Started](tutorials/0 ### Installation error: missing biotite module In some Linux systems, trying to install `Molecular Nodes` through the `Get Extensions` panel in Blender may lead to the following error: -``` + +```bash Report: Error No module named 'biotite.structure.bonds' ``` -This is likely due to a mismatch in the Python versions installed in your system and in Blender (see issue [#629](https://github.com/BradyAJohnston/MolecularNodes/issues/629)). +This is likely due to a mismatch in the Python versions installed in your system and in what Blender expects (see issue [#629](https://github.com/BradyAJohnston/MolecularNodes/issues/629)). To avoid this issue, try installing Blender through a self-contained package system such as Flatpack or Snap. These package managers usually need to be installed and/or activated in your system. -For example, after installing Snap in Fedora 40, you can install Blender through Snap with the command -``` +For example, after installing Snap in Fedora 40, you can install Blender through Snap with the command which solves the `biotite` dependency error. + +```bash sudo snap install blender --classic ``` -which solves the `biotite` dependency error. +