Create setup script
This commit is contained in:
parent
d5b7a44cfd
commit
6b7a50147a
10
Makefile
Normal file
10
Makefile
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
.PHONY: clean setup all
|
||||||
|
|
||||||
|
all: clean setup
|
||||||
|
|
||||||
|
clean:
|
||||||
|
@rm -rf workspace/
|
||||||
|
|
||||||
|
setup:
|
||||||
|
@mkdir -p workspace/
|
||||||
|
@./setup/setup.sh Blender4.2 blender-4.2.1-linux-x64.tar.xz
|
@ -7,3 +7,6 @@ render_api = 'OPTIX' # NONE, CUDA, OPTIX, HIP, ONEAPI
|
|||||||
bpy.context.preferences.addons["cycles"].preferences.compute_device_type = render_api
|
bpy.context.preferences.addons["cycles"].preferences.compute_device_type = render_api
|
||||||
|
|
||||||
bpy.ops.wm.save_userpref()
|
bpy.ops.wm.save_userpref()
|
||||||
|
|
||||||
|
# Exit blender now that we're done
|
||||||
|
bpy.ops.wm.quit_blender()
|
||||||
|
20
setup/setup.sh
Normal file → Executable file
20
setup/setup.sh
Normal file → Executable file
@ -1,3 +1,19 @@
|
|||||||
|
TARBALL=$2
|
||||||
|
DIRECTORY="workspace/${TARBALL%.tar.xz}"
|
||||||
|
BINARY=$DIRECTORY/blender
|
||||||
|
SCRIPTS=$(pwd)/setup
|
||||||
|
echo $TARBALL - $DIRECTORY - $BINARY - $SCRIPTS
|
||||||
|
|
||||||
# Download blender from URL and write it to workspace
|
# Create directory for writing
|
||||||
wget https://download.blender.org/release/$1/$2 -O workspace/$2
|
mkdir -p workspace/
|
||||||
|
# Ensure blender workspace does not exist
|
||||||
|
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
|
||||||
|
tar -xf workspace/$TARBALL -C workspace/
|
||||||
|
|
||||||
|
# Export binary location and perform setup
|
||||||
|
export blender=workspace/$BINARY
|
||||||
|
echo | whereis blender
|
||||||
|
blender -b -P $SCRIPTS/setup.py
|
||||||
|
Loading…
Reference in New Issue
Block a user