From 0974368b322ac06b41c90c1dfd87a2df91f324b9 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 30 Apr 2012 11:31:22 +0000 Subject: [PATCH] Tomato: versioning patch for current files which have got curves view open --- source/blender/blenloader/intern/readfile.c | 34 +++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 753cd93b89a..a46d05fc97c 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -13389,6 +13389,40 @@ static void do_versions(FileData *fd, Library *lib, Main *main) } } + { + bScreen *sc; + + for (sc = main->screen.first; sc; sc = sc->id.next) { + ScrArea *sa; + for (sa = sc->areabase.first; sa; sa = sa->next) { + SpaceLink *sl; + + for (sl = sa->spacedata.first; sl; sl = sl->next) { + if (sl->spacetype == SPACE_CLIP) { + SpaceClip *sclip = (SpaceClip *)sl; + ARegion *ar; + int hide = FALSE; + + for (ar = sa->regionbase.first; ar; ar = ar->next) { + if (ar->regiontype == RGN_TYPE_PREVIEW) { + if (ar->alignment != RGN_ALIGN_NONE) { + ar->flag |= RGN_FLAG_HIDDEN; + ar->v2d.flag &= ~V2D_IS_INITIALISED; + ar->alignment = RGN_ALIGN_NONE; + + hide = TRUE; + } + } + } + + if (hide) { + sclip->view = SC_VIEW_CLIP; + } + } + } + } + } + } /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ /* WATCH IT 2!: Userdef struct init has to be in editors/interface/resources.c! */