Blender command line interface

Hi,

I’m using the following script to render a visualization on linux:

blender -b source.blend -s 1 -e 500 -a

Is there any way I can do the following things using script:

Specify the directory where the output is saved as an argument on the command line. When using the script above the ouput is rendered in the directory which you’ve specified in the GUI. So I want be able to set the output directory. It will also do if I could set the directory path to current working directory where the blender programme is running. But I don’t know how to specify this in linux ("." , “./” , “/.” ???). Any tips?

Is it possible to determine the number of frames in the animation from the blend file (not in GUI)?

I noticed the output file (avi in my case) is of the form xxxx-yyyy.avi where xxxx is the start and yyyy the end frame. Is there a way specify an output file name as an argument on the command line? If not, how can I determine the filename (from script)?

I want to split the rendering in different subjobs which will be executed on different nodes (kind of like stefano’s script, but without rsh). I end with for example five avi’s which I have to merge? Any ideas on how to do this using blender or Java?

thnx,

Rutger

Well, that’s a very minimalistic script :wink:

No

Neither (AFAIK), but if you dont specify -s and -e it should use those defined in the GUI

Neither, you are out of luck, but since xxxx is the first frame number
and yyyy is the last frame number and you have specified them in the command line -s and -e swithces :slight_smile:

Mmmm… without rsh? you need a way to tell another machine
‘hey! do this’ and rsh is the simplest.

Otherwise you must build a client/server network app, this implies master part continuosly running on each node, probing a TCP/IP port of your choiche. When a request arrives to that port it parses it, executes it and later on sends results/acknowledgment to client.

THis is a fairly difficult task, not sure it is worth the effort, just to avoid the rsh server.

Stefano

thnx,

Rutger[/quote]

Hi Stefano,

Thanks for your reply. The reason I’m not using RSH is that I want to submit the subjobs on a Grid using only services provided by the grid middleware. I know the script is simple, but I will implement the logic layer elsewhere. As far as I know the command line interface doesn’t support more functionality which might be usefull for me, correct me f I’m wrong. Too bad you can’t determine the number of frames or the output path and file name. But I think I already solved this with the grid middleware.

Just one more question: What do you think would be a good way to estimate the time it will take to render a movie? Assuming that each frame will take about the same amount of time to render I was thinking of rendering a number of random frames and then use the mean as an estimate fot the entire movie. And what does for example an increase of CPU speed of factor 2 mean for performance?

regards,

Rutger

http://www.angelfire.com/ks/bobthevirus/3dstuff/

a link to a (sorta ) implementation of this in java - feel free to nick whatever parts of the code you want - i AM workining on an updated version, but have to wait til ive got my comp back…

Which middleware? I use PVM but, since PVM needs RSH in the end I decided not to bother with PVM and use RSH :stuck_out_tongue:


$ ./blender.exe -h
Blender V 2.27
Usage: blender [options ...] [file]

Render options:
  -b <file>     Render <file> in background
    -S <name>   Set scene <name>
    -f <frame>  Render frame <frame> and save it
    -s <frame>  Set start to frame <frame> (use with -a)
    -e <frame>  Set end to frame (use with -a)<frame>
    -a          Render animation

Animation options:
  -a <file(s)>  Playback <file(s)>
    -p <sx> <sy>        Open with lower left corner at <sx>, <sy>
    -m          Read from disk (Don't buffer)

Window options:
  -w            Force opening with borders
  -W            Force opening without borders
  -p <sx> <sy> <w> <h>  Open with lower left corner at <sx>, <sy>
                        and width and height <w>, <h>

Game Engine specific options:
  -g fixedtime          Run on 50 hertz without dropping frames
  -g vertexarrays       Use Vertex Arrays for rendering (usually faster)
  -g noaudio            No audio in Game Engine
  -g nomipmap           No Texture Mipmapping
  -g linearmipmap       Linear Texture Mipmapping instead of Nearest (default)

Misc options:
  -d            Turn debugging on
  -noaudio      Disable audio on systems that support audio
  -h            Print this help text
  -y            Disable OnLoad scene scripts, use -Y to find out why its -y
  -R            Register .blend extension
[/quote]

Is all, I'm afraid


[quote="rutger"]

Just one more question: What do you think would be a good way to estimate the time it will take to render a movie? 

[/quote]

Interesting question


[quote="rutger"]

Assuming that each frame will take about the same amount of time to render I was thinking of rendering a number of random frames and then use the mean as an estimate fot the entire movie. 

[/quote]

I won't assume that. The animation I'm currently rendering took an average of 3 minutes per frame for the first 69 frames.
Frame 70 rendered in 22 minutes, then a dramatic increase to frame 97, the last rendered, upt to now, for a net 1h2m.

If you take the average and then ask machine #1 to render frames 1-50 and machine #2 to render frames 51-100 machine #1 will end in 2h30m and machine #2... well...

If you are to implement serious logic I'd rather subdivide the animation in small chunks 5 to 10 frames and send them around, one chunk per CPU, the first CPU which finishes gets next chunk...

But to decide chunk size it is necessary to extimate the overhead due to .blend file loading. I mean, if to lad the .blend takes 1 minute and the rendering takes 1 minute then rendering an 100 frame animation in one run takes 101 minutes, redering it frame by frame with separate blender runs takes 200 minutes :)


[quote="rutger"]

And what does for example an increase of CPU speed of factor 2 mean for performance?

[/quote]

Don't know exactly, but Blender needs to access memory a lot in rendering, memory speed do matters.

Stefano

Sorry for not replying sooner.

I use the Globus Toolkit as my Grid middleware. I already feared my estimation wasn’t correct, but I still think I’m going to use it as a very rough estimate.

Regards,

Rutger

oh, about the chunck size:

Globus Jobsubmission produces a quite an overhead, so I want to keep my chuncksize relatively high. My current test environment only contains three nodes, so unfortunatelyI’ll be restricted by this to.