From 3ff8ff90ea66481b2604c147312a3348daece0c6 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 28 Nov 2011 17:55:01 +0000 Subject: Reset V3D_RENDER_SHADOW flag on file loading. This flag shouldn't be saved in .blend files but because of strange reason some files contains this flags which leads to object disappearing when disabling buffer shadow in material. Current trunk shouldn't be saving this flag and most probably buggy files were saved in some intermediate version of blender where this flag can be be saved. This should fix remained issue in #29255: Object invisible and weird polygons appearance --- source/blender/blenloader/intern/readfile.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 3db36a075d7..61d023d7fc0 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -12608,6 +12608,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) { Scene *sce; MovieClip *clip; + bScreen *sc; for(sce = main->scene.first; sce; sce = sce->id.next) { if (sce->r.im_format.depth == 0) { @@ -12626,6 +12627,19 @@ static void do_versions(FileData *fd, Library *lib, Main *main) settings->default_search_size= 51; } } + + 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_VIEW3D) { + View3D *v3d= (View3D *)sl; + v3d->flag2&= ~V3D_RENDER_SHADOW; + } + } + } + } } /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ -- cgit v1.2.3