[Bf-python] Draw.RegisterEvent proposal

Willian Padovani Germano wgermano at ig.com.br
Thu Aug 5 21:35:00 CEST 2004


Hi,

----- Original Message -----
From: "joeedh" <joeeagar at prodigy.net>
To: <bf-python at blender.org>
Sent: Wednesday, August 04, 2004 8:18 PM
Subject: Re: [Bf-python] Draw.RegisterEvent proposal


> The thing that strikes me with the Draw module is that it makes scripts
> self-contained.  The problem I'm having with scriptlinks is figuring out
> which one is calling the script.   An event "loop" can solve this, but
> isn't the best soluition (I nearly killed my blend file a few times
> getting that to work) because it's difficult and cumbersome to actually
> implement.
>
> Now, if scriptlinks could call specific functions. . .then there would
> be no use for a Draw.RegisterEvent function.

I didn't test this myself, but it should work: try the Registry module
facilities.  You can keep a running script (with gui, so its namespace is
kept) or simply run the script and save data from it in the registry
dictionary (that is persistent).  From info in the registry dict, your
scriptlink could get any information a previous script saved there.

Note that a script should already be able to both create a Blender text,
write scriptlink code to it, then add this scriptlink to some supported obj
(obj, scene, material, lamp, camera).  Before leaving the script can also
remove the scriptlink and delete its Blender text.

Checking all possibilities will help getting clear what is still missing.
As Stephen said, there's (always) some talk or test going on about rewriting
the event loop, so both its hard to get approval for new stuff there and we
should stay in touch / participate so that once rewritten bpython hooks are
already part of it or easy to integrate.

--
Willian, wgermano at ig.com.br




More information about the Bf-python mailing list