diff options
Diffstat (limited to 'source/blender/python/intern')
-rw-r--r-- | source/blender/python/intern/bpy.c | 4 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_library_write.c | 2 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 6 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_rna_anim.c | 5 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_rna_id_collection.c | 3 | ||||
-rw-r--r-- | source/blender/python/intern/gpu_offscreen.c | 3 |
6 files changed, 14 insertions, 9 deletions
diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c index a0461ed945d..751625e378b 100644 --- a/source/blender/python/intern/bpy.c +++ b/source/blender/python/intern/bpy.c @@ -34,7 +34,7 @@ #include "BLI_string.h" #include "BKE_appdir.h" -#include "BKE_global.h" /* XXX, G.main only */ +#include "BKE_global.h" /* XXX, G_MAIN only */ #include "BKE_blender_version.h" #include "BKE_bpath.h" @@ -138,7 +138,7 @@ static PyObject *bpy_blend_paths(PyObject *UNUSED(self), PyObject *args, PyObjec list = PyList_New(0); - BKE_bpath_traverse_main(G.main, bpy_blend_paths_visit_cb, flag, (void *)list); + BKE_bpath_traverse_main(G_MAIN, bpy_blend_paths_visit_cb, flag, (void *)list); return list; } diff --git a/source/blender/python/intern/bpy_library_write.c b/source/blender/python/intern/bpy_library_write.c index ead10efb212..76b7ccf72fa 100644 --- a/source/blender/python/intern/bpy_library_write.c +++ b/source/blender/python/intern/bpy_library_write.c @@ -95,7 +95,7 @@ static PyObject *bpy_lib_write(PyObject *UNUSED(self), PyObject *args, PyObject return NULL; } - Main *bmain_src = G.main; + Main *bmain_src = G_MAIN; int write_flags = 0; if (use_relative_remap) { diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index aa808118613..be0e9771a0a 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -7090,7 +7090,7 @@ PyObject *BPY_rna_module(void) PointerRNA ptr; /* for now, return the base RNA type rather than a real module */ - RNA_main_pointer_create(G.main, &ptr); + RNA_main_pointer_create(G_MAIN, &ptr); pyrna = (BPy_StructRNA *)pyrna_struct_CreatePyObject(&ptr); rna_module_ptr = &pyrna->ptr; @@ -7101,9 +7101,9 @@ void BPY_update_rna_module(void) { if (rna_module_ptr) { #if 0 - RNA_main_pointer_create(G.main, rna_module_ptr); + RNA_main_pointer_create(G_MAIN, rna_module_ptr); #else - rna_module_ptr->data = G.main; /* just set data is enough */ + rna_module_ptr->data = G_MAIN; /* just set data is enough */ #endif } } diff --git a/source/blender/python/intern/bpy_rna_anim.c b/source/blender/python/intern/bpy_rna_anim.c index 7903f92265b..7012e04628c 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" @@ -267,13 +268,15 @@ PyObject *pyrna_struct_keyframe_insert(BPy_StructRNA *self, PyObject *args, PyOb return PyBool_FromLong(result); } else { + ID *id = self->ptr.id.data; struct Depsgraph *depsgraph = CTX_data_depsgraph(BPy_GetContext()); ReportList reports; short result; BKE_reports_init(&reports, RPT_STORE); - result = insert_keyframe(G.main, depsgraph, &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, depsgraph, &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) diff --git a/source/blender/python/intern/bpy_rna_id_collection.c b/source/blender/python/intern/bpy_rna_id_collection.c index ee40d30d73b..4806c2266ba 100644 --- a/source/blender/python/intern/bpy_rna_id_collection.c +++ b/source/blender/python/intern/bpy_rna_id_collection.c @@ -160,7 +160,7 @@ static PyObject *bpy_user_map(PyObject *UNUSED(self), PyObject *args, PyObject * BPy_StructRNA *pyrna = (BPy_StructRNA *)self; Main *bmain = pyrna->ptr.data; #else - Main *bmain = G.main; /* XXX Ugly, but should work! */ + Main *bmain = G_MAIN; /* XXX Ugly, but should work! */ #endif PyObject *subset = NULL; @@ -230,7 +230,6 @@ static PyObject *bpy_user_map(PyObject *UNUSED(self), PyObject *args, PyObject * lb_index = set_listbasepointers(bmain, lb_array); while (lb_index--) { - if (val_types_bitmap && lb_array[lb_index]->first) { if (!id_check_type(lb_array[lb_index]->first, val_types_bitmap)) { continue; diff --git a/source/blender/python/intern/gpu_offscreen.c b/source/blender/python/intern/gpu_offscreen.c index a65469ea739..f0bc4b79296 100644 --- a/source/blender/python/intern/gpu_offscreen.c +++ b/source/blender/python/intern/gpu_offscreen.c @@ -36,6 +36,7 @@ #include "WM_types.h" #include "BKE_global.h" +#include "BKE_library.h" #include "ED_screen.h" @@ -195,6 +196,8 @@ static PyObject *pygpu_offscreen_draw_view3d(BPy_GPUOffScreen *self, PyObject *a return NULL; } + BLI_assert(BKE_id_is_in_gobal_main(&scene->id)); + fx = GPU_fx_compositor_create(); fx_settings = v3d->fx_settings; /* full copy */ |