151 points · by julio_iglesias · 11y ago · 25 comments
http://wiki.povray.org/content/HowTo:Create_animations http://wiki.povray.org/content/HowTo:Encode_animations_as_Og...
I wonder if there are good resources to create Blender scenes in Python with the full rendering step.
(1) Blender 2.6, Python Manual with full API and Tutorials
http://wiki.blender.org/index.php/Doc:2.6/Manual/Extensions/...
(2) Run python scripts through blender from command line:
blender -b -P script.py
blender -b --python-console (for interactive console)
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Comm...
./blender -b --python-console
>>> import bpy
>>> bpy.ops.mesh.primitive_uv_sphere_add(size=3.0,location=(0,0,0))
>>> bpy.ops.render.render(write_still=True)
Does this work on a Mac and/or Linux?
Why not use Aqsis or Pixie or, if you like free but don't mind closed source, 3Delight? All are RenderMan compliant.
Cycles is also free, open source, and cross-platform, and Cycles seems to be both further ahead than either Aqsis or Pixie and moving faster. However, it could use someone to make a Python interface for it.
Now, this tutorial gives me a good excuse to try out POV-ray once again...
I think that's kind of silly. What if I am a Blender user and want to do some batch-manipulations using an external script?
But the OP's complaint is also a little silly, given that his Vapory library works by writing a temporary scene file, then running the POVRay renderer executable to generate an image file. The same technique can be done with any renderer with a standalone executable, which includes Blender -- you don't need direct access to Blender's internal Python API.
In Blender's case, you might need to write a library to author .blend files, which is non-trivial. But it might also be possible to use Blender's .py script files as an ad-hoc scene description format.