From d9847522865353d39863c0c69802c484a4cdabd6 Mon Sep 17 00:00:00 2001 From: Alan O'Cull Date: Sat, 31 Aug 2024 11:29:22 -0400 Subject: [PATCH] Setup script now installs Flamenco --- Makefile | 2 +- setup/setup.py | 2 ++ setup/setup.sh | 12 ++++++++++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 8b68795..8078e86 100644 --- a/Makefile +++ b/Makefile @@ -7,4 +7,4 @@ clean: setup: @mkdir -p workspace/ - @./setup/setup.sh Blender4.2 blender-4.2.1-linux-x64.tar.xz + @./setup/setup.sh Blender4.2 blender-4.2.1-linux-x64.tar.xz http://localhost:8080 diff --git a/setup/setup.py b/setup/setup.py index 1cb7cac..b476344 100644 --- a/setup/setup.py +++ b/setup/setup.py @@ -2,9 +2,11 @@ import bpy ## CONFIGURATION ## render_api = 'OPTIX' # NONE, CUDA, OPTIX, HIP, ONEAPI +hostname = 'http://localhost:8080/' ## SETUP PREFS ## bpy.context.preferences.addons["cycles"].preferences.compute_device_type = render_api +bpy.context.preferences.addons['flamenco'].preferences.manager_url = hostname bpy.ops.wm.save_userpref() diff --git a/setup/setup.sh b/setup/setup.sh index 0680fa3..b415590 100755 --- a/setup/setup.sh +++ b/setup/setup.sh @@ -2,7 +2,8 @@ TARBALL=$2 DIRECTORY="workspace/${TARBALL%.tar.xz}" BINARY=$DIRECTORY/blender SCRIPTS=$(pwd)/setup -echo $TARBALL - $DIRECTORY - $BINARY - $SCRIPTS +HOST=$3 +echo $TARBALL - $DIRECTORY - $BINARY - $SCRIPTS - $HOST # Create directory for writing mkdir -p workspace/ @@ -11,9 +12,16 @@ rm -rf workspace/$DIRECTORY/ # Download blender from URL and write it to workspacem and extract the tarball wget https://download.blender.org/release/$1/$TARBALL -O workspace/$TARBALL +echo "Extracting $TARBALL..." tar -xf workspace/$TARBALL -C workspace/ -# Export binary location and perform setup +# Export binary location export blender=workspace/$BINARY echo | whereis blender + +# Download the extension from Flamenco and install it +wget $HOST/flamenco-addon.zip -O workspace/flamenco-addon.zip +blender --command extension install-file -r user_default -e workspace/flamenco-addon.zip + +# Finally, perform setup scripts blender -b -P $SCRIPTS/setup.py