On Mon, Sep 12, 2011 at 9:27 PM, Edward K. Ream <[email protected]> wrote:

> Furthermore, even if we could run main() from Python, it's not at clear that 
> we could then access the *inited* modules from the DLL's.

This is a fascinating puzzle.  Python's C API is tantalizing, but at
present I see no way to use it to create a proper Leo/Blender bridge.

Suppose we start blender *from Leo* by calling main().  Is there a way
to use a C API call to get access to the *properly inited* bpy (or
_bpy module)?  I rather think not.

True, we can use the C API to run Python code using the embedded
Python interpreter, but that Python code will *not* run in the
environment created by main(!).  In other words, the Python code
embedded in Blender does not, in fact, have access to the Blender's
data...

It's frustrating: it would be relatively simple to create (in C) a way
for *external* Python programs to gain access to the *properly inited*
Blender environment.  The itsy-bitsy detail is that the C code doesn't
seem to exist.

However, it is just barely possible that there *do* exist one or more
access functions (or even variables) that would, say, allow access to
sys.modules *after* it has been inited by main() and its
helpers...I'll be looking for those bridges tomorrow.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.

Reply via email to