Load Test Output
In this tutorial, we will show you how to use Neocortix Cloud Services Scalable Compute to run a distributed batch rendering job, using Blender.
First, please follow the steps in the tutorial Setting Up For Batch Jobs. After completion of the initial setup, you will have a directory with examples,
~/ncsexamples
.
In the subdirectory
~/ncsexamples/batchMode
you will find the runBatchBlender.py command. This script will create a set of instances running on mobile devices. In the default example provided, 6 frames of the
SpinningCube.blend
animation are to be rendered (
startFrame = 0, endFrame = 5
), and since
autoscaleInit = 2
, 12 instances will be initially created.
blendFilePath = 'SpinningCube.blend' frameFileType = 'png' startFrame = 0, endFrame = 5, autoscaleInit = 2,
It will command the instances to install Blender, then command the instances to render the requested frames.
def frameCmd( self, frameNum ): blendFileName = os.path.basename( self.blendFilePath ) cmd = 'blender -b -noaudio --enable-autoexec %s -o %s --render-format %s -f %d' % \ (blendFileName, self.outFilePattern, self.frameFileType.upper(), frameNum) return cmd
Each rendered output file will be sent back to the master host, and the master will then terminate the instances. If
ffmpeg
is installed on the master host, it will be called to generate an MP4 movie from the rendered frames.

Example Command

Simply run
python3 ./runBatchBlender.py
When the program is done, the output plot files will be put in a directory
./data/spin_<datestamp>

Substituting Your Own Blender File

With this simple framework, you can easily substitute your own Blender file to render your own animation. Just edit the
runBatchBlender.py
file to change the
blendFilePath
to replace
SpinningCube.blend
with the name of your Blender file, and edit
startFrame
and
endFrame
to specify which frames you want rendered.