I recently converted to command-line-ism.
In this article I’ll explain the benefits of rendering your final animation from the command line. (You know? That ancient looking Windows thing where you have to type commands by hand. )
It’s not as scary as it looks. I promise!!! And the benefits far outweigh the slight hassle it causes.
The main benefits, by the way, are speed and stability. Your renders finish faster and they’re less likely to crash.
I am using Windows but you can follow along with any OS that Blender runs on. The commands are exactly the same no matter the OS.
Just to be clear, I recommend the command line for your final renders. You can do your test renders etc within the interface but when it’s time to render a final animation it’s cmd.exe time.
Why I started using CMD
The turning point for me was when I tried to render some Flip Fluids simulation in Blender 2.8. As of this writing there is still a (blender) bug that causes problems between Flip Fluids and Blender 2.8.
When I rendered from the interface Blender crashed every few frames.
That prompted me to give the command line a try. I figured it would be simpler to copy-paste a command rather than re-opening Blender, changing parameters etc every few minutes.
But to my dismay the rendering from the command line simply NEVER crashed. It rendered hundreds of frames without a problem.
Crash every few minutes VS writing a short command and going out for a coffee…
Which one do you choose?
The 80/20 of Command Line Rendering
You can setup all sorts of options from the command line but the cool thing is, you don’t have to!
If you don’t want to go too deep into that rabbit hole you can simply remember one command.
>c:\blender_path\blender -b c:\file_path\blend_file.blend -a
This will render an animation with the exact settings that you defined in “blend_file.blend”. Just make sure you setup the correct image format, active frame range, image resolution, render samples, output folder, file format etc. etc. and the above command will respect all of them.
Let’s explore that a bit more. Before you can even type the above command you have to start the command line. There are several ways to do that but the way I do it is to press “Windows Key + R”. In the window that pops up type cmd and click OK. Done.
(I can’t help with Mac and Linux. Please find out for yourself!)
(EDIT: there is a page in the Blender manual, dedicated to starting the command line under each OS!)
Now we can look at the command in more detail. It’s as simple as this:
There only two things to keep in mind here.
- Always write the command in this order.
- In real world scenarios Blender itself and the blend file are in different folders so you have to add the file paths.
So your actual command will look something like this:
In Windows you can drag files from Explorer into the command line which will produce the file name and path. The only annoying things that it puts the whole string in quotation marks so you have to delete them by hand.
Update: Someone with the nickname “cgd” noted in the comments:
“You actually want those quotes to be added! Any spaces in the path name of the blender exe or the blend file will give you an error if you try and run it. “-cgd
So there you have it. Setup everything inside the interface like you normally would and save your file. Then close blender and execute the above command and you have faster and more stable renders.