-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #476 from BradyAJohnston/4.1
Upgrade for Blender 4.1
- Loading branch information
Showing
316 changed files
with
47,582 additions
and
12,455 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: Test in Blender | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
branches: ["main", "4.1"] | ||
|
||
jobs: | ||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
max-parallel: 4 | ||
fail-fast: false | ||
matrix: | ||
blender-version: ["4.1"] | ||
os: [ubuntu-latest, windows-latest, macos-13, macos-14] | ||
# os: [macos-13] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.11.7 | ||
|
||
- name: Test in Blender MacOS Intel | ||
if: matrix.os == 'macos-13' | ||
run: | | ||
curl -L -o blender.dmg https://download.blender.org/release/Blender4.1/blender-4.1.0-macos-x64.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 | ||
- name: Test in Blender MacOS ARM | ||
if: matrix.os == 'macos-14' | ||
run: | | ||
curl -L -o blender.dmg https://download.blender.org/release/Blender4.1/blender-4.1.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 | ||
- name: Test in Blender Windows | ||
if: matrix.os == 'windows-latest' | ||
shell: pwsh | ||
run: | | ||
Invoke-WebRequest -Uri "https://download.blender.org/release/Blender4.1/blender-4.1.0-windows-x64.zip" -OutFile "blender.zip" | ||
Expand-Archive -Path "blender.zip" -DestinationPath "blender" | ||
.\blender\blender-4.1.0-windows-x64\blender.exe --version | ||
.\blender\blender-4.1.0-windows-x64\blender.exe -b --python tests/install.py | ||
.\blender\blender-4.1.0-windows-x64\blender.exe -b --python tests/run.py -- -v tests/ | ||
- name: Test in Blender Linux | ||
if: matrix.os == 'ubuntu-latest' | ||
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 | ||
blender-4.1.0-linux-x64/blender --version | ||
blender-4.1.0-linux-x64/blender -b --python tests/install.py | ||
blender-4.1.0-linux-x64/blender -b --python tests/run.py -- -v tests/ --cov=molecularnodes --cov-report=xml:coverage.xml --ignore=molecularnodes/ui/panel.py | ||
- name: Expose coverage as a CI download | ||
uses: actions/upload-artifact@v1 | ||
if: matrix.os == 'ubuntu-latest' | ||
with: | ||
name: coverage.xml | ||
path: coverage.xml | ||
|
||
- name: Upload coverage reports to Codecov | ||
if: matrix.os == 'ubuntu-latest' | ||
uses: codecov/codecov-action@v3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import subprocess | ||
import sys | ||
import os | ||
|
||
|
||
def main(): | ||
|
||
python = os.path.realpath(sys.executable) | ||
|
||
commands = [ | ||
f'{python} -m pip install .', | ||
f'{python} -m pip install quartodoc' | ||
] | ||
|
||
for command in commands: | ||
subprocess.run(command.split(' ')) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
from abc import ABCMeta | ||
from typing import Optional, Any | ||
import warnings | ||
import time | ||
import numpy as np | ||
import bpy | ||
|
||
|
||
class Node(metaclass=ABCMeta): | ||
def __init__(self, node: bpy.types.Node, chain=[]): | ||
|
||
self.node = node | ||
self.group = node.id_data | ||
self.chain = chain | ||
|
||
@property | ||
def location(self): | ||
return np.array(self.node.location) | ||
|
||
def new(self, name): | ||
"Add a new node to the node group." | ||
try: | ||
return self.group.nodes.new(f'GeometryNode{name}') | ||
except RuntimeError: | ||
return self.group.nodes.new(f'ShaderNode{name}') | ||
|
||
def link(self, name, linkto=0, linkfrom=0): | ||
"Create a new node along in the chain and create a link to it. Return the new node." | ||
new_node = self.new(name) | ||
new_node.location = self.location + np.array((200, 0)) | ||
|
||
self.group.links.new( | ||
self.node.outputs[linkfrom], | ||
new_node.inputs[linkto] | ||
) | ||
|
||
return Node(new_node, chain=self.chain + [self]) |
Oops, something went wrong.