|
Blender V4.3
|
Go to the source code of this file.
Classes | |
| struct | bCallbackFuncStore |
Functions | |
| void | BKE_callback_exec (Main *bmain, PointerRNA **pointers, int num_pointers, eCbEvent evt) |
| void | BKE_callback_exec_null (Main *bmain, eCbEvent evt) |
| void | BKE_callback_exec_id (Main *bmain, ID *id, eCbEvent evt) |
| void | BKE_callback_exec_id_depsgraph (Main *bmain, ID *id, Depsgraph *depsgraph, eCbEvent evt) |
| void | BKE_callback_exec_string (Main *bmain, eCbEvent evt, const char *str) |
| void | BKE_callback_add (bCallbackFuncStore *funcstore, eCbEvent evt) |
| void | BKE_callback_remove (bCallbackFuncStore *funcstore, eCbEvent evt) |
| void | BKE_callback_global_init () |
| void | BKE_callback_global_finalize () |
| enum eCbEvent |
{ACTION} use in cases where only a single callback is required, VERSION_UPDATE and RENDER_STATS for example.PRE/POST are useful to differentiate since renaming callbacks may break Python scripts.{ACTION}_PRE run before the action.{ACTION}_POST run after the action.{ACTION}_INIT when the handler may manipulate the context used to run the action.
Examples where INIT functions may be useful are:
INIT function may change the camera or render settings, things which a PRE function can't support as this information has already been used.INIT function could temporarily change the preferences.{ACTION}_POST_FAIL should be included if the action may fail.
Use this so a call to the PRE callback always has a matching call to POST or POST_FAIL.
PRE/POST are required.{ACTION}_INIT{ACTION}_COMPLETE when a background job has finished.{ACTION}_CANCEL When a background job is canceled partway through.
While cancellation may be caused by any number of reasons, common causes may include:
PRE/POST handlers may be used along side modal task handlers as is the case for rendering, where rendering an animation uses modal task handlers, rendering a single frame has PRE/POST handlers.All callbacks here must be exposed via the Python module bpy.app.handlers, see bpy_app_handlers.cc.
Definition at line 72 of file BKE_callbacks.hh.
| void BKE_callback_add | ( | bCallbackFuncStore * | funcstore, |
| eCbEvent | evt ) |
Definition at line 75 of file callbacks.cc.
References ASSERT_CALLBACKS_INITIALIZED, BLI_addtail(), and callback_slots.
Referenced by blender::asset_system::AssetLibraryService::app_handler_register(), BPY_app_handlers_struct(), FRS_init(), and blender::asset_system::AssetLibrary::on_blend_save_handler_register().
| void BKE_callback_exec | ( | Main * | bmain, |
| PointerRNA ** | pointers, | ||
| int | num_pointers, | ||
| eCbEvent | evt ) |
Definition at line 28 of file callbacks.cc.
References ASSERT_CALLBACKS_INITIALIZED, callback_slots, and LISTBASE_FOREACH_MUTABLE.
Referenced by BKE_blendfile_link_append_context_finalize(), BKE_blendfile_link_append_context_init_done(), BKE_callback_exec_id(), BKE_callback_exec_id_depsgraph(), BKE_callback_exec_null(), BKE_callback_exec_string(), and preferences_extension_repo_add_exec().
Definition at line 44 of file callbacks.cc.
References BKE_callback_exec(), and RNA_id_pointer_create().
Referenced by blender::ed::object::bake_invoke(), blender::ed::object::bake_job_canceled(), blender::ed::object::bake_job_complete(), BKE_scene_graph_update_for_newframe_ex(), blender::ed::space_node::compo_canceljob(), blender::ed::space_node::compo_completejob(), blender::ed::space_node::compo_startjob(), ed_undo_step_post(), ed_undo_step_pre(), render_callback_exec_id(), and scene_graph_update_tagged().
Definition at line 53 of file callbacks.cc.
References BKE_callback_exec(), depsgraph, RNA_id_pointer_create(), and RNA_pointer_create().
Referenced by annotation_paint_initstroke(), annotation_paint_strokeend(), BKE_scene_graph_update_for_newframe_ex(), ED_screen_animation_play(), and scene_graph_update_tagged().
Definition at line 39 of file callbacks.cc.
References BKE_callback_exec().
Referenced by preferences_extension_repo_add_exec(), preferences_extension_repo_remove_exec(), wm_file_read_post(), wm_homefile_read_exec(), wm_userpref_read_exec(), and wm_xr_session_create_cb().
Definition at line 64 of file callbacks.cc.
References BKE_callback_exec(), RNA_pointer_create(), str, and PrimitiveStringRNA::value.
Referenced by preferences_extension_repo_remove_exec(), render_callback_exec_string(), stats_background(), wm_file_read_post(), wm_file_write(), wm_homefile_write_exec(), wm_read_callback_post_wrapper(), and wm_read_callback_pre_wrapper().
| void BKE_callback_global_finalize | ( | ) |
Call on application exit.
Definition at line 108 of file callbacks.cc.
References BKE_callback_remove(), BKE_CB_EVT_TOT, callback_slots, callbacks_initialized, ListBase::first, and bCallbackFuncStore::next.
Referenced by BKE_blender_free(), blender::asset_system::tests::AssetLibraryServiceTest::TearDownTestSuite(), blender::asset_system::tests::AssetLibraryTest::TearDownTestSuite(), and blender::asset_system::tests::AssetLibraryTestBase::TearDownTestSuite().
| void BKE_callback_global_init | ( | ) |
Definition at line 103 of file callbacks.cc.
References callbacks_initialized.
Referenced by main(), BlendfileLoadingBaseTest::SetUpTestCase(), blender::asset_system::tests::AssetLibraryServiceTest::SetUpTestSuite(), blender::asset_system::tests::AssetLibraryTest::SetUpTestSuite(), and blender::asset_system::tests::AssetLibraryTestBase::SetUpTestSuite().
| void BKE_callback_remove | ( | bCallbackFuncStore * | funcstore, |
| eCbEvent | evt ) |
Definition at line 82 of file callbacks.cc.
References bCallbackFuncStore::alloc, BLI_assert_msg, BLI_findindex(), BLI_remlink(), callback_slots, callbacks_initialized, and MEM_freeN().
Referenced by blender::asset_system::AssetLibraryService::app_handler_unregister(), BKE_callback_global_finalize(), and blender::asset_system::AssetLibrary::on_blend_save_handler_unregister().