ability to have permanent callbacks that stay active when new blend files are loaded.
this works by tagging functions, eg:
def my_func(scene):
pass
bpy.app.handlers.permanent_tag(my_func, True) # <-- important bit
bpy.app.handlers.frame_change_pre.append(my_func)
This commit is contained in:
@@ -408,7 +408,7 @@ void WM_read_file(bContext *C, const char *filepath, ReportList *reports)
|
||||
#ifdef WITH_PYTHON
|
||||
/* run any texts that were loaded in and flagged as modules */
|
||||
BPY_driver_reset();
|
||||
BPY_app_handlers_reset();
|
||||
BPY_app_handlers_reset(FALSE);
|
||||
BPY_modules_load_user(C);
|
||||
#endif
|
||||
|
||||
@@ -538,7 +538,7 @@ int WM_read_homefile(bContext *C, ReportList *UNUSED(reports), short from_memory
|
||||
BPY_string_exec(C, "__import__('addon_utils').reset_all()");
|
||||
|
||||
BPY_driver_reset();
|
||||
BPY_app_handlers_reset();
|
||||
BPY_app_handlers_reset(FALSE);
|
||||
BPY_modules_load_user(C);
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user