Scene.callback_add/remove() #23582

Closed
opened 2010-08-30 00:44:55 +02:00 by Dan Eicher · 3 comments
Member

%%%The first patch (BPy_scene_callback.patch) adds the callback stuff to the Scene type and also includes a 'FRAME_CHANGE' event that calls a python callable object on a frame change.

Demo of the frame change feature -> http://vimeo.com/14510810

The second patch (BPy_scene_rendercall.patch, applies on top of the first one) adds 'PRE_RENDER' and 'POST_RENDER' events and is mainly to demonstrate how easy it is to add new event types -- which turns out to be a three or four line patch (ignoring the change to bpy_rna_callback.c for having a default type).

Works in the same way as the current region.callback_add/remove() methods;

handle = C.scene.callback_add(print, ('hello, world',), 'FRAME_CHANGE')
C.scene.callback_remove(handle)

Yep, I know 'the plan' is to have the event system handle this but I figured since it was super simple to implement, may be useful to someone and works now I may as well share...%%%

%%%The first patch (BPy_scene_callback.patch) adds the callback stuff to the Scene type and also includes a 'FRAME_CHANGE' event that calls a python callable object on a frame change. Demo of the frame change feature -> http://vimeo.com/14510810 The second patch (BPy_scene_rendercall.patch, applies on top of the first one) adds 'PRE_RENDER' and 'POST_RENDER' events and is mainly to demonstrate how easy it is to add new event types -- which turns out to be a three or four line patch (ignoring the change to bpy_rna_callback.c for having a default type). Works in the same way as the current region.callback_add/remove() methods; handle = C.scene.callback_add(print, ('hello, world',), 'FRAME_CHANGE') C.scene.callback_remove(handle) Yep, I know 'the plan' is to have the event system handle this but I figured since it was super simple to implement, may be useful to someone and works *now* I may as well share...%%%
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Bastien Montagne self-assigned this 2014-08-07 15:15:28 +02:00

Seems to be time to archive…

Seems to be time to archive…
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#23582
No description provided.