appleseed Users Forum

How to batch-render from appleseed standalone?

Hi everybody, I’m testing Appleseed for use in animation (I like its toon shader), so I need to batch render a set of name.###.appleseed files. I can render one file at a time, either from appleseed.studio or appleseed.cli, but I can’t find any information about starting a batch render (on the forum or in the Docs)

I’m using Ubuntu. I’m sure this is a simple task for someone experienced in Bash, but I’m just starting out with it. I don’t want to write a script that does the job, but in a much more difficult and slow way than someone that knows what they’re doing.

Also, I don’t see any sort of -batch flag in appleseed.cli -h. I tried running the client on the entire directory, but it returned an error. I try to solve these things myself before I post a question.

Thanks.

Also, if there’s a way to batch render from appleseed.studio, and I missed it, please tell me!

1 Like

OK, was able to figure it out with Python, still not happy with my script, so please give me advice on how to make it better:

import os
import subprocess
import fnmatch

pathScene = "PATH_TO_SCENE"
pathRender = "PATH_TO_APPLESEED.CLI"
fileType = '.png'
outStem = "testRender."
outPath = 'OUTPUT_PATH'
scenes = []

for file in os.listdir(pathScene):
    if fnmatch.fnmatch(file, '*appleseed'):
        scenes.append(file)
scenes.sort()

for scene in scenes:
    split = scene.split('.')
    fileNum = split[1]
    #will try to make this more flexible in the future
    outName = outPath + outStem + fileNum + fileType
    subprocess.call([pathRender + '/appleseed.cli', pathScene + "/" + scene, "-o", outName])

    #print (fileNum, outName)

I really think there’s an easier way to do this, entirely within BASH

There’s no way currently to batch render from appleseed.studio, however appleseed ships with a Python script called rendermany.py (found in bin/) which allows to render a bunch of appleseed projects at once.

appleseed also ships with a pair of more sophisticated scripts, rendermanager.py and rendernode.py that allow to render files using multiple computers. The process is not documented though. The idea is to place the files to be rendered in some kind of shared folder (e.g. Dropbox), start the manager on one computer and start the render node on as many computers as you need. Of course both the manager and the render node can be run on the same computer.

1 Like

Thanks! I guess Python is the solution, then. I’ll have a look at rendermany.py . For some reason, I thought that was a RenderMan converter.

Sorry to keep plying you with questions, but is there a convenient way to edit the search path for each file? Is it better to just place the .oso nodes in the same directory as the scene?
Maybe I’ll just have to write a script to edit the XML files?
Thanks.

The easiest solution is to set the APPLESEED_SEARCHPATH environment variable to the shader directories then invoking appleseed.cli will work as desired.

1 Like

Hehe, I can understand the confusion :slight_smile:

1 Like