diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-22 13:46:16 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-22 13:46:16 +0300 |
commit | 646412004b1da5d6b7b831a5a49022d1fd138e0b (patch) | |
tree | c3e2ba99cd4eb8ea312a59efd4ed7a8e9c1c7f28 /source/blender/python | |
parent | b6b7c83dd8e4838d4819c25d95dd01cacf81c8d8 (diff) | |
parent | 2fe528424d168f124efca5d94c6b0363be49dbf3 (diff) |
Merge branch 'master' into blender2.8
Conflicts:
source/blender/makesrna/intern/rna_image.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_object_force.c
source/blender/makesrna/intern/rna_screen.c
source/blender/makesrna/intern/rna_sculpt_paint.c
source/blender/makesrna/intern/rna_space.c
source/blender/python/bmesh/bmesh_py_types.c
source/blender/python/generic/bpy_internal_import.h
source/blender/python/intern/bpy_rna_anim.c
source/blender/python/intern/gpu_offscreen.c
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/bmesh/bmesh_py_types.c | 4 | ||||
-rw-r--r-- | source/blender/python/generic/bpy_internal_import.c | 4 | ||||
-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 |
8 files changed, 19 insertions, 12 deletions
diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c index d32b8696c9c..394adb1dd3b 100644 --- a/source/blender/python/bmesh/bmesh_py_types.c +++ b/source/blender/python/bmesh/bmesh_py_types.c @@ -37,6 +37,7 @@ #include "BKE_customdata.h" #include "BKE_DerivedMesh.h" #include "BKE_global.h" +#include "BKE_library.h" #include "DEG_depsgraph.h" @@ -903,8 +904,9 @@ static PyObject *bpy_bmesh_to_mesh(BPy_BMesh *self, PyObject *args) bm = self->bm; + BLI_assert(BKE_id_is_in_gobal_main(&me->id)); BM_mesh_bm_to_me( - G.main, /* XXX UGLY! */ + G_MAIN, /* XXX UGLY! */ bm, me, (&(struct BMeshToMeshParams){ .calc_object_remap = true, diff --git a/source/blender/python/generic/bpy_internal_import.c b/source/blender/python/generic/bpy_internal_import.c index 0211e7bd880..c1e5f947110 100644 --- a/source/blender/python/generic/bpy_internal_import.c +++ b/source/blender/python/generic/bpy_internal_import.c @@ -175,7 +175,7 @@ PyObject *bpy_text_import_name(const char *name, int *found) Text *text; char txtname[MAX_ID_NAME - 2]; int namelen = strlen(name); -//XXX Main *maggie = bpy_import_main ? bpy_import_main:G.main; +//XXX Main *maggie = bpy_import_main ? bpy_import_main : G_MAIN; Main *maggie = bpy_import_main; *found = 0; @@ -224,7 +224,7 @@ PyObject *bpy_text_reimport(PyObject *module, int *found) Text *text; const char *name; const char *filepath; -//XXX Main *maggie = bpy_import_main ? bpy_import_main:G.main; +//XXX Main *maggie = bpy_import_main ? bpy_import_main : G_MAIN; Main *maggie = bpy_import_main; if (!maggie) { 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 */ |