[Bf-committers] Calling operators when drawing a panel

bartius crouch bartius.crouch at gmail.com
Mon Feb 7 12:36:53 CET 2011

> Campbell wrote:

You have a valid point that we need python integration:
> IMHO scripts should be able to handle notifiers and ability to define
> update functions for python defined properties.
> Python defined update functions I can do but handling notifiers should
> be discussed with Ton first since it may relate to python handling
> events which is a bigger project,
> will ask about it before the meeting tonight.

This is important in my opinion, as we need an alternative for writing
properties from within the draw panel.
Some background on my opinion: I'm just an enduser who enjoys using the
blender python api to extend blender's functionality. I've written several
scripts for Blender 2.5 and most use this feature as a workaround to create
live-updating interfaces. An example: one of the scripts displays all icons
there are in blender (the add-on is in svn trunk and distributed with
blender) and I use write-access to properties to enable searching within the
icon list. This could be done in a different way, but it would actually make
the script slower, having to recreate the list on each redraw, instead of
having to recreate it on a change in the search string.

I'm aware that allowing to change properties from withon the draw panel is
not ideal, and has the potential for sloppy and bug-producing code, as
Campbell pointed out*. But currently it's the only way we have to achieve
certain things with python. So it would be nice if the proper way (python
access to notifiers/listeners) was implemented in addition to just taking
away the only current method we have.

Bart (Crouch)

* http://markmail.org/message/6sg2clhu3ouap2oc

More information about the Bf-committers mailing list