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-15 18:21:07 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-06-15 18:21:07 +0300
commitda9b1b14ed0ffd29fcff8f4ca64fff5f034532fc (patch)
treef02c859d3d6ff3971de18390e720146a7181f5de /source/blender/editors
parent2e25a48b05004112344b04cd56760709eebfc1a4 (diff)
Cleanup: some more G.main removal/validation...
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/gpencil/gpencil_undo.c2
-rw-r--r--source/blender/editors/interface/interface_layout.c3
-rw-r--r--source/blender/editors/mesh/editmesh_utils.c2
-rw-r--r--source/blender/editors/physics/dynamicpaint_ops.c2
-rw-r--r--source/blender/editors/physics/physics_fluid.c2
-rw-r--r--source/blender/editors/physics/physics_pointcache.c2
-rw-r--r--source/blender/editors/undo/ed_undo.c2
-rw-r--r--source/blender/editors/util/ed_util.c4
8 files changed, 10 insertions, 9 deletions
diff --git a/source/blender/editors/gpencil/gpencil_undo.c b/source/blender/editors/gpencil/gpencil_undo.c
index 5e2be7c41f0..d35df8bc380 100644
--- a/source/blender/editors/gpencil/gpencil_undo.c
+++ b/source/blender/editors/gpencil/gpencil_undo.c
@@ -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;
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index cf3e3d9e599..c9145b7d247 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -1733,7 +1733,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;
diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c
index e1303b14f0e..4500aeda70a 100644
--- a/source/blender/editors/mesh/editmesh_utils.c
+++ b/source/blender/editors/mesh/editmesh_utils.c
@@ -358,7 +358,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)
{
diff --git a/source/blender/editors/physics/dynamicpaint_ops.c b/source/blender/editors/physics/dynamicpaint_ops.c
index c04fb8d63d1..480d17bbf85 100644
--- a/source/blender/editors/physics/dynamicpaint_ops.c
+++ b/source/blender/editors/physics/dynamicpaint_ops.c
@@ -313,7 +313,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 */
diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c
index 4b9ce1ca210..c740fc0667e 100644
--- a/source/blender/editors/physics/physics_fluid.c
+++ b/source/blender/editors/physics/physics_fluid.c
@@ -395,7 +395,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);
*/
diff --git a/source/blender/editors/physics/physics_pointcache.c b/source/blender/editors/physics/physics_pointcache.c
index 53aa14d3a56..5205463b5ab 100644
--- a/source/blender/editors/physics/physics_pointcache.c
+++ b/source/blender/editors/physics/physics_pointcache.c
@@ -139,7 +139,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);
diff --git a/source/blender/editors/undo/ed_undo.c b/source/blender/editors/undo/ed_undo.c
index 539d0245306..4472b8f9a09 100644
--- a/source/blender/editors/undo/ed_undo.c
+++ b/source/blender/editors/undo/ed_undo.c
@@ -200,7 +200,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;
}
diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c
index b22ab9d5878..67b43814d40 100644
--- a/source/blender/editors/util/ed_util.c
+++ b/source/blender/editors/util/ed_util.c
@@ -133,8 +133,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);