Month August 2019

Rendering from the command line in Blender: Part 2 – down the rabbit hole

I recently wrote a tutorial about the basics of command line rendering in Blender. If you haven’t read it, check it out here.

There I explained why using the command line is a good idea. I also gave you the most basic command that you’ll likely use 80%+ of the time.

c:\>blender -b file.blend -a

(The previous article explains what that means).

In this part I want to go just a bit deeper into what’s possible using cmd.exe.

Before that I’ll mention a few things that came up in comments related to the Part 1.

Some people noted that rendering from the command line makes their renders slightly… slower (about -5% or so). Technically this doesn’t make sense. But I’ve seen this complaint often enough to believe it. So do your own tests and find out if rendering performance from cmd.exe is better, same or worse. The improved stability seems to be undisputed tho. To me that will often justify a (potential, small) performance hit.

I also learned about two Blender addons that help you render from the command line without the hassle of writing commands by hand. I have not used those. I include the links without a recommendation or comments:

https://blendermarket.com/products/b-renderon ($8)

https://github.com/RayMairlot/Batch-Render-Tools (for Blender 2.79, Free)

Alright back to writing commands.

Setting up Beginning and End of Frame Range

One thing I need from time to time is to set the beginning and end of my “active frame range” (the range of frame that will be rendered). I want to do so without opening blender and messing with the interface. Our trusty basic command will change only slightly:

c:\>blender -b file.blend -s XXX -e YYY -a

So we inserted “-s XXX -e YYY” between the .blend file and -a. As I mentioned in part 1 the order in which you write the command is important. Do not change it.

Let’s explore the new commands:

  • -s : stands for Start. That’s the first frame of your “frame range”
  • XXX : replace that with an actual number. If you want your render to start at frame 54, type “54”
  • -e : stands for End. That’s the last frame of your “frame range”
  • YYY : replace that with an actual number. If you want your render to end at frame 102, type “102”

So a realistic command would read something like:

C:>C:\Program Files\Blender\blender.exe -b C:\MyProject\scene.blend -s 54 -e 102 -a

This will render your scene.blend exactly the way you’ve set it up. It will only change the range of frames to be rendered.

Here is one more time-saving workflow that I use often.

Using batch (.bat) files to render several files in a row

Let’s say you have to render a couple of scenes. Each of them is not too render-heavy. You want to tell blender to render them one by one and go to sleep (I mean you want to go to sleep, not Blender).

You can do that with a batch (.bat) file. This is how to do it under Windows. I am certain the same can be achieved under Linux/Mac but the steps to get there will be slightly different (and I don’t know them).

In Windows open up and standard Notepad and simply type a command for each file you want to render. Separate them by pressing Enter after each one. The list will look something like this:

In Notepad click File > Save as… and give it a filename like “render.bat”. To be clear, you give it a .bat extension even though Notepad normally saves .txt files.

(Depending on your Windows settings, you may get warnings, errors etc. I can’t think of every possible Windows setting here but if you encounter a problem, let me know in the comments. I’ll do my best to help you solve it.)

Go to where you saved your .bat file. Double click it. Go to sleep*.
*make sure you triple check the settings of each file so you can sleep peacefully. Also make sure the commands are written correctly.

Bonus trick: Rendering several .blend files simultaneously.

I wouldn’t recommend doing this in most cases. But when you have to render several lightweight files, you can just open two or more instances of cmd.exe, write a render command and hit Enter in each one. Or you can create two or more .bat files and start them simultaneously. As I said it’s not something you’d normally do but I do find it beneficial on rare occasions.

This pretty much sums up all the ways I use the command line. As you can see it’s very simple to use. And it can be a life saver.

If you really want to go deep into all the options available for command line rendering, check out this page of the Blender manual: https://docs.blender.org/manual/en/latest/advanced/command_line/arguments.html

I hope this information helps optimize your renders.

Happy cmd-ing!

Blender – improve render stability 100% by rendering from the command line

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.

  1. Always write the command in this order.
  2. 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.

Happy rendering!

freelance

More ways to start freelancing and get clients

There are a few ways to get jobs that I see.

Knowing People

The best by far is “knowing people”. Most of my jobs last year came through one of my ex-teachers from college. We became friends, kept in touch and eventually we started working together. When people know you and trust you it’s really straightforward. You just discuss task, pay etc., then you start working.

Introductions

Number two on the list is “introductions”. This is almost as good as “knowing people”. If you’re introduced to a client by someone who knows both of you, trust is again already established.

One thing to note is that you never know who is going to introduce you. I once got a 3d job through a bartender friend for example. 🙂 So be a good, friendly person in general and form friendships with people from the industry and beyond.

The Brute Force Method

I wrote a full article about it so check it out! This is what I recommend to freelance beginners. This is one way you get to “know people”.

Building your profile on the internet

This one is actually quite tough even tho it’s often the main advice you’ll get… “Just post your stuff online and clients will start contacting you.” In my experience it doesn’t work that way.

Nevertheless it’s a tool that everyone should use. It can take some time to gain momentum but it’s worth it. Once you get a lot of eyes on you through your website and social media you should start to get *some* job offers here and there.

One of my jobs came from someone who saw my WIP threads on a forum, so that’s something you might want to do.

Most people think that building your profile on the internet is about showing your work on Artstartion, Twitter and Instagram. In my experience there are things that are much more likely to bring you a job:
-writing articles and tutorials (establishes you as an authority in your field)
-create a wip threads in forums and facebook groups (people can see your work process)
-directly contact and befriend other artists. As long as you don’t spam and behave as a decent human a lot of artist will be happy to talk to you!

After years of working and sharing your work you may get to a point where everyone is fighting to work with you. Until then use whatever tools you have to find good clients build trust with them.

Conclusion

One thing is for sure – when you do get a job, give 200%. If you work in a team do more than anyone else. Stand out. If you do, it is easy to get repeat customers or recommendations.
I am starting a job next month. I got it because on a previous project I did 4x the amount of work that was expected from me. One of the project leaders took notice and introduced me to someone else.

Lastly, lower your expectations and grow a thick skin. Sometimes you may do 10x the work and get nothing out of it. Sometimes people just don’t care about your tweets, forum posts, job applications etc.

The above strategies are good but they take time and effort. You need to keep a positive attitude until you gain traction. Until then hustle, grind it out, persevere 🙂