[Bf-committers] Command Port Patch, Version 2, Blender 2.46, revision 15538
Dietrich Bollmann
diresu at web.de
Mon Jul 14 05:43:58 CEST 2008
Hi,
I finally found the time to refactor the command port patch:
The Blender Command Port 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.
Please refer to the corresponding thread on the Blender patch tracker
https://projects.blender.org/tracker/index.php?func=detail&aid=6887&group_id=9&atid=127
and the command port "home" page at
http://formgames.org/blender/command-port
Thanks, Dietrich
--- from the patch tracker ---
Hi,
Here comes a new version of the command port patch.
I adapted the patch to the current state of the blender repository
(Blender 2.46, revision 15538) and, following the advice of Stephen
Swaney "It is easier to wade thru patches if they deal with a single
topic." (Stephen, 2007/08/17), "stripped [it] down to a single feature."
(Stephen, 2007/12/09).
Hope it gets accepted this time :)
Cheers, Dietrich
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 -w -p 10 10 800 600 --command-port 6789 &
and erase the default cube
- 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 the sources of blender 2.46 revision 15538
svn checkout https://svn.blender.org/svnroot/bf-blender/tru
nk/blender at 15538
- download blender command port patch
wget http://formgames.org/blender/command-port/patches/blen
der-command-port-patch.2008-07-12.2.46.r15538.txt
- patch the sources
cd blender
patch -p0 < ../blender-command-port-patch.2008-07-12.2.4
6.r15538.txt
- build blash and blender
scons WITH_COMMAND_PORT=true blash
- the (linux) binaries
$BCP/install/linux2/blender
$BCP/install/linux2/blash
Note: If you want to try the patch with a newer state of the blender
sources you might update your copy with svn update and rebuild. If you
are lucky the patch still works...
For more information see the blender command port page
at http://formgames.org/blender/command-port/
More information about the Bf-committers
mailing list