2026-07-17 08:45:55 +02:00
2026-07-20 23:34:59 +02:00
2026-07-18 11:28:16 +02:00
2026-07-20 23:34:59 +02:00
2026-07-20 23:34:59 +02:00
2021-11-18 10:50:31 +00:00

Blender

Blender Docker

This repository is an automated blender docker image file generated, it's usefully with blender addon unit test.

Adding an Addon

Mount a new volume with your addon inside a folder (ex /blender-plugin/plugin-archive.zip), when you run your docker container add this volume and execute a script to add-it with the blender installed.

Python function to install an addon with Blender. The file his named install.py

import bpy
def b3d_install_addon():
    bpy.ops.preferences.addon_install(filepath='./plugin-archive.zip')
    bpy.ops.preferences.addon_enable(module='plugin-name')

if __name__ == '__main__':
    b3d_install_addon()

Call this function with blender inside this container

#!/bin/sh
/opt/blender/blender --background --python "install.py"

Check Image build

docker run --rm stilobique/blender:5.1.2 ./blender --version
# Taille de l'image
docker image inspect stilobique/blender:5.1.2 --format='{{.Size}}' | numfmt --to=iec

# Dépendances manquantes
docker run --rm --entrypoint /bin/bash stilobique/blender:5.1.2 -c 'ldd /opt/blender/blender | grep "not found" || echo "All deps OK"'

# Test fonctionnel
docker run --rm stilobique/blender:5.1.2 ./blender -b --python-expr "import bpy; print('OK:', bpy.app.version_string)"

Logs

Some log are generated inside a logs folder.

  • build: all operation on build docker file.
  • clean: from the dedicated function to clean all dockers images and cache.
  • test: simple class method to try a specific docker image.
S
Description
Docker project to generate Blender image, really useful to generate Unit Test.
Readme Apache-2.0
157 KiB
Languages
Python 79.3%
Dockerfile 20.7%