Yet Another Command Line Render Question

I have heard that you can render a lot faster by using the command line in the prompt that opens with Blender. My problem is i tried typing this: blender-b MagnifyingGlass.blend -f 1 instead of rendering it opens another Blender screen! :o. If I confused anybody here is the rundown.

  1. open Blender
  2. open file to render
  3. open another dos prompt (the blender one won’t let me type in it)
  4. type blender-b MagnifyingGlass.blend -f 1
  5. Blender reopens?!

Sorry at the fact that this question has been asked hundreds of times, beleive me I know, I’ve searched it.

I tried what you typed, except that I put a space between “blender” and “-b”, and it works just fine.

Here’s what i type to render an animation from my Blender Slave (a computer on the floor that does nothing but render.

./blenderstatic -b <filename> -a

Although replace the ./blenderstatic with ./blender or just blender if you are using windows. And I actually don’t notice that big of a difference in rendering time when doing it from a console. I just use the command line when I SSH into that box for rendering animations.

Oh, and you don’t need to open Blender at all. Just go into the DOS prompt, and type that in from the Blender directory, and make sure the path to your file is correct.

Yep it should work like that, probably you need a -a in the end.

but anyway it is not much faster, you can gain a 10% or something more

It is very usefull for really memory consuming renderings inasmuch the Mb blender allocates for its GUI are not there any more and hence blender could swap less

Stefano

You only need the -a if you rendering an animation, and it will use the frame start and end defined in the file.

I tried “blender -b filename.blend -f 1” and it rendered the first frame just fine.

And as for the performance, I only got a 1% increase with that scene. Probably because it used very little RAM. But yeah, rendering from console is great for saving memory.

Yes, no real performance increase. One thing it allows though, set the command prompts priority to low and then the instance of Blender you launch from it should have a low priority as well. Makes for longer rendering but you can do other things, like edit your scene in another instance of Blender. Also requires alot of ram.

Something I noticed on my machine is that for really large images (like 4MP), Blender won’t show what is going on in the render window which opens. So I always wonder if it is really doing something. But, from the prompt you get the % done no matter what the image size…

I still can’t do it guys i’ve tried everything you gusy said. I still get this:

ERROR: Loading dragonlogo.blend-f failed: File corrupt
ERROR: Loading 1 failed <invalid read error>

Blender Quit

P.S. I also get a message that says that i don’t hav python 2.3 installed, is this required?

Thanks guys.

Try rendering a different blend file you have, or even just save the default scene as something and render it because it sounds like there may be something wrong with your file. You shouldn’t need python 2.3, but you might as well install it, because plugins are what make Blender even more powerful. You just need to take the time to learn to use them.

I had that problem trying to render a file I created in 3.?(the last version) using 3.7(that is the current one right).

You need a space between the filename and -f

blender <space> -b <space> filename <space> -f <space> 1

You mean 2.37?
(2.37a is the latest version)

Sorry guys… I gave up. I know, I know you guys helped me a lot but my computer just can’t do it. I tried EVERYTHING alll caps, no caps, this and that, man I’m so frustrated! Thanks again for your help :wink:

I’m not familar with the Command Prompt but I managed to get a .bat file* rendering different parts of blender files.

cd C:\Program Files\Blender Foundation\Blender
blender -b test.blend -s 1 -e 15 -a
blender -b test2.blend -s 1 -e 4 -a

although the only way I could get it to work was to go to the blender directory “cd C:\Program Files\Blender Foundation\Blender” first and make sure all the blend files were in the Blender directory. I couldn’t get a shortcut to work.

Q1. How do I tell the Command Prompt to render files in other directories?

Q2. Can I tell it to render different scenes from within the 1 blend file or will it only render the active scene?

Q3 I know there are other cool things you can do from the Command Prompt - are there any links to more info?

cheers
Neil

*(I’ve Just learnt that a .bat file is just a .txt file with the .txt replaced with .bat - when you launch it, (just double click) it runs all those commands from within the Command Prompt without you having to type them in each time.)

blender -h

gives all options

cd C:\path	o\blend\files
"C:\Program Files\Blender Foundation\Blender\blender" -b test.blend -a

You only need the quotes if there’s spaces in the path

Only the active scene, I think, but you can use the sequence editor to render them all at once.

[edit]
Actually, you can.

blender -b test.blend -S "scene name" -a

run

blender -h
  • it’ll list everything.

Oh this is wonderful! For my last animation project I was setting the alarm for 2am, then 4am etc to keep Blender rendering. I should have asked this ages ago.
Thanks!
n

All works very nicely. Thanks guys.

Just to sum up for any other Command Prompt noobs…

On Windows to render specified frame(s) from specified scene(s) for multiple .blend files do this…

  1. Open notepad and paste in this code…

cd C:\Documents and Settings\Neil Hunt\My Documents\Data\Blender Command Test
“C:\Program Files\Blender Foundation\Blender\blender” -b commandtest.blend -S Scene1 -s 1 -e 14 -a
“C:\Program Files\Blender Foundation\Blender\blender” -b commandtest.blend -S Scene2 -s 1 -e 18 -a

  1. Now find the folder that contains the .blend file you want to render, copy the full path name and replace my path name…

C:\Documents and Settings\Neil Hunt\My Documents\Data\Blender Command Test

…with yours. Don’t paste over the top of the cd (change directory) at the start.

  1. Now find the folder that contains your blender.exe file and replace my…

C:\Program Files\Blender Foundation\Blender\blender

…with your path name (it may be the same). Make sure you keep the " on each end.

  1. For each .blend file you want to render you need the previous line to find the Blender application plus a line like this…

-b commandtest.blend -S Scene1 -s 1 -e 14 -a

where “-b” means render this file in the background,
“commandtest.blend” is the name of your .blend file
“-S” is the name of the scene you want to render (if you leave “-S Scene1” out will it render the active scene? - not sure, you’ll have to find that out)
“-s 1” is start at Frame 1,
“-e 14” is end at Frame 14
“-a” is render animation

if you want to render different sections from the same scene the just add -s 1 -e 14 -a for each section. e.g. -s 1 -e 12 -a -s 52 -e 69 -a

if you have more than 1 folder/directory that contains your files then just put a line like…

cd C:\Documents and Settings\Neil Hunt\My Documents\Data\Blender Command Test 2

…ie your new path name and continue.

once you’re done, save the file and replace the .txt with .bat
You don;t have to keep this in a particular place. When you want to render all those files just double click it and go to bed. (No need to set your alarm).

P.S. Gurus and others…please make any corrections if anything I said here is completely false. I just thought it might help any uninformed people like myself.

Just to sum up for any other Command Prompt noobs…

On Windows to render specified frame(s) from specified scene(s) for multiple .blend files do this…

  1. Open notepad and paste in this code…

cd C:\Documents and Settings\Neil Hunt\My Documents\Data\Blender Command Test
“C:\Program Files\Blender Foundation\Blender\blender” -b commandtest.blend -S Scene1 -s 1 -e 14 -a
“C:\Program Files\Blender Foundation\Blender\blender” -b commandtest.blend -S Scene2 -s 1 -e 18 -a

  1. Now find the folder that contains the .blend file you want to render, copy the full path name and replace my path name…

C:\Documents and Settings\Neil Hunt\My Documents\Data\Blender Command Test

…with yours. Don’t paste over the top of the cd (change directory) at the start.

  1. Now find the folder that contains your blender.exe file and replace my…

C:\Program Files\Blender Foundation\Blender\blender

…with your path name (it may be the same). Make sure you keep the " on each end.

  1. For each .blend file you want to render you need the previous line to find the Blender application plus a line like this…

-b commandtest.blend -S Scene1 -s 1 -e 14 -a

where “-b” means render this file in the background,
“commandtest.blend” is the name of your .blend file
“-S” is the name of the scene you want to render (if you leave “-S Scene1” out will it render the active scene? - not sure, you’ll have to find that out)
“-s 1” is start at Frame 1,
“-e 14” is end at Frame 14
“-a” is render animation

if you want to render different sections from the same scene the just add -s 1 -e 14 -a for each section. e.g. -s 1 -e 12 -a -s 52 -e 69 -a

if you have more than 1 folder/directory that contains your files then just put a line like…

cd C:\Documents and Settings\Neil Hunt\My Documents\Data\Blender Command Test 2

…ie your new path name and continue.

once you’re done, save the file and replace the .txt with .bat
You don;t have to keep this in a particular place. When you want to render all those files just double click it and go to bed. (No need to set your alarm).

P.S. Gurus and others…please make any corrections if anything I said here is completely false. I just thought it might help any uninformed people like myself.

oops! sorry about the double post. you’re sure to get it now.
n

is it possible to run blender from the terminal on OS X? I tried all options I could think of, but nothing worked (or even recognized I was trying to run blender).

Does OS X have a shell? If no shell, then no command line…