Blender .bat files- My Solution (Edit)

K- Here we goes folks. This all about rendering in Windows with .bat files.

I had a problem and I needed a solution. I need to render my preset scenes on “CALL”. My scenes are renders of just about everything that you can imagine. My scenes go through changes due to whatever objects are appended to a scene. In some preset scenes the lighting is sunny, in others the room is at midnight. Then one scene is a render of a different perspective in the same building with the door just about to open. All of these different scenes complete a presentation that involves a series of images that describe what the nature of the presentation is all about and such. What ever changes happen in named files will be rendered out in the .bat files.

I know what my renders will look like. The scenes are set. I just needed a way to dump all this stuff out for compositing and work output. I needed an art factory. I needed production. I needed the hook up.

I looked at the Blender Batch renderers. They rendered my files but were buggy for some things that I did and I could not control them in the “exact” way that I needed to. So I set up these .bat files.-

First I placed my choice of Blender build at the foot of my hard drive- C:\Blender - .

These .bat files run a string of Blender renders. You type these .bat files in Notepad. Here is the setup.-

To find out all of the possible Blender syntax commands, make and run this .bat file.-

Blenderhelp.bat


C:\blender\blender –h


blenderrender1.bat


C:\blender\blender -b C:\blender\1\sunnyroom.blend -f -1
C:\blender\blender -b C:\blender\1\midnightroom.blend -f -1
C:\blender\blender -b C:\blender\1\roomdoor.blend -f -1


blenderrender2.bat


C:\blender\blender -b C:\blender\2\sunnybigao.blend -f -1
C:\blender\blender -b C:\blender\2\midnightroomao1.blend -f -1
C:\blender\blender -b C:\blender\2\midnightroomao2.blend -f -1
C:\blender\blender -b C:\blender\2\roomdoorao.blend -f -1


Oh snap, I got to put some Yafray stuff in the oven-

Yafrender1.bat


C:\blender\blender -b C:\blender\3\yafsunnyroom.blend -f -1
C:\blender\blender -b C:\blender\3\yafmidnightroom.blend -f -1
C:\blender\blender -b C:\blender\3\yafroomdoor.blend -f -1


Now to render a collection of prepared .bat render files you need this .bat file setup.-

Blenderbatrun.bat


call C:\ blenderrender1.bat
call C:\ blenderrender2.bat
call C:\ Yafrender1.bat


That’s it for now. There is so much more that can be done with .bat files in Windows to help you to automate your 3d artwork production.

Get yo’ geek on!

Blend on!

make a batch file to run the batches

Oh Duh??? Thanks SamAdam. I’m new to the manual batch rendering thang. Now I can’t stop myself.

Blend on!

Now I need to learn how to hook this up in Linux. Onward and upward.

Blend on!

Oh Duh??? Thanks SamAdam. I’m new to the manual batch rendering thang. Now I can’t stop myself.

Blend on![/quote]your first post was a little vague, you know.

Oh Duh??? Thanks SamAdam. I’m new to the manual batch rendering thang. Now I can’t stop myself.

Blend on![/quote]your first post was a little vague, you know.[/quote]

Well, I didn’t really know about every step that I had to take to get my .bat setup. But now, it’s on. Now I’m working out a way to setup “timed” .bat operations that will run weekly so that I can work on my .blends and automatcally render the scenes. Then I can collect the files for compositing later.

Oh Duh??? Thanks SamAdam. I’m new to the manual batch rendering thang. Now I can’t stop myself.

Blend on![/quote]your first post was a little vague, you know.[/quote]

Well, I didn’t really know about every step that I had to take to get my .bat setup. But now, it’s on. Now I’m working out a way to setup “timed” .bat operations that will run weekly so that I can work on my .blends and automatcally render the scenes. Then I can collect the files for compositing later.[/quote]

In Linux stuff like this is very easy, just make a cron-job for the script.

A bash-script in Linux usually starts with a line like this

#!/bin/bash

Then just put your usual blendercommands in there after that line. (just like you would type them on the commandline with a new command on each line)

After that you need to make it runable

$ chmod +x yourscript

And this is how I make a script/program run weekly on my Gentoo-linux (things may differ a bit in other distributions):

$ echo "/path/to/your/script/yourscript" > /etc/cron.weekly/blendermagic

You can put the script in /etc/cron.weekly/ directly instead if you want.

Thanks for the tips!

Batch files are always handy for rendering more than one project :)…

Also like the part of being able to specifiy the start and end frames of an anim, just for those days when your computer crashes or if you need the computer for something :)…

Oh Duh??? Thanks SamAdam. I’m new to the manual batch rendering thang. Now I can’t stop myself.

Blend on![/quote]your first post was a little vague, you know.[/quote]

Well, I didn’t really know about every step that I had to take to get my .bat setup. But now, it’s on. Now I’m working out a way to setup “timed” .bat operations that will run weekly so that I can work on my .blends and automatcally render the scenes. Then I can collect the files for compositing later.[/quote]

There’s the Windows Scheduled Tasks command in /programs/Accessories directory that might help, just don’t know if it will work with batch files or if at all (buggy for me) :)…

Remember to use the -B flag (as opposed to -b) for much faster (in my experience about 15-20%) rendering if your computer isn’t doing anything else.

I’ve ran loads of batches in my sleep before, dead useful.

whats that?

It’s background rendering, but tells the OS it’s maximum priority.

Certainly on my WinME machine the difference was huge.

You can also do the following to set a priority level:

START [LOW/BELOWNORMAL/NORMAL/ABOVENORMAL/HIGH/REALTIME] blender.exe /b file.blend -f 1

For example:

START /BELOWNORMAL Blender.exe -b ocean.blend -f 15

Whoa! I didn’t know that. Thanks for the tip Ripsting!