background mode problems

Hi,

don’t know why i don’t find anything about it on the web…

I’m introducing to blender/python, i need to run some automated tasks in background mode from command line. I started with the simple default .blend file (the cube). This is my script:


import Blender
from   Blender       import *
from   Blender.Scene import Render

scene   = Scene.getCurrent()
context = scene.getRenderingContext()

context.setRenderPath("/tmp/blender/")
context.setImageType(Render.PNG)
context.render()

when i run that from the open blender gui with alt-p, it works

when i start it in backround mode from command line with

blender -b test2.blend -P test2.py

i get the result:

bad call to addqueue: 0 (18, 1)
bad call to addqueue: 0 (18, 1)
bad call to addqueue: 0 (18, 1)
segmentation fault

  1. Are there some code lines missing (due tu running without the blender gui) ?
  2. I don’t want to render to a window, only to an png-file in the render-path - but before the program exits i can see a window pops up for some milliseconds, so, how can i say that in the script (can’t find such a function in module Render or class RenderData)

thanks