Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2018-06-22 12:37:47 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-06-22 12:37:47 +0300
commitcbf5c738d6edaa3e5feecab6a97327cbfd96e06e (patch)
treeea06760f7501bf735d9a6dc6c8242da59f3db671 /source/blender/python/intern/bpy_rna_anim.c
parent1870a1adc75dece1e9eac3aa632da6e903780c86 (diff)
Cleanup: get rid of last G.main's in bpy area.
Essentially 'validating' them as G_MAIN, and adding some asserts in dubious places, that handled IDs are actually in G_MAIN.
Diffstat (limited to 'source/blender/python/intern/bpy_rna_anim.c')
-rw-r--r--source/blender/python/intern/bpy_rna_anim.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/python/intern/bpy_rna_anim.c b/source/blender/python/intern/bpy_rna_anim.c
index 3eec87593dc..73809e96560 100644
--- a/source/blender/python/intern/bpy_rna_anim.c
+++ b/source/blender/python/intern/bpy_rna_anim.c
@@ -45,6 +45,7 @@
#include "BKE_fcurve.h"
#include "BKE_global.h"
#include "BKE_idcode.h"
+#include "BKE_library.h"
#include "BKE_report.h"
#include "RNA_access.h"
@@ -266,12 +267,14 @@ PyObject *pyrna_struct_keyframe_insert(BPy_StructRNA *self, PyObject *args, PyOb
return PyBool_FromLong(result);
}
else {
+ ID *id = self->ptr.id.data;
ReportList reports;
short result;
BKE_reports_init(&reports, RPT_STORE);
- result = insert_keyframe(G.main, &reports, (ID *)self->ptr.id.data, NULL, group_name, path_full, index, cfra, keytype, options);
+ BLI_assert(BKE_id_is_in_gobal_main(id));
+ result = insert_keyframe(G_MAIN, &reports, id, NULL, group_name, path_full, index, cfra, keytype, options);
MEM_freeN((void *)path_full);
if (BPy_reports_to_error(&reports, PyExc_RuntimeError, true) == -1)