[Bf-committers] blender command port - blender python server and client

Dietrich Bollmann diresu at web.de
Sun Jul 1 15:34:14 CEST 2007


Hello :)

Before starting to work on the command port patch I searched the
bf-committers list for some similar project.  I found one started by
Martin DeMello together with a couple of postings concerning his
project.  I contacted Martin and he sent me the sources of his
attempts which unfortunately he had no time to continue.

After some experiments with his sources I finally decided to approach
the problem in a different way and started over again.  Still, his
code helped me a lot to get on the way and I would like to thank him
for his initial help!

Thank you Martin :)

I also thought it might be helpful to repost his original mail and
some links to the scattered parts of the thread in order to put the
command port into its original context.

So here comes Martin's original posting:

| Subject: [Bf-committers] listener object
| url:
http://lists.blender.org/pipermail/bf-committers/2005-May/010727.html
| thread:
http://lists.blender.org/pipermail/bf-committers/2005-May/thread.html#10727
| ---
| I'd like to add a "listener" object to blender, to allow a script to
| be triggered by an external program writing to a socket. (Not
| necessarily proposing this be added to blender proper, but it would be
| very useful for my own copy.) Is this an intrinsically dangerous idea?
| (i.e. could it cause instability or crashes in blender?) If not, how
| would I go about doing it? (i.e., where in the code should I be
| looking to add something like this?)
| 
| martin

Later the thread continued here:
-
http://lists.blender.org/pipermail/bf-committers/2005-May/thread.html#10788
- http://lists.blender.org/pipermail/bf-python/2005-May/thread.html#2738
- http://lists.blender.org/pipermail/bf-python/2005-May/thread.html#2744

And finally it was mentioned again by Willian Padovani Germano
in the following mails:
- http://lists.blender.org/pipermail/bf-python/2005-August/002980.html
- http://lists.blender.org/pipermail/bf-python/2005-August/002994.html

...all this is old - but maybe these mails are still helpful somehow...

Cheers, Dietrich

PS: Sorry for posting this information so late - It took me a while to
find it after such a long time...


On Wed, 2007-06-27 at 12:57 +0900, Dietrich Bollmann wrote:
> Hi,
> 
> The appended patch makes it possible to start Blender in Python server
> mode.  Clients can connect and send Python commands via the command
> port to the server.
> 
>   - The Command Port allows to edit objects simultaneously using the
>     Blender GUI and one or more clients connected to Blender via the
>     command port.
>   - The patch also includes `blash', a Blender Python shell client.
>   - `blash' can be used with the emacs python mode - the result is a
>     formidable Blender Python development environment.
>   - Clients can be written in any language: lisp, Python, Perl, C,
>     C++, Java etc.
>   - The patch was only tested on Debian sid until now but should run
>     on any platform after a little customisation.
> 
> For a screen shot see http://formgames.org/blender/command-port/
> 
> Have fun,
> Dietrich
> 
> * Blender command port patch
> 
>   -
> https://projects.blender.org/tracker/index.php?func=detail&aid=6887&group_id=9&atid=127
> 
> * Example - a simple pyramid
> 
> The following example shows how the command port can be used to model
> a simple pyramid:
> 
>   - start the Blender server in some xterm
> 
>       $ blender --geometry 800x600+10+10 --bcp 6789 &
> 
>   - start blash in another xterm
> 
>       $ blash --port 6789
>       This is Blash - the GNU BLender-Again SHell :)
>       Connection to Blender Server established.   (IP address:
> 127.0.0.1, port: 6789)
> 
>   - enter blender python commands
> 
>       from Blender import *
> 
>       vertexes = [[1, 1, 0], [-1, 1, 0], [-1, -1, 0], [1, -1, 0], [0, 0,
> 1.27]]
>       faces    = [[3, 2, 1, 0], [0, 1, 4], [1, 2, 4], [2, 3, 4], [3, 0,
> 4]]
> 
>       mesh = Mesh.New('mesh')
>       mesh.verts.extend(vertexes)
>       mesh.faces.extend(faces)
> 
>       scene  = Scene.GetCurrent()
>       object = scene.objects.new(mesh, 'object')
>       Redraw()
> 
>       bye
> 
> 
> * Installation
> 
>   - make a directory to build Blender
> 
>       BCP=$HOME/bcp
>       mkdir -p $BCP
>       cd $BCP
> 
>   - download blender 2.44 sources
> 
>       wget http://download.blender.org/source/blender-2.44.tar.gz
>       wget http://download.blender.org/source/blender-2.44.tar.gz.md5sum
>       md5sum -c blender-2.44.tar.gz.md5sum
> 
>   - download blender command port patch
> 
>       wget
> http://formgames.org/blender/command-port/patches/blender-command-port-patch.2007-06-26.txt
> 
>   - unpack the blender sources
> 
>       gunzip blender-2.44.tar.gz
>       tar xvf blender-2.44.tar
> 
>   - patch them
> 
>       cd blender-2.44
>       patch -p0 < ../blender-command-port-patch.2007-06-26.txt
> 
>   - build blash and blender
> 
>       scons WITH_COMMAND_PORT=true blash
> 
>   - the (linux) binaries
> 
>       $BCP/install/linux2/blender
>       $BCP/install/linux2/blash
> 
> 
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers
> 



More information about the Bf-committers mailing list