Skip to content

Commit

Permalink
install blender from berkely.edu with extra deps
Browse files Browse the repository at this point in the history
  • Loading branch information
JR-Morgan committed Oct 18, 2023
1 parent 8b814ff commit 3ee5ae0
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 9 deletions.
55 changes: 50 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,57 @@ FROM ubuntu:22.04

ENV DEBIAN_FRONTEND=noninteractive

RUN apt update && \
apt install --no-install-recommends -y tar wget blender python3-pip && \
pip3 install poetry
RUN \
echo "**** install packages ****" && \
apt-get update && \
apt-get install --no-install-recommends -y \
libopenexr-dev \
bzip2 \
build-essential \
zlib1g-dev \
libxmu-dev \
libxi-dev \
libxkbcommon-x11-0 \
libxxf86vm-dev \
libfontconfig1 \
libxrender1 \
libgl1-mesa-glx \
wget \
curl \
python3-pip \
ocl-icd-libopencl1 \
xz-utils && \
ln -s libOpenCL.so.1 /usr/lib/x86_64-linux-gnu/libOpenCL.so && \
echo "**** install blender ****" && \
mkdir /blender && \
if [ -z ${BLENDER_VERSION+x} ]; then \
BLENDER_VERSION=$(curl -sL https://mirrors.ocf.berkeley.edu/blender/source/ \
| awk -F'"|/"' '/blender-[0-9]*\.[0-9]*\.[0-9]*\.tar\.xz/ && !/md5sum/ {print $4}' \
| tail -1 \
| sed 's|blender-||' \
| sed 's|\.tar\.xz||'); \
fi && \
BLENDER_FOLDER=$(echo "Blender${BLENDER_VERSION}" | sed -r 's|(Blender[0-9]*\.[0-9]*)\.[0-9]*|\1|') && \
curl -o \
/tmp/blender.tar.xz -L \
"https://mirrors.ocf.berkeley.edu/blender/release/${BLENDER_FOLDER}/blender-${BLENDER_VERSION}-linux-x64.tar.xz" && \
tar xf \
/tmp/blender.tar.xz -C \
/blender/ --strip-components=1 && \
ln -s \
/blender/blender \
/usr/bin/blender && \
echo "**** cleanup ****" && \
rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*

RUN pip3 install poetry


COPY . .

RUN poetry export -f requirements.txt --output requirements.txt && pip install -r requirements.txt && \
wget -O blender-connector.zip https://releases.speckle.dev/installers/blender/bpy_speckle-2.17.0-alpha2.zip && \
blender --background --python installation/connector.py
wget -O blender-connector.zip https://releases.speckle.dev/installers/blender/bpy_speckle-2.17.0-alpha2.zip && \
blender --background --python installation/connector.py
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[tool.poetry]
name = "speckle-automate-py"
name = "blender-automate"
version = "0.1.0"
description = "Example function for Speckle Automate using specklepy"
authors = ["Gergő Jedlicska <gergo@jedlicska.com>"]
description = "Run Blender renders in Speckle automate to output images"
authors = ["Jedd Morgan <jedd@speckle.systems>", "Gergő Jedlicska <gergo@jedlicska.com>"]
readme = "README.md"
packages = [{include = "src/speckle_automate_py"}]
packages = [{include = ""}]

[tool.poetry.dependencies]
python = "^3.10"
Expand Down

0 comments on commit 3ee5ae0

Please sign in to comment.