19

I would like to be able to render several files one after the other, when I am not using my computer, e.g. at night. Is there a way of doing this?

ideasman42
  • 47,387
  • 10
  • 141
  • 223
SteveW
  • 2,232
  • 5
  • 18
  • 22

4 Answers4

17

Sounds like a job for Command Line Rendering. Sounds intimidating if you've never done it, but it's a simple matter of stealing someone's template and adjusting the parameters:

Windows: blender -b "C:\path\to\file.blend" -x 1 -a

Linux/Mac: blender -b "/path/to/file.blend" -x 1 -a

That's the simplest form of it which will use all the settings in the blend itself. To make a cue of it, simply put '&&' between the commands:

blender -b "C:\path\to\file.blend" -x 1 -a && blender -b "C:\some\other\project.blend" -x 1 -a && blender -b "C:\yes\another\one.blend" -x 1 -a

To adjust settings like start and end frames, path of the outputed images/video, whether to render the animation or a single frame, check out the wiki page on Command Line Rendering.

It's also useful to tell it to shutdown your computer when it's finished simply by adding this at the end:

Windows: && shutdown /s /t 0

Linux/Mac: && sudo shutdown -h now

And here's one with start/end frame set, output path and format and shutdown when done:

blender -b "C:\En Passant\08-08\shots\s1\awake\awake.blend" -x 1 -o "C:\En Passant\bear_render\awake\img_#" -F PNG -s 119 -e 150 -a && shutdown /s /t 0

Note that if it doesn't recognize the 'blender' command, you just need to cd into the directory of the blender executable before it'll understand you. E.g:

Windows: cd "C:\Program Files\Blender Foundation\Blender"

Linux/Mac: cd "/home/user/Downloads/Blender"

ideasman42
  • 47,387
  • 10
  • 141
  • 223
Greg Zaal
  • 10,856
  • 3
  • 47
  • 86
  • 1
    All these commands are for Windows - if someone has the linux and mac versions please edit this answer. – Greg Zaal Jun 29 '13 at 08:00
  • thanks for that, yes it's intimidating. :) I used to program in Basic back in the early '80s and now I only use a Mac! – SteveW Jun 29 '13 at 09:47
  • 2
    I think the commands work on Unix systems too, except, instead "C:\path" you write somthing like "/Users/[yourusername]/Path/To/File.belnd". – Róbert László Páli Jun 29 '13 at 15:24
  • Yes, almost the same except for the commands marked "windows only" when you run blender --help – gandalf3 Jun 29 '13 at 20:27
  • This appears to be what I'm looking for, I'll have to do some experimenting. Thank you. – SteveW Jun 29 '13 at 22:03
  • Ok, now this one is driving me nuts! First I tried it in Terminal but it didn't recognise the 'blender' command so I typed in the cd "/etc./", as suggested, and the Terminal window changed its name to 'blender - bash'. From here I was able to open Blender with a .blend file ok, so I quit Blender and tried again and got: -bash: blender: command not found. I tried removing 'blender' and got: -bash: -b: command not found! What am I doing wrong?? It could be the operating system - since I upgraded to OSX Mountain Lion, so many things have been going wrong! :( – SteveW Jun 30 '13 at 04:53
  • in case the blender command is not in the system path, you have to enter the path to the application in the command, like /some/mac/path/blender.app -b etc etc. – hjaarnio Jul 01 '13 at 00:39
  • also noting that the shutdown for mac and linux is not terribly useful, since you have to still be around to give the sudo password. Any solution to this, sudoing before the command is not an option, since it would run all the blenders as root? – hjaarnio Jul 01 '13 at 00:44
  • @hjaarnio thanks. I tried that but still no joy! It seems that it does not recognise the 'blender' or the '-b' commands: command not found – SteveW Jul 01 '13 at 02:13
  • In command line mode it seems to work even faster (approximately 30%). – Brain Mar 31 '16 at 09:17
  • @Brain totally depends on the scene, but it should never be slower. – Greg Zaal Mar 31 '16 at 18:00
  • https://docs.blender.org/manual/en/latest/advanced/command_line/ This should work.. – Johan Jul 27 '23 at 18:11
4

The Brender renderfarm addon to Blender allows you to queue multiple renders, both from within the same file and from different .blend files. You can download the most recent version from this site.

The installation procedure is a little complicated, but once you have it set up, all you have to do is press the "New Job" button in the Render menu.

Gwen
  • 11,636
  • 14
  • 68
  • 88
  • This looks great, although I must admit it looks a bit too advanced for me at this stage! :) – SteveW Jun 29 '13 at 22:00
2

First see documentation on Blender from the command line

Once you can run blender --version. You can then setup a queue.

You only have to launch blender once, then pass it all the files you want to render.

blender --background foo.blend -a  bar.blend -a  baz.blend -a

This renders (foo.blend, bar.blend, baz.blend).

You can pass other arguments such as setting the output path or number of threads, be sure to position these after the blend file and before the -a.

This example uses the number system threads and reads to //path_to_render.

blender --background foo.blend -t 0 -o //path_to_render -a
ideasman42
  • 47,387
  • 10
  • 141
  • 223
0

I just finished writing a little Python app because I got sick of writing the same command line options over and over again to accomplish this. Feel free to use it.

http://blenderq.readthedocs.io/en/latest/index.html

Alex Barry
  • 163
  • 8