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-22 13:50:26 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-06-22 13:50:26 +0300
commit88158e4116a0108e68b59ffc5987104fa857a130 (patch)
tree06404ce907cf3c86f4eb22b6f9d336722afeafce /source/blender/makesrna
parent646412004b1da5d6b7b831a5a49022d1fd138e0b (diff)
Cleanup: 2.8-new G.main in RNA code.
Again, essentially validating them, and adding assert check if needed.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_scene.c5
-rw-r--r--source/blender/makesrna/intern/rna_screen.c6
-rw-r--r--source/blender/makesrna/intern/rna_space.c12
-rw-r--r--source/blender/makesrna/intern/rna_wm_manipulator.c2
4 files changed, 13 insertions, 12 deletions
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 84b4e882b66..4b0c955d51a 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -1485,7 +1485,8 @@ void rna_ViewLayer_name_set(PointerRNA *ptr, const char *value)
{
Scene *scene = (Scene *)ptr->id.data;
ViewLayer *view_layer = (ViewLayer *)ptr->data;
- BKE_view_layer_rename(G.main, scene, view_layer, value);
+ BLI_assert(BKE_id_is_in_gobal_main(&scene->id));
+ BKE_view_layer_rename(G_MAIN, scene, view_layer, value);
}
static void rna_SceneRenderView_name_set(PointerRNA *ptr, const char *value)
@@ -1541,7 +1542,7 @@ static void rna_Scene_editmesh_select_mode_set(PointerRNA *ptr, const int *value
ts->selectmode = flag;
/* Update select mode in all the workspaces in mesh edit mode. */
- wmWindowManager *wm = G.main->wm.first;
+ wmWindowManager *wm = G_MAIN->wm.first;
for (wmWindow *win = wm->windows.first; win; win = win->next) {
ViewLayer *view_layer = WM_window_get_active_view_layer(win);
diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c
index e2d9b833a4d..2a16d2a41ee 100644
--- a/source/blender/makesrna/intern/rna_screen.c
+++ b/source/blender/makesrna/intern/rna_screen.c
@@ -82,7 +82,7 @@ static void rna_Screen_redraw_update(Main *UNUSED(bmain), Scene *UNUSED(scene),
static int rna_Screen_is_animation_playing_get(PointerRNA *UNUSED(ptr))
{
/* can be NULL on file load, T42619 */
- wmWindowManager *wm = G.main->wm.first;
+ wmWindowManager *wm = G_MAIN->wm.first;
return wm ? (ED_screen_animation_playing(wm) != NULL) : 0;
}
@@ -95,7 +95,7 @@ static int rna_region_alignment_get(PointerRNA *ptr)
static void rna_Screen_layout_name_get(PointerRNA *ptr, char *value)
{
const bScreen *screen = ptr->data;
- const WorkSpaceLayout *layout = BKE_workspace_layout_find_global(G.main, screen, NULL);
+ const WorkSpaceLayout *layout = BKE_workspace_layout_find_global(G_MAIN, screen, NULL);
if (layout) {
const char *name = BKE_workspace_layout_name_get(layout);
@@ -109,7 +109,7 @@ static void rna_Screen_layout_name_get(PointerRNA *ptr, char *value)
static int rna_Screen_layout_name_length(PointerRNA *ptr)
{
const bScreen *screen = ptr->data;
- const WorkSpaceLayout *layout = BKE_workspace_layout_find_global(G.main, screen, NULL);
+ const WorkSpaceLayout *layout = BKE_workspace_layout_find_global(G_MAIN, screen, NULL);
if (layout) {
const char *name = BKE_workspace_layout_name_get(layout);
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 91515a61fcf..e7ff13fb23b 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -495,7 +495,7 @@ static void rna_SpaceView3D_lock_camera_and_layers_set(PointerRNA *ptr, int valu
v3d->scenelock = value;
if (value) {
- Scene *scene = ED_screen_scene_find(sc, G.main->wm.first);
+ Scene *scene = ED_screen_scene_find(sc, G_MAIN->wm.first);
int bit;
v3d->lay = scene->lay;
@@ -517,7 +517,7 @@ static View3DCursor *rna_View3D_Cursor_get_from_scene_or_localview(PointerRNA *p
{
View3D *v3d = (View3D *)(ptr->data);
bScreen *screen = ptr->id.data;
- Scene *scene = ED_screen_scene_find(screen, G.main->wm.first);
+ Scene *scene = ED_screen_scene_find(screen, G_MAIN->wm.first);
return ED_view3d_cursor3d_get(scene, v3d);
}
@@ -549,7 +549,7 @@ static float rna_View3DOverlay_GridScaleUnit_get(PointerRNA *ptr)
{
View3D *v3d = (View3D *)(ptr->data);
bScreen *screen = ptr->id.data;
- Scene *scene = ED_screen_scene_find(screen, G.main->wm.first);
+ Scene *scene = ED_screen_scene_find(screen, G_MAIN->wm.first);
return ED_view3d_grid_scale(scene, v3d, NULL);
}
@@ -680,7 +680,7 @@ static void rna_RegionView3D_view_matrix_set(PointerRNA *ptr, const float *value
static int rna_3DViewShading_type_get(PointerRNA *ptr)
{
bScreen *screen = ptr->id.data;
- Scene *scene = WM_windows_scene_get_from_screen(G.main->wm.first, screen);
+ Scene *scene = WM_windows_scene_get_from_screen(G_MAIN->wm.first, screen);
RenderEngineType *type = RE_engines_find(scene->r.engine);
View3D *v3d = (View3D *)ptr->data;
@@ -967,7 +967,7 @@ static int rna_SpaceImageEditor_show_uvedit_get(PointerRNA *ptr)
{
SpaceImage *sima = (SpaceImage *)(ptr->data);
bScreen *sc = (bScreen *)ptr->id.data;
- wmWindow *win = ED_screen_window_find(sc, G.main->wm.first);
+ wmWindow *win = ED_screen_window_find(sc, G_MAIN->wm.first);
ViewLayer *view_layer = WM_window_get_active_view_layer(win);
Object *obedit = OBEDIT_FROM_VIEW_LAYER(view_layer);
return ED_space_image_show_uvedit(sima, obedit);
@@ -977,7 +977,7 @@ static int rna_SpaceImageEditor_show_maskedit_get(PointerRNA *ptr)
{
SpaceImage *sima = (SpaceImage *)(ptr->data);
bScreen *sc = (bScreen *)ptr->id.data;
- wmWindow *win = ED_screen_window_find(sc, G.main->wm.first);
+ wmWindow *win = ED_screen_window_find(sc, G_MAIN->wm.first);
ViewLayer *view_layer = WM_window_get_active_view_layer(win);
return ED_space_image_check_show_maskedit(sima, view_layer);
}
diff --git a/source/blender/makesrna/intern/rna_wm_manipulator.c b/source/blender/makesrna/intern/rna_wm_manipulator.c
index 4ae1e107e28..6cfee512ff7 100644
--- a/source/blender/makesrna/intern/rna_wm_manipulator.c
+++ b/source/blender/makesrna/intern/rna_wm_manipulator.c
@@ -261,7 +261,7 @@ static wmManipulator *rna_ManipulatorProperties_find_operator(PointerRNA *ptr)
#endif
/* We could try workaruond this lookup, but not trivial. */
- for (bScreen *screen = G.main->screen.first; screen; screen = screen->id.next) {
+ for (bScreen *screen = G_MAIN->screen.first; screen; screen = screen->id.next) {
IDProperty *properties = ptr->data;
for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
for (ARegion *ar = sa->regionbase.first; ar; ar = ar->next) {