[Bf-python] Interactive console + extension module.

Willian Padovani Germano wgermano at ig.com.br
Thu May 15 13:44:46 CEST 2003


Hi, I'm replying to the original poster and a reply at once: 

On Wed , 2003-05-14 at 18:38, Joe Garfield wrote: 
> (...) I would like to add a request to have Blender 
> reset/restart the python sub-process every time the user does ALT+P (The 
> reload directive didn't help at all in my experience).  This would definitely 
Is it enough to clean the global Interpreter dictionary?  If not I'd
like to know more about this ... 

In exppython I'm making a test with a new function:
Blender.ReleaseGlobalDictionary(bool) 

By default it will get rid of the global dictionary and start with a new
one whenever user presses ALT+PKEY.  To change this behavior (to keep
the "polluted" dictionary, call that function with bool (it's an int,
actually, but that's not a problem) equal to zero.  It's necessary to
have both options, since some scripts might need that: scripts that
generate content for other scripts that run after them, scripts that
stay "in the background" while others run, for example. 

> On Wednesday 14 May 2003 05:03 am, j.merritt at pgrad.unimelb.edu.au wrote:
> > 1.
> > Are there any (current) plans to integrate an interactive Python console
> > into Blender?
There's still quite some work to do to get exppython to simply replace
the current implementation.  Till 2.28 comes out, that's all we'll
(Michel and I) be able to work on, probably.  We know that users (like
us) have waited for too long for a stable, functional API, and want new
stuff added as soon as possible, but we still need some weeks to make
exppython substitute the old implementation. 

An interactive console is something to think about ... maybe some
simpler ways can avoid having to do that -- Blender is already quite
full of embedded apps. 

> > experimenting with the API.  To view the docstrings attached to various
> > objects, it's much easier to have a console and use either help(obj) or
> > print obj.__doc__ than to put these in a script and keep re-running it. 
> > It's also a more Python-esque way of doing things, I believe (I'll stand
> > corrected if anyone has good counter-examples! :-).
We'll have a good and friendly document with all that info -- The
reference for the API, with simple and more elaborate examples, doc
strings, etc. 

About fast access to doc strings, etc., users can keep a second Text
around just for printing them, that's the "already there" way.  We can
later, if people show interest, add a small text entry box widget to the
Text window where users can type Blender Python defined names and get
their doc string written to the default stdout. 

> > 2.
> > How difficult would it be to somehow set up the whole of Blender to run as
> > an extension module for Python?
There are many issues with Blender's source.  Specially the kernel.  You
can find many comments in the source code, made by ex-NaN programmers,
about the need to rewrite it.  Let's remember that Blender doesn't even
have UNDO.  The way Blender is now, it could be hard (specially because
the efort would be better employed in rewriting the key parts) to allow
it to do that. 

This is another point where writing exppython is important.  We're
getting experience that will be useful when Ton and the guys start
talking about a redesign.  Usually people mention Blender 3.0 when they
think about such big changes, right Michel? 

-- 
Willian, wgermano at ig.com.br




More information about the Bf-python mailing list