Code Monkey home page Code Monkey logo

blender-docker's Introduction

Blender in Docker

This repository can be used as a simple template to build Blender services in Docker.

Build

Build Docker image.

docker-compose build blender

Blender version can be updated in the .env file if needed.

[blender]
# Blender packages are available at https://download.blender.org/release
# Use .tar.xz packages for this Docker image
blender_package_name=blender-2.83.2-linux64
blender_package_url=https://download.blender.org/release/Blender2.83/blender-2.83.2-linux64.tar.xz
blender_path=/usr/local/blender
blender_python_path=/usr/local/blender/2.83/python/bin

Python Script

The script service is just a dummy Python script printing Hello world!.

docker-compose run script

Render Animation

The render service creates .png files for every frame of the animation.

  • Place .blend file in the ./input folder
  • Update render_input_file parameter in .env file
  • .png files are created in the ./output folder
docker-compose run render

Testing

Connect to the Docker container in interactive mode to test different command lines arguments. Do not forget to replace your_path parameter below.

# Run Docker container on Linux
docker run -it --rm --volume /your_path/blender-docker/input:/tmp/input --volume /your_path/blender-docker/output:/tmp/output --volume /your_path/blender-docker/scripts:/usr/local/blender/2.83/scripts/addons/ubisoft blender sh

# Run Docker container on Windows Pro
docker run -it --rm --volume C:\your_path\blender-docker\input:/tmp/input --volume C:\your_path\blender-docker\output:/tmp/output --volume C:\your_path\blender-docker\scripts:/usr/local/blender/2.83/scripts/addons/ubisoft blender sh

# Run Docker container on Windows Home
docker run -it --rm --volume /c/your_path/blender-docker/input:/tmp/input --volume /c/your_path/blender-docker/output:/tmp/output --volume /c/your_path/blender-docker/scripts:/usr/local/blender/2.83/scripts/addons/ubisoft blender sh

Manually execute commands for testing.

# Render first frame with EEVEE engine
/usr/local/blender/blender --background /tmp/input/bouncing_ball.blend -noaudio --render-output /tmp/output/frame_##### --render-format PNG --engine BLENDER_EEVEE --render-frame 1

# Render first frame with Cycles engine
/usr/local/blender/blender --background /tmp/input/bouncing_ball.blend -noaudio --render-output /tmp/output/frame_##### --render-format PNG --engine CYCLES --render-frame 1

# Execute Python script
/usr/local/blender/blender --background -noaudio --python /usr/local/blender/2.83/scripts/addons/ubisoft/main.py -- --argument1 "Some dummy argument value"

Blender Documentation

For additional information on Blender's command line arguments and options, visit Blender Documentation.

blender-docker's People

Contributors

alexisrolland avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

blender-docker's Issues

Build failing in apt-get curl...

I am getting a build failing in locating the following packages. Would this build still be current?

[ 3/12] RUN apt-get install -y curl libfreetype6 libglu1-mesa libxi6 libxrender1 xz-utils:
#5 0.401 Reading package lists...
#5 0.410 Building dependency tree...
#5 0.410 Reading state information...
#5 0.412 Package xz-utils is not available, but is referred to by another package.
#5 0.412 This may mean that the package is missing, has been obsoleted, or
#5 0.412 is only available from another source
#5 0.412
#5 0.412 E: Unable to locate package curl
#5 0.412 E: Unable to locate package libfreetype6
#5 0.412 E: Unable to locate package libglu1-mesa
#5 0.412 E: Unable to locate package libxi6
#5 0.412 E: Unable to locate package libxrender1
#5 0.412 E: Package 'xz-utils' has no installation candidate


executor failed running [/bin/sh -c apt-get install -y curl libfreetype6 libglu1-mesa libxi6 libxrender1 xz-utils]: exit code: 100
ERROR: Service 'blender' failed to build : Build failed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.