[Bf-python] threading needed for pyverse

Willian Padovani Germano wgermano at ig.com.br
Sun Nov 23 22:55:48 CET 2003


Hi Brecht,

> Tom Dyar and I recently started working on python bindings for Verse.
(...)
> the demo I showed at the Blender Conference:
> http://users.pandora.be/blendix/verse/

This is cool : ), surely a great feature for Blender or any equivalent
program.

> But there is a problem. A Verse python script needs to check with the
> server regularly for updates using the function
verse_callback_update().
> For this some kind of timeout function is needed.

You're right, threading in Python/C, specially multi-platform could get
hairy -- though I can't know w/o trying.  It's better to try first a
simpler solution, at least for now (2.3x Blender series).

There is the GUI mechanism in Draw, done with Draw.Register.  Each time
the Text Editor is redrawn, Blender checks pointers to two callbacks:
draw and events.  If it finds one, it doesn't draw any text and instead
runs the registered code.  This currently allows scripts and Blender to
"run in parallel".

What you tried looks promissing, let's see if we can solve the issues,
so we can register a callback from a script to be executed regularly.
We can also extend the scriptlinks to execute a script on a new
"timeout" event, like done now for "frame changed", "redraw" and
"onload".

After 2.31 comes out this week, I'll start changing a few bpython
internal ways for the "new python ui", as Ton calls it.  We can include
something like this in the project, after the first steps.

Anyone got other ideas?

--
Willian, wgermano at ig.com.br




More information about the Bf-python mailing list