A large part of Blender logic is implemented through operators' calls. And sometime it is necessary to handle such events.
For Blend4Web this feature is important more for user usability now. For example adding new custom node tree for Logic Editor in Blend4Web needs some handle (set this tree as default). And we also have some custom properties that could be set automatically after some event.
I've made an attempt to solve this issue here D2052. Hooks are implemented for all Blender operators, and such freedom can bring bad consequences, first of all in performance.
I see the following ways for improvements:
- Make filters on C side to invoke the method for specific operators only.
- Make another handler system for operators only (where callbacks are stored in the list inside the concrete operator type), and keep the current system for high level events like "Select Object" that could include a set of events: (object_ ... create / delete / select / hide / reveal / mode_change ... _pre / _post).