Can I write a script that lets me render images from 2 different .blend files?

***I was very confused about where to put this thread, so finally decided to post here (please move if required)


So I want to render images from 3 projects that I’ve made headway in. These projects are in different .blend files. I’m too lazy to just manually start and save each render, then move to the next file.

I was wondering if there was a way I could tell Blender to render an image of project 1, save it, then render an image of project 2, save it and so on. Basically I was wondering if one can write a script that can batch render images from different .blend files.

I have no clue about how to make a script like this, or if it is possible, or if I can use the command line to do so. Can someone help?

Blender command line reference: http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Command_Line

Basically, you’ll make a short text file that goes something like:


blender -b file1.blend -F 1
blender -b file2.blend -F 1
blender -b file3.blend -F 1

Then save it and and run it as a script. The exact procedure for running a text file as a script varies depending on your OS. You can google it, or just ask here.

Yeah, sorry, my OS is Win 7 32-bit.

Correct me if I’m wrong, but imo shouldn’t that start rendering of all 3 files simultaneously? Hence, blender would crash and the script would become redundant.

I wanted to write a batch script that’d start rendering the first frame from the first project, then after the rendering is over, save the image as a png and move to the next project.

Or maybe add even more functionality by allowing me to input the paths of all the projects I wanted rendered, then specify an output directory for the images, then execute rendering one by one. Upon completion of all renders, it can run a shutdown command that’ll automatically shutdown the PC. Ideas?

But thanks for the help mate. Much appreciated.
Cheers!

Programmer-geek that I am, I actually go one step further and use make, a command-line tool popular with computer programmers who are building large projects consisting of maybe hundreds of files. So, I can actually say, make movie

All of the (command-line driven) renders are then performed as needed.

I’ve also noticed that these renders are faster. None of the overhead of driving the GUI interface occurs.

Batch scripts wait for each command to exit before running the next one, so they’d render in sequence.

Running blender from the command line can do all of that, you just need to input the correct flags. By default it reads things like output directory, active scene, start/end frame, output format, etc from the .blend file, but you can override that. See the link I posted previously for what flags are available and what order to set them.

If you want the PC to shutdown at the end, add the relevant command to the end of the script. http://pcsupport.about.com/od/commandlinereference/p/shutdown-command.htm

Most of this stuff isn’t Blender specific. That Blender wiki page contains pretty much all the Blender-specific info there is, the rest is just learning how to deal with shell scripts and the command line. There are a thousand tutorials on that, just google stuff like “how to make batch script on windows” and “windows command prompt basics”.

Okay, thanks for clearing that up! I really appreciate the help.
Just one other question: how can I get it to prompt me to input a .blend file directory and again prompt me for the directory to save in?
That way I don’t have to go to notepad to modify the arguments if I want a different .blend file to be rendred.

I’m sorry and I know this isn’t turning out to be too blender related.