Skip to content

Commit

Permalink
Merge branch 'main' of github.com:BradyAJohnston/MolecularNodes into …
Browse files Browse the repository at this point in the history
…docs-banners
  • Loading branch information
BradyAJohnston committed Nov 5, 2024
2 parents f6f47a5 + 5fdc773 commit 44348fa
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 25 deletions.
17 changes: 3 additions & 14 deletions docs/generate.py
Original file line number Diff line number Diff line change
@@ -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 = """---
Expand Down
24 changes: 23 additions & 1 deletion docs/installation.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,26 @@ 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!
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:

```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 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 which solves the `biotite` dependency error.

```bash
sudo snap install blender --classic
```


23 changes: 13 additions & 10 deletions molecularnodes/bpyd/attribute.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 44348fa

Please sign in to comment.