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_graph/space_graph.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/space_graph/space_graph.c') diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c index 59d7d7500ae..d208ead317b 100644 --- a/source/blender/editors/space_graph/space_graph.c +++ b/source/blender/editors/space_graph/space_graph.c @@ -181,14 +181,14 @@ static void graph_free(SpaceLink *sl) /* spacetype; init callback */ -static void graph_init(struct wmWindowManager *UNUSED(wm), ScrArea *sa) +static void graph_init(struct wmWindowManager *wm, ScrArea *sa) { SpaceIpo *sipo = (SpaceIpo *)sa->spacedata.first; /* init dopesheet data if non-existent (i.e. for old files) */ if (sipo->ads == NULL) { sipo->ads = MEM_callocN(sizeof(bDopeSheet), "GraphEdit DopeSheet"); - sipo->ads->source = (ID *)(G.main->scene.first); // FIXME: this is a really nasty hack here for now... + sipo->ads->source = (ID *)WM_window_get_active_scene(wm->winactive); } /* force immediate init of any invalid F-Curve colors */ -- cgit v1.2.3