Merge branch 'master' into blender2.8
authorBastien Montagne <montagne29@wanadoo.fr>
Fri, 15 Jun 2018 15:25:41 +0000 (17:25 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Fri, 15 Jun 2018 15:25:41 +0000 (17:25 +0200)
source/blender/blenkernel/intern/gpencil.c
source/blender/editors/gpencil/gpencil_undo.c
source/blender/editors/interface/interface_layout.c
source/blender/editors/mesh/editmesh_utils.c
source/blender/editors/physics/dynamicpaint_ops.c
source/blender/editors/physics/physics_fluid.c
source/blender/editors/physics/physics_pointcache.c
source/blender/editors/undo/ed_undo.c
source/blender/editors/util/ed_util.c

index 9b79415f006d2db566e1f5a3365bde2cb6fc026b..6a59ea4439f3d190076d3e8f2dc3ef8c00e84446 100644 (file)
@@ -805,6 +805,7 @@ bGPdata *BKE_gpencil_data_duplicate(Main *bmain, const bGPdata *gpd_src, bool in
                return gpd_dst;
        }
        else {
+               BLI_assert(bmain != NULL);
                bGPdata *gpd_copy;
                BKE_id_copy_ex(bmain, &gpd_src->id, (ID **)&gpd_copy, 0, false);
                return gpd_copy;
index 5e2be7c41f08699ede41b9dcbb7d3d8797a2d7c3..d35df8bc380d1ae7f255801a9546080658c37f18 100644 (file)
@@ -179,7 +179,7 @@ void gpencil_undo_push(bGPdata *gpd)
 
        /* create new undo node */
        undo_node = MEM_callocN(sizeof(bGPundonode), "gpencil undo node");
-       undo_node->gpd = BKE_gpencil_data_duplicate(G.main, gpd, true);
+       undo_node->gpd = BKE_gpencil_data_duplicate(NULL, gpd, true);
 
        cur_node = undo_node;
 
index a67a77409089be75eebf602bb151fdf103b22c88..ac7bbb129121648585397dbf4de53afcc8610cc8 100644 (file)
@@ -1811,7 +1811,8 @@ static void search_id_collection(StructRNA *ptype, PointerRNA *ptr, PropertyRNA
        StructRNA *srna;
 
        /* look for collection property in Main */
-       RNA_main_pointer_create(G.main, ptr);
+       /* Note: using global Main is OK-ish here, UI shall not access other Mains anyay... */
+       RNA_main_pointer_create(G_MAIN, ptr);
 
        *prop = NULL;
 
index e18758a5a58ca87161aa507d437ee86174ef4982..64e6b477abe33441a73ad1fa58804889bf3135c7 100644 (file)
@@ -363,7 +363,7 @@ void EDBM_mesh_load(Main *bmain, Object *ob)
         * cycles.
         */
 #if 0
-       for (Object *other_object = G.main->object.first;
+       for (Object *other_object = bmain->object.first;
             other_object != NULL;
             other_object = other_object->id.next)
        {
index f45ee050ef9a48130ba784436c64e02dae3276b5..7f74dd4666a1706876d243e2ad58454d8a32459e 100644 (file)
@@ -316,7 +316,7 @@ static void dpaint_bake_endjob(void *customdata)
        G.is_rendering = false;
        BKE_spacedata_draw_locks(false);
 
-       WM_set_locked_interface(G.main->wm.first, false);
+       WM_set_locked_interface(G_MAIN->wm.first, false);
 
        /* Bake was successful:
         *  Report for ended bake and how long it took */
index 130dcba060d0edd1b5ddcafab750930abea38e62..904e4242ed127b4490d879eabce7ea3f79f343e9 100644 (file)
@@ -399,7 +399,7 @@ static void fluid_init_all_channels(bContext *C, Object *UNUSED(fsDomain), Fluid
 
                /* XXX: This can't be used due to an anim sys optimization that ignores recalc object animation,
                 * leaving it for the depgraph (this ignores object animation such as modifier properties though... :/ )
-                * --> BKE_animsys_evaluate_all_animation(G.main, eval_time);
+                * --> BKE_animsys_evaluate_all_animation(CTX_data_main(C), eval_time);
                 * This doesn't work with drivers:
                 * --> BKE_animsys_evaluate_animdata(&fsDomain->id, fsDomain->adt, eval_time, ADT_RECALC_ALL);
                 */
index a66dbfc789d60807bc66153bca3198a3873394c8..343804726bf5c489c6758d146ed7134cc0abd1f1 100644 (file)
@@ -140,7 +140,7 @@ static void ptcache_job_endjob(void *customdata)
        G.is_rendering = false;
        BKE_spacedata_draw_locks(false);
 
-       WM_set_locked_interface(G.main->wm.first, false);
+       WM_set_locked_interface(G_MAIN->wm.first, false);
 
        WM_main_add_notifier(NC_SCENE | ND_FRAME, scene);
        WM_main_add_notifier(NC_OBJECT | ND_POINTCACHE, job->baker->pid.ob);
index a28e24bc0f7031dfbc5172d0c653fca3b31e9dd8..c4bfe83ed4c71c334303aa67841d8a3557cde4ec 100644 (file)
@@ -205,7 +205,7 @@ bool ED_undo_is_valid(const bContext *C, const char *undoname)
  */
 UndoStack *ED_undo_stack_get(void)
 {
-       wmWindowManager *wm = G.main->wm.first;
+       wmWindowManager *wm = G_MAIN->wm.first;
        return wm->undo_stack;
 }
 
index a829f8c11442b6abae45acf7da667752726072be..549b9b7de77ebf9e679093c2a58ef2f10d075694 100644 (file)
@@ -145,8 +145,8 @@ void ED_editors_exit(bContext *C)
                return;
 
        /* frees all editmode undos */
-       if (G.main->wm.first) {
-               wmWindowManager *wm = G.main->wm.first;
+       if (G_MAIN->wm.first) {
+               wmWindowManager *wm = G_MAIN->wm.first;
                /* normally we don't check for NULL undo stack, do here since it may run in different context. */
                if (wm->undo_stack) {
                        BKE_undosys_stack_destroy(wm->undo_stack);