[Bf-python] Remote IPython & PyCrust Shell for Blender
Willian Padovani Germano
wpgermano at gmail.com
Tue Mar 18 02:14:47 CET 2008
Stani wrote:
(...)
> In which Blender version could this be available? Threading for sure
> would help!
Maybe 2.46, but threading was added to support pynodes and it's all
still experimental for now. As devs like you come with actual needs we
can try to improve things.
> If you are able to make threading work this will open tons
> of possibilities (server sockets, pyODE, better integration with
> ipython, ...). The nicest would be if the standard python threading
> module would just work. If that is impossible other solutions are
> welcome too, but please try to mimic the threading module api as that is
> what everyone knows.
A quick test I did here with the default threading module in Python
crashed Blender (Python fatal error caused by the GIL (global
interpreter lock) being already taken, from what I recall, which the
module didn't expect). I searched online but threading is really a weak
area in Python, specially its documentation, and I could only find
someone with the same problem (*), but no replies with a solution.
Adding access to grab and release the GIL via BPython is a possible turn
around.
(*) When you enable threading via the C Python API, the standard
threading module(s) fail with a fatal error, which is not a good
approach imo.
> One final note: it is really frustrating that it is impossible for
> scripts embedded in blender drawings (not the ones which are imported)
> that global variables don't work in the local scope.
Let me see if I understood you. You mean gui callbacks have no access to
the global dictionary used by the script. That's true, the dict is freed
but the callbacks are left, it's not the fault of any script, it's how
it's always been in BPython. Thinking about it, it indeed seems better
to keep the dicts, too.
PS: just for fun I'm taking a better look at C sockets programming,
maybe it'd be nice for inter process communication via a scriptlink.
Don't count on it, though, I'm just researching a little.
--
Willian
More information about the Bf-python
mailing list