diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-07-23 05:43:30 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-07-23 05:43:30 +0400 |
commit | 026ac2492232fac4fb7350ff210ba34b353a84e2 (patch) | |
tree | 0667dafd2dc948c93e6ac7b5be42d80045bd2f6f /source/blender/editors | |
parent | 43d5357a2e0dc2be209bdcbdf63246002dda4a7f (diff) |
[#22488] Reloading scripts causes crash
F8 key enabled again, useful for script UI development.
- keying set freeing wasnt freeing from all scenes and the builtin list.
- PointerProperty() cant refer to a removed python srna type (fixed in rigify and netrender).
- Added a check for freeing a type used by a PointerProperty but its very slow, makes reloading take ~10sec. Only enabled this in debug mode for now.
Netrender register() function isnt re-registering the property, probably because the module is cached by python and not re-run.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/animation/keyingsets.c | 11 | ||||
-rw-r--r-- | source/blender/editors/space_script/script_edit.c | 10 |
2 files changed, 12 insertions, 9 deletions
diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c index 1c06266a148..301111d22fd 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -43,6 +43,7 @@ #include "DNA_constraint_types.h" #include "DNA_scene_types.h" +#include "BKE_main.h" #include "BKE_animsys.h" #include "BKE_action.h" #include "BKE_context.h" @@ -589,7 +590,7 @@ void ANIM_keyingset_info_register (const bContext *C, KeyingSetInfo *ksi) /* Remove the given KeyingSetInfo from the list of type infos, and also remove the builtin set if appropriate */ void ANIM_keyingset_info_unregister (const bContext *C, KeyingSetInfo *ksi) { - Scene *scene = CTX_data_scene(C); + Main *bmain= CTX_data_main(C); KeyingSet *ks, *ksn; /* find relevant builtin KeyingSets which use this, and remove them */ @@ -600,8 +601,14 @@ void ANIM_keyingset_info_unregister (const bContext *C, KeyingSetInfo *ksi) /* remove if matching typeinfo name */ if (strcmp(ks->typeinfo, ksi->idname) == 0) { + Scene *scene; BKE_keyingset_free(ks); - BLI_freelinkN(&scene->keyingsets, ks); + BLI_remlink(&builtin_keyingsets, ks); + + for(scene= bmain->scene.first; scene; scene= scene->id.next) + BLI_remlink_safe(&scene->keyingsets, ks); + + MEM_freeN(ks); } } diff --git a/source/blender/editors/space_script/script_edit.c b/source/blender/editors/space_script/script_edit.c index 71b37e514d7..6f41f235b7b 100644 --- a/source/blender/editors/space_script/script_edit.c +++ b/source/blender/editors/space_script/script_edit.c @@ -90,13 +90,9 @@ static int script_reload_exec(bContext *C, wmOperator *op) #ifndef DISABLE_PYTHON /* TODO, this crashes on netrender and keying sets, need to look into why * disable for now unless running in debug mode */ - if(G.f & G_DEBUG) { - BPY_eval_string(C, "__import__('bpy').utils.load_scripts(reload_scripts=True)"); - } - else { - BKE_reportf(op->reports, RPT_ERROR, "reloading is currently unstable, only operates in debug mode.\n"); - return OPERATOR_CANCELLED; - } + WM_cursor_wait(1); + BPY_eval_string(C, "__import__('bpy').utils.load_scripts(reload_scripts=True)"); + WM_cursor_wait(0); return OPERATOR_FINISHED; #endif return OPERATOR_CANCELLED; |