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.
This commit is contained in:
2018-06-22 11:37:47 +02:00
parent 1870a1adc7
commit cbf5c738d6
9 changed files with 21 additions and 14 deletions

View File

@@ -36,6 +36,7 @@
#include "WM_types.h"
#include "BKE_global.h"
#include "BKE_library.h"
#include "ED_screen.h"
@@ -169,7 +170,7 @@ static PyObject *pygpu_offscreen_draw_view3d(BPy_GPUOffScreen *self, PyObject *a
MatrixObject *py_mat_modelview, *py_mat_projection;
PyObject *py_scene, *py_region, *py_view3d;
struct Main *bmain = G.main; /* XXX UGLY! */
struct Main *bmain = G_MAIN; /* XXX UGLY! */
Scene *scene;
View3D *v3d;
ARegion *ar;
@@ -191,6 +192,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 */