[Bf-committers] bpy callback patch (replace scriptlink like functionality from 2.4x)

Campbell Barton ideasman42 at gmail.com
Sat Jun 25 05:04:13 CEST 2011


On Fri, Jun 24, 2011 at 11:18 PM, Matt Ebb <matt at mke3.net> wrote:
> On Fri, Jun 24, 2011 at 11:27 PM, Campbell Barton <ideasman42 at gmail.com>wrote:
>
>> This is something thats been requested to be brought back from 2.4x
>> for quite a while,
>> however I wasn't that happy with scriptlinks having to be setup per
>> datablock, then scanning every datablock on frame change to see if any
>> have frame change scriptlinks for example - not too efficient and
>> cumbersome to manage scripts attached to each datablock.
>>
>
> Hi Cam, I'm curious how this differs from Notifiers and Listeners inside
> blender already? Are there some problems inherent in making a 'python
> listener' for example which could then react when blender notifiers are
> sent?
>
> cheers
>
> Matt

Note, committed r37795, will look into adding different types of
events next, scene, object update.


Hey Matt,
Having notifiers in python could work but I think the purpose is quite
different and more on a WM level to avoid showing old data.

There is a use case for a notifier is so python defined space (when we
get them), can check if some data was modified and redraw.

But scriptlinks are used differently, eg:
* Before/After each frame is rendered call a function every  time, in
background mode and wait for the call to finish.
In contrast with notifiers:
* If a render is done let me know about it if you're not too busy (ei,
the queue doesn't flood), and I'll deal with it when I'm ready
(sometime later when the notifiers are handled).

-- 
- Campbell


More information about the Bf-committers mailing list