[Bf-python] scn.render.render() doesn't work with yafray when called from a command line script.
Dietrich Bollmann
diresu at web.de
Wed Aug 15 10:59:41 CEST 2007
Hi again - I found the answer myself:
On Wed, 2007-08-15 at 16:22 +0900, Dietrich Bollmann wrote:
> When trying to render the default scene with yafray from the command
> line, only a white image is generated. Using the [RENDER] button
> directly after the image is rendered correctly.
>
> I used the command
>
> blender -P render.py
>
> with 'render.py' being as follows:
>
> import Blender
> scn = Blender.Scene.GetCurrent()
> scn.render.renderer = Blender.Scene.Render.YAFRAY
> scn.render.render()
>
> Do I have to do something else to make yafray render correctly?
The following works:
import Blender
scn = Blender.Scene.GetCurrent()
scn.render.renderer = Blender.Scene.Render.YAFRAY
scn.render.yafrayRayDepth(5)
scn.render.yafrayGamma(1.0)
scn.render.render()
I found these settings by generating a yafray xml file for both
cases and comparing them after.
In another case the GI indirect lighting intensity
was 0.0 and a black image was rendered. The following
line solved the problem in this case:
scn.render.yafrayGIIndirPower(1.0)
In both cases a usable image was generated when using
the [RENDER] button. I therefor suppose that the default
values for these settings are generated differently when
using the Python API.
As the values used when rendering from the GUI give better
results it would probably be a good idea to use the same
values also for the Python API.
Anyway, sorry for the unnecessary posting,
Dietrich
More information about the Bf-python
mailing list