[Bf-python] server-side python

Campbell Barton ideasman42 at gmail.com
Tue Dec 13 05:20:16 CET 2011


On Mon, Dec 12, 2011 at 5:34 PM, zadeek ummer <zcgiworks at gmail.com> wrote:
> hello,
>
> My name is Zadeek. I am currently working on a project which renders out
> images from blender on a server according to the requests from client side.
> Is it possible to link to database directly from a script in blender and
> then change the value in the blend file.
> i would really like a reply....

With the caveat that I know nothing about databases, assume you can
read 1's and 0's on some request... with that in mind you have 2
obvious choices.

1) load in some format from a database blender already supports - eg -
OBJ/3DS/X3D
   with very minor modifications to these importers you could do this
without touching the disk - using pythons StringIO class, otherwise
you'd need to save a temp file then tell blender to load it.

2) have blender request some blend file data, append it into the
current blender instance. Currently you cant avoid reading from the
filesystem, so you'll have no choice but to use a temp file,
for docs on linked library loading see:
http://www.blender.org/documentation/blender_python_api_2_60_6/bpy.types.BlendDataLibraries.html#bpy.types.BlendDataLibraries

If neither of these options are suitable I'd be interested to know
more of why, and what your attempting.



More information about the Bf-python mailing list