From d5b7a44cfdcc989e1609ab3da292a3fb10da0a05 Mon Sep 17 00:00:00 2001 From: alan Date: Thu, 29 Aug 2024 17:39:20 -0400 Subject: [PATCH] Add setup script to select Cycles --- .gitignore | 2 ++ .vscode/settings.json | 12 ++++++++++++ readme.md | 9 ++++++++- setup/setup.py | 9 +++++++++ setup/setup.sh | 3 +++ 5 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 .vscode/settings.json create mode 100644 setup/setup.py create mode 100644 setup/setup.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3aeee96 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +blender_autocomplete/ +workspace/ diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..5b6e2f0 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,12 @@ +{ + "python.autoComplete.extraPaths": [ + "blender_autocomplete/4.1" + ], + "python.linting.pylintArgs": [ + "--init-hook", + "import sys; sys.path.append('blender_autocomplete/4.1')" + ], + "python.analysis.extraPaths": [ + "blender_autocomplete/4.1" + ], +} \ No newline at end of file diff --git a/readme.md b/readme.md index 2bc2be4..7b26699 100644 --- a/readme.md +++ b/readme.md @@ -13,7 +13,7 @@ A more detailed setup can be found below, although these are intended specifical 3. Mount said directory: `$ sudo mount -t nfs {hostname}:/srv/flamenco srv/flamenco` ## Setup Blender -1. Install specified [Blender](https://www.blender.org/download/) version (will have a script for this) +1. Install specified [Blender](https://download.blender.org/release/) version 2. Add the Blender directory/executable to your PATH (can be an environment variable) so running `blender` runs the software 3. For everyone (*optional* for Manager), configure Blender: - Workers and end-user **MUST** have Flamenco add-on, need to install from file downloaded from your Flamenco manager @@ -39,3 +39,10 @@ scroll to the Flamenco section at the bottom, and configure accordingly. Be sure to select your output and job type. Upon submitting a job, your file should be automatically packed and sent to Flamenco. Congrats! + +# Development +For writing Python, you'll want to download the Blender Autocomplete repository. +`$ git clone https://github.com/Korchy/blender_autocomplete.git` + +- [Installing Extensions via Terminal](https://docs.blender.org/manual/en/latest/advanced/command_line/extension_arguments.html) +- [Rendering from Command-Line](https://docs.blender.org/manual/en/latest/advanced/command_line/render.html) diff --git a/setup/setup.py b/setup/setup.py new file mode 100644 index 0000000..982f0fc --- /dev/null +++ b/setup/setup.py @@ -0,0 +1,9 @@ +import bpy + +## CONFIGURATION ## +render_api = 'OPTIX' # NONE, CUDA, OPTIX, HIP, ONEAPI + +## SETUP PREFS ## +bpy.context.preferences.addons["cycles"].preferences.compute_device_type = render_api + +bpy.ops.wm.save_userpref() diff --git a/setup/setup.sh b/setup/setup.sh new file mode 100644 index 0000000..2c775c7 --- /dev/null +++ b/setup/setup.sh @@ -0,0 +1,3 @@ + +# Download blender from URL and write it to workspace +wget https://download.blender.org/release/$1/$2 -O workspace/$2