Page MenuHome

View3D Select event handler (Python API)
Needs ReviewPublic

Authored by Alexander Romanov (a.romanov) on Aug 3 2016, 3:54 PM.

Details

Summary

This patch adds ability to handle any select event in View3D.
See the use case in attached file.


I would like to use such handler in normal editor for value update in UI in the same way as in attached file.
I've made hooks for the following set of operators:
MESH_OT_select_all, OBJECT_OT_select_all, VIEW3D_OT_select_lasso, VIEW3D_OT_select_border, VIEW3D_OT_select_circle.
This patch also fixes the bug in VIEW3D_OT_select_border where the operator always returned OPERATOR_CANCELLED in the object mode.

Diff Detail

Event Timeline

Alexander Romanov (a.romanov) retitled this revision from to View3D Select event handler (Python API).
Alexander Romanov (a.romanov) updated this object.
Brecht Van Lommel (brecht) edited edge metadata.EditedAug 3 2016, 10:53 PM

This is working around the limitation that our notifier system is not available to python scripts. I'm not sure it's a good idea to start adding python events to work around this, where does it end? There's hundreds of such events that you might want to listen to, to update a particular UI panel based on changes elsewhere in Blender.

Personally I'm not in favour of adding such work arounds, I would rather see a better notifier system design.

@Brecht Van Lommel (brecht), I've already tried to do more common handlers for operators in D2052. If you have any thoughts or requirements to design of some new system, there is related task T48601.