From 20788e174751797c8c3f225f63444939cb8c54bf Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 20 Jun 2018 11:53:30 +0200 Subject: Cleanup: moar G.main removal. Nice trick from blender2.8, we now can get active scene from active window of windowmanager! --- source/blender/editors/space_nla/space_nla.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/space_nla/space_nla.c') diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c index 639195c16ac..745cea37ea3 100644 --- a/source/blender/editors/space_nla/space_nla.c +++ b/source/blender/editors/space_nla/space_nla.c @@ -178,14 +178,14 @@ static void nla_free(SpaceLink *sl) /* spacetype; init callback */ -static void nla_init(struct wmWindowManager *UNUSED(wm), ScrArea *sa) +static void nla_init(struct wmWindowManager *wm, ScrArea *sa) { SpaceNla *snla = (SpaceNla *)sa->spacedata.first; /* init dopesheet data if non-existent (i.e. for old files) */ if (snla->ads == NULL) { snla->ads = MEM_callocN(sizeof(bDopeSheet), "NlaEdit DopeSheet"); - snla->ads->source = (ID *)G.main->scene.first; // XXX this is bad, but we need this to be set correct + snla->ads->source = (ID *)WM_window_get_active_scene(wm->winactive); } ED_area_tag_refresh(sa); -- cgit v1.2.3