[Bf-python] PYTHONPATH

Stephen Swaney sswaney at swbell.net
Mon Sep 15 02:55:51 CEST 2003


"www.stani.be" wrote:
> 
> 
> > >(...) It's a pitty that Python has to be launched
> > > inside Blender and that Blender can not be
> > launched
> > > from Python.  Will that one time be possible?
> > (...)
> > To really let Python control Blender (or better put:
> > making Blender modular
> > and friendly to external envs/programs) would
> > require a major rewrite.  Of
> > course this is only what I guess, and I wouldn't
> > call myself an experienced
> > programmer at all.

Something like this was kicked around at one of the
blender meetings at SIGGRAPH.  Blender could be written
in python and the gui and it's associated functionality
would simply be a python script.  Essentially, blender 
becomes a python extension instead of having the python 
interpreter embedded in blender.  This idea has a lot of
potential.

Someone said Maya and the Maya Extension Language ( MEL ) 
works like this.

> Ok, that's not necessary than.  Instead I would prefer
> if Blender could be started with a command launch
> option to load a script inside Blender itself and that
> Python also can shutdown Blender.  With these two
> additions, a lot becomes possible.


We are already part way there:

print 'say bye-bye!'
sys.exit()


> Thanks, that's what I need, at least if it works in
> Linux, because in Windows the site-packages path is
> already in the sys.path  Just curiosity: why is this
> different for windows and linux?
> Ciao,
> Stani

Good question.  I came across some comments in the python
source refering to the fact that Windows initialization was
different other platforms.  I did not pursue the matter.

I know that when I run python from the command line on linux 
not only is site-package in the path, but all the modules installed
there with a .pth file are added too.

-- 
Stephen Swaney			
sswaney at swbell.net



More information about the Bf-python mailing list