[Bf-blender-cvs] [fac2e63bc05] master: Fix utterly broken code regarding GPUtextures of MovieClip in readfile.c

Bastien Montagne noreply at git.blender.org
Fri Jul 3 17:01:28 CEST 2020


Commit: fac2e63bc0545301bd57cb082ed003063dc9ce0f
Author: Bastien Montagne
Date:   Fri Jul 3 16:57:55 2020 +0200
Branches: master
https://developer.blender.org/rBfac2e63bc0545301bd57cb082ed003063dc9ce0f

Fix utterly broken code regarding GPUtextures of MovieClip in readfile.c

Treat those as pure runtime code, reset to NULL by reading code, for
now.

Think those could be handled like Image gputextures (i.e. considered
runtime cache and preserved across undo steps), but probably not
critical for now.

===================================================================

M	source/blender/blenloader/intern/readfile.c

===================================================================

diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index d9dcd72b0b6..820edbe974d 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -2034,7 +2034,6 @@ void blo_make_movieclip_pointer_map(FileData *fd, Main *oldmain)
 void blo_end_movieclip_pointer_map(FileData *fd, Main *oldmain)
 {
   OldNew *entry = fd->movieclipmap->entries;
-  MovieClip *clip = oldmain->movieclips.first;
   Scene *sce = oldmain->scenes.first;
   int i;
 
@@ -2045,10 +2044,6 @@ void blo_end_movieclip_pointer_map(FileData *fd, Main *oldmain)
     }
   }
 
-  for (; clip; clip = clip->id.next) {
-    BLI_freelistN(&clip->runtime.gputextures);
-  }
-
   for (; sce; sce = sce->id.next) {
     if (sce->nodetree) {
       bNode *node;
@@ -8467,6 +8462,10 @@ static void direct_link_movieclip(BlendDataReader *reader, MovieClip *clip)
   clip->tracking_context = NULL;
   clip->tracking.stats = NULL;
 
+  /* TODO we could store those in undo cache storage as well, and preserve them instead of
+   * re-creating them... */
+  BLI_listbase_clear(&clip->runtime.gputextures);
+
   /* Needed for proper versioning, will be NULL for all newer files anyway. */
   BLO_read_data_address(reader, &clip->tracking.stabilization.rot_track);



More information about the Bf-blender-cvs mailing list