diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/python/intern/bpy_driver.c | 7 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 4 |
2 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/python/intern/bpy_driver.c b/source/blender/python/intern/bpy_driver.c index f3ef55d29c4..319790340ca 100644 --- a/source/blender/python/intern/bpy_driver.c +++ b/source/blender/python/intern/bpy_driver.c @@ -41,6 +41,9 @@ #include "bpy_driver.h" +extern void BPY_update_rna_module(void); + + /* for pydrivers (drivers using one-line Python expressions to express relationships between targets) */ PyObject *bpy_pydriver_Dict= NULL; @@ -164,6 +167,10 @@ float BPY_driver_exec(ChannelDriver *driver) if(use_gil) gilstate= PyGILState_Ensure(); + /* needed since drivers are updated directly after undo where 'main' is + * re-allocated [#28807] */ + BPY_update_rna_module(); + /* init global dictionary for py-driver evaluation settings */ if (!bpy_pydriver_Dict) { if (bpy_pydriver_create_dict() != 0) { diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index d5a950fc5bb..f79f1d01a96 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -5906,7 +5906,11 @@ PyObject *BPY_rna_module(void) void BPY_update_rna_module(void) { +#if 0 RNA_main_pointer_create(G.main, rna_module_ptr); +#else + rna_module_ptr->data= G.main; /* just set data is enough */ +#endif } #if 0 |