-P examples?

HI all,

I’m interested in playing with the new -P batch mode option.
I haven’t used python in blender for so long that, at this point,
I would learn better by example than I would by reading the API
spec. I was wondering if there were any good example scripts
for running in batch mode that do things like: start blender, add
an object, add a camera, render a frame, save rendered image,
and quit.

Thanks,
Chris

P.S. My apologies for cross-posting this on w.b.o.

Hos?!?!? Posting a question?!?!?

actually, on elysiun I haven’t heard anyone mention the new -P option

I had noticed it when looking for a way to export a file from the commandline without user intervention. I think my method is a bit kludgy using -P and an option for command line rendering so the blender UI doesn’t start [I merely ramble about how to get a script to run, I assume a text file in blender specifies info about what to export and such]

http://www.blender.org/modules.php?op=modload&name=phpBB2&file=viewtopic&t=4622

Hi z3ro d,

Thanks for the link. I find it really odd that there is so
little information about the -P flag… maybe it is something
that somebody started coding, then lost interest?

Anyways, I’ve been playing around a bit and it seems that
-P is really buggy and unusable anyways. For example, if
I try to get it to render using the python api:


import Blender
from Blender import *
from Blender.Scene import Render
scn = Scene.GetCurrent()
context = scn.getRenderingContext()
context.enableExtensions(1)
context.setRenderPath("/tmp/foo")
context.setImageType(Render.JPEG)
context.startFrame(2)
context.endFrame(10)
context.render()

When that is executed from the commandline in batch mode it
fails because there is no render window open (I think).

Oh well, maybe it will eventually be developed into something
usable …

Chris