Skip to content

Commit

Permalink
Merge branch 'main' into bcif
Browse files Browse the repository at this point in the history
# Conflicts:
#	molecularnodes/entities/molecule/pdbx.py
#	molecularnodes/entities/molecule/ui.py
  • Loading branch information
corredD committed Sep 6, 2024
2 parents 8298a1d + b0db34f commit e465613
Show file tree
Hide file tree
Showing 19 changed files with 7,829 additions and 4,388 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Build Extension

on:
workflow_dispatch:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest
env:
BLENDER_VERSION: blender-4.2.0-linux-x64
ADDON_NAME: molecularnodes
steps:
- uses: actions/checkout@v3
- uses: SebRollen/[email protected]
id: read_manifest
with:
file: '${{ env.ADDON_NAME }}/blender_manifest.toml'
field: 'version'
- name: Set derived environment variables
run: |
echo "BLENDER_FILENAME=${{ env.BLENDER_VERSION }}.tar.xz" >> $GITHUB_ENV
echo "BLENDER_URL=https://mirrors.iu13.net/blender/release/Blender4.2/${{ env.BLENDER_VERSION }}.tar.xz" >> $GITHUB_ENV
- name: Install Blender Dependencies
run: |
sudo apt-get install libxxf86vm-dev -y
sudo apt-get install libxfixes3 -y
sudo apt-get install libxi-dev -y
sudo apt-get install libxkbcommon-x11-0 -y
sudo apt-get install libgl1-mesa-glx -y
- name: Download & Extract Blender
run: |
wget -q $BLENDER_URL
tar -xf $BLENDER_FILENAME
rm -rf $BLENDER_FILENAME
- name: Add Blender executable to path
run: |
echo "${{ github.workspace }}/${{ env.BLENDER_VERSION }}/" >> $GITHUB_PATH
- name: Build extension
run: |
blender -b -P tests/python.py -- -m pip install tomlkit
blender -b -P build.py
mkdir artifact
mv ${{ env.ADDON_NAME }}-${{ steps.read_manifest.outputs.value }}-*.zip ./artifact/.
- name: Archive addon
uses: actions/upload-artifact@v4
with:
# name: ${{ env.ADDON_NAME }}-${{ github.ref_name }}-${{ github.sha }}
name: ${{ env.ADDON_NAME }}-${{ github.sha }}
retention-days: 3
path: |
./artifact/*
16 changes: 7 additions & 9 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,16 @@ jobs:
version: "1.4.549"
- name: Build docs using blender
run: |
wget -nv https://download.blender.org/release/Blender4.1/blender-4.1.0-linux-x64.tar.xz
tar -xf blender-4.1.0-linux-x64.tar.xz
wget -nv https://download.blender.org/release/Blender4.2/blender-4.2.0-linux-x64.tar.xz -O ./blender.tar.xz
mkdir -p ./blender
tar -xf ./blender.tar.xz -C ./blender --strip-components=1
blender-4.1.0-linux-x64/blender --version
blender-4.1.0-linux-x64/blender -b --python docs/install.py
blender-4.1.0-linux-x64/blender -b --python docs/build_node_docs.py
blender/blender --version
blender/blender -b --python docs/install.py
blender/blender -b --python docs/build_node_docs.py

- name: Build Docs
run: make docs-build
run: quarto render docs

# push to netlify -------------------------------------------------------

Expand Down
41 changes: 27 additions & 14 deletions .github/workflows/test-addon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,20 @@ jobs:
fail-fast: false
matrix:
blender-version: ["4.2"]
os: [ubuntu-latest, macos-14]
os: [ubuntu-latest, macos-14, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.11.7

- name: Cache Blender
- name: Cache Blender Linux
if: matrix.os == 'ubuntu-latest'
uses: actions/cache@v2
with:
path: ~/blender.tar.xz
key: ${{ runner.os }}-blender-${{ hashFiles('**/test-addon.yml') }}

- name: Test in Blender MacOS ARM
if: matrix.os == 'macos-14'
run: |
curl -L -o blender.dmg https://download.blender.org/release/Blender4.2/blender-4.2.0-macos-arm64.dmg
hdiutil attach blender.dmg
cp -R /Volumes/Blender/Blender.app /Applications/
hdiutil detach /Volumes/Blender
/Applications/Blender.app/Contents/MacOS/Blender --version
/Applications/Blender.app/Contents/MacOS/Blender -b --python tests/install.py
/Applications/Blender.app/Contents/MacOS/Blender -b --python tests/run.py -- -v tests/
- name: Test in Blender Linux
if: matrix.os == 'ubuntu-latest'
run: |
Expand All @@ -51,8 +41,31 @@ jobs:
blender/blender --version
blender/blender -b --python tests/install.py
blender/blender -b --python tests/run.py -- -v tests/ --cov=molecularnodes --cov-report=xml:coverage.xml --ignore=molecularnodes/ui/panel.py
- name: Test in Blender MacOS ARM
if: matrix.os == 'macos-14'
run: |
curl -L -o blender.dmg https://download.blender.org/release/Blender4.2/blender-4.2.0-macos-arm64.dmg
hdiutil attach blender.dmg
cp -R /Volumes/Blender/Blender.app /Applications/
hdiutil detach /Volumes/Blender
/Applications/Blender.app/Contents/MacOS/Blender --version
/Applications/Blender.app/Contents/MacOS/Blender -b --python tests/install.py
/Applications/Blender.app/Contents/MacOS/Blender -b --python tests/run.py -- -v tests/
- name: Test in Blender Windows
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
Invoke-WebRequest -Uri "https://download.blender.org/release/Blender4.2/blender-4.2.0-windows-x64.zip" -OutFile "blender.zip"
Expand-Archive -Path "blender.zip" -DestinationPath "blender"
.\blender\blender-4.2.0-windows-x64\blender.exe --version
.\blender\blender-4.2.0-windows-x64\blender.exe -b --python tests/install.py
.\blender\blender-4.2.0-windows-x64\blender.exe -b --python tests/run.py -- -v tests/
- name: Expose coverage as a CI download
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
if: matrix.os == 'ubuntu-latest'
with:
name: coverage.xml
Expand Down
Binary file modified molecularnodes/assets/MN_data_file_4.2.blend
Binary file not shown.
9 changes: 2 additions & 7 deletions molecularnodes/blender/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,9 +491,6 @@ def create_starting_nodes_starfile(object, n_images=1):
link(node_star_instances.outputs[0], node_output.inputs[0])
link(node_input.outputs[0], node_star_instances.inputs[0])

# Need to manually set Image input to 1, otherwise it will be 0 (even though default is 1)
node_mod["Input_3"] = 1


def create_starting_nodes_density(object, threshold=0.8, style="density_surface"):
# ensure there is a geometry nodes modifier called 'MolecularNodes' that is created and applied to the object
Expand Down Expand Up @@ -692,10 +689,8 @@ def create_assembly_node_tree(
tree: bpy.types.NodeTree = new_group(name=node_group_name)
link = tree.links.new

node_split: bpy.types.GeometryNodeSplitToInstances = tree.nodes.new(
"GeometryNodeSplitToInstances"
) # type: ignore
node_split.location = [-150, 0]
node_split = add_custom(tree, "Split to Centred Instances", [-150, 0])

node_att: bpy.types.GeometryNodeInputNamedAttribute = tree.nodes.new(
"GeometryNodeInputNamedAttribute"
) # type: ignore
Expand Down
12 changes: 6 additions & 6 deletions molecularnodes/blender_manifest.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
schema_version = "1.0.0"

id = "molecularnodes"
version = "4.2.4"
version = "4.2.5"
name = "Molecular Nodes"
tagline = "A toolbox for molecular import and animation in Blender"
maintainer = "Brady Johnston<[email protected]>"
Expand Down Expand Up @@ -50,10 +50,10 @@ wheels = [
"./wheels/kiwisolver-1.4.5-cp311-cp311-macosx_11_0_arm64.whl",
"./wheels/kiwisolver-1.4.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"./wheels/kiwisolver-1.4.5-cp311-cp311-win_amd64.whl",
"./wheels/matplotlib-3.9.1-cp311-cp311-macosx_10_12_x86_64.whl",
"./wheels/matplotlib-3.9.1-cp311-cp311-macosx_11_0_arm64.whl",
"./wheels/matplotlib-3.9.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"./wheels/matplotlib-3.9.1-cp311-cp311-win_amd64.whl",
"./wheels/matplotlib-3.9.1.post1-cp311-cp311-macosx_10_12_x86_64.whl",
"./wheels/matplotlib-3.9.1.post1-cp311-cp311-macosx_11_0_arm64.whl",
"./wheels/matplotlib-3.9.1.post1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"./wheels/matplotlib-3.9.1.post1-cp311-cp311-win_amd64.whl",
"./wheels/mda_xdrlib-0.2.0-py3-none-any.whl",
"./wheels/mmtf_python-1.1.3-py2.py3-none-any.whl",
"./wheels/mrcfile-1.4.3-py2.py3-none-any.whl",
Expand Down Expand Up @@ -81,7 +81,7 @@ wheels = [
"./wheels/six-1.16.0-py2.py3-none-any.whl",
"./wheels/starfile-0.5.6-py3-none-any.whl",
"./wheels/threadpoolctl-3.5.0-py3-none-any.whl",
"./wheels/tqdm-4.66.4-py3-none-any.whl",
"./wheels/tqdm-4.66.5-py3-none-any.whl",
"./wheels/typing_extensions-4.12.2-py3-none-any.whl",
"./wheels/tzdata-2024.1-py2.py3-none-any.whl",
]
Expand Down
Loading

0 comments on commit e465613

Please sign in to comment.