Fix #109887: Adding driver from python might crash #109895

Merged
Sergey Sharybin merged 1 commits from Sergey/blender:fix_109887 into main 2023-07-10 10:11:52 +02:00
1 changed files with 2 additions and 0 deletions

View File

@ -47,6 +47,7 @@
#include "../generic/py_capi_rna.h"
#include "../generic/python_utildefines.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_build.h"
/* for keyframes and drivers */
@ -588,6 +589,7 @@ PyObject *pyrna_struct_driver_add(BPy_StructRNA *self, PyObject *args)
bContext *context = BPY_context_get();
WM_event_add_notifier(BPY_context_get(), NC_ANIMATION | ND_FCURVES_ORDER, NULL);
DEG_id_tag_update(id, ID_RECALC_COPY_ON_WRITE);
DEG_relations_tag_update(CTX_data_main(context));
}
else {